---
name: a2a-outreach-matrix
description: Agent-to-Agent (A2A) outreach matrix for B2B lead generation — probe a company's public endpoints for agent cards / MCP / llms.txt / API docs, draft a one-question structured handshake, score the reply, and enforce hard rate limits and opt-out. Use when you need machine-to-machine prospecting instead of sending more cold emails, or when you want to audit a domain's A2A readiness.
version: 1.0.0
license: MIT
metadata:
  runtime: python3.9+
  dependencies: none (standard library only)
  side_effects: reads public web pages; optional mail send is manual-gated
---

# A2A Outreach Matrix

Three layers, one file each, no third-party dependencies:

| Layer | File | What it does |
|---|---|---|
| Recon | `a2a_probe.py` | One passive pass over a domain: agent card, A2A endpoint, MCP endpoint, `llms.txt`, OpenAPI, chat widget fingerprints, public emails. Labels **A / B / C** with a confidence tag. |
| Handshake | `a2a_handshake.py` | Builds an A2A JSON-RPC 2.0 `message/send` payload and a plain-text email twin (same content) with `X-A2A-*` headers and an embedded machine-readable block. |
| Conversion | `a2a_score.py` | Scores a reply 0–100 on explicit asks only (deliverable, deadline, project context, pricing, specs). Routes to `human` / `drip` / `sleep`; a refusal keyword routes to permanent opt-out. |
| Guard | `a2a_guard.py` | Hard rules in code: 1 action per domain per day, refusal list, append-only audit log. |
| Glue | `a2a_pipeline.py` | Runs probe → draft → optional send → CSV ledger (`leads/a2a_leads.csv`). |

## Why this exists

Cold email volume is not the bottleneck once open rates collapse. This pack targets the
subset of companies that already run an agent, an MCP server, or an `llms.txt`, where a
short structured message can be parsed and filed by *their* system instead of ignored by a
human inbox. It is additive to a normal outreach stack, never a replacement.

## Quick start

```bash
python3 a2a_probe.py https://example.com                 # one domain, prints class A/B/C
python3 a2a_probe.py -f examples/domains.txt -o out/p.json --sleep 3
python3 a2a_handshake.py --lines                         # capability catalogue per business line
python3 a2a_handshake.py --line tcm --to info@clinic.com --out out/
echo "please send the BOQ, tender closes 20 Jan" | python3 a2a_score.py --stdin
python3 a2a_guard.py --status
python3 a2a_pipeline.py -f examples/domains.txt --line skills   # draft only, no send
```

## Classification, honestly stated

- **A** — a valid agent card (`/.well-known/agent.json` or `agent-card.json`) or a JSON
  MCP descriptor was fetched and parsed. Machine-to-machine handshake is plausible; it is
  still unverified until the endpoint answers a `message/send`.
- **B** — `llms.txt` / OpenAPI / a chat widget was found. The company can *read* structured
  input but has no confirmed agent endpoint. Treat as one-way.
- **C** — nothing found. Do not send A2A payloads here; use the normal cold-email queue.

`confidence` is `high` only when the evidence is a parsed document, and `low` when it rests
on a widget fingerprint or a keyword mention. The probe never guesses from page copy alone.

## Guard rails (do not remove)

1. `a2a_guard` allows one action per domain per day. There is no retry loop anywhere in this
   pack; a failed fetch is a data point, not a reason to hammer the host.
2. `robots.txt` is fetched first and `Disallow` paths are skipped in every request, including
   the `/.well-known/` probes.
3. Any reply containing `unsubscribe`, `stop`, `not interested`, `do not contact`, `opt out`
   (and the Chinese 拒绝) is written to `state/refused.txt` permanently. `a2a_pipeline` checks
   that file before touching a domain again.
4. Every action is appended to `state/audit.jsonl` with timestamp, domain and finding.
5. GET only. No form posts, no authenticated calls, no reads of private endpoints, no
   concurrency.

## Structured email format

```
X-A2A-Protocol: handshake/1.0
X-A2A-Service: <service name>
X-A2A-Reply:    mailto:<line inbox>?subject=YES
X-A2A-Optout:   mailto:<line inbox>?subject=STOP
```

Body: three short paragraphs — one-line capability statement, one yes/no question, and what
happens on YES / STOP. Ends with a fenced JSON block (`{"a2a":"handshake/1.0",...}`) so a
mail-parsing agent can extract the same content a human reads. No prices, no promises, no
attachments on first contact.

## What this pack will not do

- It will not automatically send to addresses it discovers on a homepage. `--send` exists
  but is off by default, and the draft lands in `out/outbox/` for review.
- It will not claim a company "has an agent" from a chat bubble. Widgets are labelled as
  widgets.
- It will not produce lead volume. The addressable set is small (companies already
  automated); the value is quality and a lower competitive density.

## Files

```
a2a_probe.py  a2a_guard.py  a2a_handshake.py  a2a_score.py  a2a_pipeline.py
SKILL.md  README.md  examples/domains.txt  state/ (created at runtime)
```
