A2A
Verified connections to agents you do not own — passport verification, policy on both sides, and immediate blocking.
A2A is agent-to-agent: your agent invoking an agent in another organization, or theirs invoking yours. Both directions go through the gateway, so the same twelve-stage pipeline applies to a remote caller as to a local one.
A connection is unusable until its passport verifies
You register the remote party's expected public key. The connection starts
PENDING and stays unusable until verify confirms their passport against that
key.
Which means you cannot be talked into trusting a peer by them simply claiming an identity. You registered a key; the passport either matches it or it does not.
#Set it up in the console
Everything on this page can be done from the console, without the API: A2A → Connect a partner registers the connection, verifies the passport, reads what the partner offers and enables the capabilities you pick; the connection page sends a test call. Follow Connect a partner agent step by step, starting with the Veefore sample partner. The rest of this page is the reference.
#Register a connection
bashcurl -X POST https://veefore.example.com/v1/a2a/connections \
-H "Authorization: Bearer $VEEFORE_API_KEY" \
-H 'content-type: application/json' \
-d '{
"local_agent_id": "agt_01JAV…",
"direction": "OUTBOUND",
"remote_agent_id": "agt_partner_01ABC",
"remote_agent_name": "Logistics partner shipment agent",
"remote_endpoint_url": "https://agents.partner.example.com/a2a",
"remote_public_key": "MCowBQYDK2VwAyEA…",
"allowed_capabilities": ["shipment.query", "shipment.update"]
}'
allowed_capabilities is what you are willing to invoke on them, or accept from
them. It is not what they claim to offer — it is your side of the contract.
The local agent must be registered for the A2A protocol.
An empty list permits nothing: every call is refused until a capability is enabled.
Get remote_public_key out of band. Their exported passport includes it:
bashcurl -s https://agents.partner.example.com/v1/passports/agt_partner_01ABC/export
Out of band means out of band
Fetching the key from the same endpoint you are about to trust proves nothing — whoever controls that endpoint controls both halves. Exchange it through a channel that is independently authenticated: a signed email, a shared document with access control, an existing mutual-TLS link, a phone call.
This is the one step where a shortcut undoes the whole mechanism.
#Verify
bashcurl -X POST https://veefore.example.com/v1/a2a/connections/a2a_01ABC/verify \
-H "Authorization: Bearer $VEEFORE_API_KEY" \
-H 'content-type: application/json' \
-d '{ "passport_jws": "eyJhbGciOiJFZERTQSIs…" }'
Verifies the passport's signature against the key you registered. On success
the connection can be activated; on failure it stays PENDING and the reason
is recorded.
Re-verify when they rotate. A passport that stops verifying is a connection that stops working, which is the correct outcome and worth being able to recognise quickly.
#Discover what they offer
bashcurl -X POST https://veefore.example.com/v1/a2a/connections/a2a_01ABC/discover \
-H "Authorization: Bearer $VEEFORE_API_KEY"
Fetches the peer's Agent Card from /.well-known/agent-card.json on its
endpoint's host and records every capability it advertises, with its schemas. The
connection page in the console lists them, and
GET /v1/a2a/connections/{id}/capabilities returns the same list.
Discovery grants nothing. A capability is usable only once it is on
allowed_capabilities, which you still set. Each recorded capability shows
whether it is permitted or awaiting review.
Each one also gets a risk level that Veefore works out itself from the key,
description and input schema — records.delete with an all parameter is
CRITICAL. The card's own mutating: false is the peer's claim: it can raise
the level, never lower it. The level is never below the risk you gave the
connection.
Running discovery again keeps the record current:
- A capability whose schema changed is taken off
allowed_capabilitiesuntil you add it back, because you approved a different capability than the one now on offer. This is the rule MCP applies to a changed tool, and it means discovery can interrupt a working integration — on purpose. Re-add it once you have looked at the change. - A capability the peer stopped advertising is marked withdrawn, not deleted.
The Policy Builder offers discovered capabilities when you set a capability
condition, so a rule can be written before you permit one.
#Invoke
tsconst decision = await agent.veefore.a2aInvoke({
connection: 'partner-logistics',
capability: 'shipment.query',
action: 'query',
payload: { trackingId: 'TRK-8812' },
});
pythondecision = agent.veefore.a2a_invoke(
connection="partner-logistics",
capability="shipment.query",
action="query",
payload={"trackingId": "TRK-8812"},
)
Over the wire: POST /gateway/v1/a2a/invoke. Full pipeline, full action record,
full audit trail. You can also address a peer by remoteAgentId and supply a
passport inline, which is the shape used when a peer presents itself to you
rather than the reverse.
Policy needs a registered tool to evaluate. Enabling a capability does all of
it in one call — it creates the capability if needed, grants it to the
connection's agent, creates (or reuses) the A2A tool for it with the peer's
host on its destination allowlist, authorizes the agent for that tool, and adds
the capability to the connection's allowlist:
bashcurl -X POST https://veefore.example.com/v1/a2a/connections/a2a_01ABC/capabilities \
-H "Authorization: Bearer $VEEFORE_API_KEY" \
-H 'content-type: application/json' \
-d '{ "enable": ["shipment.query"], "disable": [] }'
POST /v1/a2a/connections/{id}/test with { "capability", "payload" } then
sends one real call as the connection's agent, through the same path the
gateway takes — what the console's Send a test call does.
Once policy allows it, Veefore sends the peer an A2A invocation: the request id
as the interaction id, so both organisations' audit trails correlate; a
single-use nonce; and your agent's passport, so the peer can apply its own
controls. It goes only to the connection's registered endpoint. The peer's
reply is validated, and its result comes back as decision.result. A
refusal comes back as a failed call carrying the peer's own reason. An A2A
tool called through /gateway/v1/actions instead of the bridge is refused,
because there is no connection to call.
Invocations take the same approval modes as guard() — onApproval: 'wait',
'defer' or 'throw', on_approval= in Python — and default to
VEEFORE_APPROVAL_MODE. A deferred invocation returns at once, and
resumeApprovals() performs it on a later turn once it is approved, exactly
once. This needs @veefore/sdk / veefore-py 1.7.0 or later.
veefore doctor fails a project that calls a peer directly with the A2A SDK
(@a2a-js/sdk, or a2a in Python), with the file and line, and
veefore integrate prints the a2aInvoke call to write in its place.
#Verifying a passport someone presents to you
bashcurl -X POST https://veefore.example.com/v1/passports/verify-external \
-H "Authorization: Bearer $VEEFORE_API_KEY" \
-H 'content-type: application/json' \
-d '{ "passport": "…" }'
Verifies the signature against the issuer's published platform key. It tells you the document is authentic and unaltered.
It does not tell you they are in good standing
Only the issuer knows whether that agent is currently revoked, suspended or under investigation. A passport is a snapshot, and snapshots go stale.
Use passport verification for who, trust evidence and your own policy for whether. They answer different questions and you generally want both.
#Block
bashcurl -X POST https://veefore.example.com/v1/a2a/connections/a2a_01ABC/block \
-H "Authorization: Bearer $VEEFORE_API_KEY" \
-H 'content-type: application/json' \
-d '{ "reason": "Partner reported a compromise of their agent fleet" }'
Immediate, and it applies to in-flight sessions. Refused with
A2A_CONNECTION_BLOCKED.
Blocking is the control to reach for when a partner tells you they have a problem. It is reversible, unlike revoking your own agent, so there is no reason to hesitate.
#Policy on A2A
tool.kind and tool.protocol are A2A, and the trust fields are available,
so you can be as conservative as the relationship warrants:
json{
"id": "rule-a2a-requires-verified-org",
"name": "A2A requires a verified counterparty",
"priority": 870,
"enabled": true,
"when": {
"kind": "group",
"id": "g-a2a-unverified",
"operator": "and",
"children": [
{
"kind": "condition",
"id": "c-protocol",
"field": "tool.protocol",
"operator": "eq",
"value": "A2A"
},
{
"kind": "condition",
"id": "c-org-verified",
"field": "trust.organization_verified",
"operator": "is_false"
}
]
},
"then": {
"decision": "BLOCK",
"reason": "A2A invocation requires a verified counterparty organization."
}
}
Amount ceilings are worth applying here too. A partner integration that legitimately handles small claims does not need the authority to handle a large one, and a bounded ceiling limits what a compromise on their side can do on yours.
#Inbound
When a remote agent invokes you, the same rules apply in reverse: the connection must exist and be verified, their passport must verify, the capability must be one you registered, and your policy decides. A remote caller gets no shortcut through the pipeline.
That symmetry is why A2A goes through the gateway rather than being an API your service exposes directly. One pipeline, one audit trail, one place to look.
#Practical advice
Register the narrowest capability set that works. shipment.query is a
different relationship from shipment.*.
Set a ceiling. Even where amounts are small, a bound limits a compromise on their side.
Re-verify on a schedule. Not only when something breaks. A connection that silently stopped verifying is a connection you are not using and have not noticed.
Record trust evidence about them. ORGANIZATION_VERIFICATION with an expiry
turns "we checked them once" into something policy can test and that lapses
visibly.
#Related
Step by step from the console, starting with the sample partner.
Every message, and its fix.
The document being verified, and its limits.
Deciding whether a verified peer is one you want.
Register, verify, block.
Why invocation goes through the gateway.