Agent-to-Agent (A2A) Delegation
When an orchestrator agent spawns subagents, child processes must not silently inherit unbounded power. pkg/a2a enforces cryptographic delegation envelopes and 3-step ECDH mutual authentication.
Delegation Envelope Specification
Every inter-agent task delegation is wrapped in a signed envelope:
{
"sender_agent_id": "orchestrator-main",
"recipient_agent_id": "subagent-researcher-1",
"nonce": "e4c8...19b2",
"timestamp": 1789766400,
"mandate": {
"role": "researcher",
"token_budget": 20000,
"allowed_tools": ["view_file", "read_url_content"],
"allowed_paths": ["docs/*", "pkg/version/*"]
},
"signature": "ed25519:64byteSignature..."
}
Security Guarantees
- Replay Attack Prevention: Every message includes a unique 256-bit cryptographic nonce and a 60-second expiration timestamp. Duplicate nonces are rejected.
- Mandate Non-Repudiation: If a child subagent attempts an action outside the signed
mandate.allowed_tools, the CEL policy engine drops the request immediately. - Budget Caps: Prevents rogue subagent thrashing loops from burning API token balances.