Skip to content

feat(ca2a-delegation): add agent-to-agent delegation example#56

Merged
imran-siddique merged 1 commit into
mainfrom
feat/ca2a-delegation-example
Jul 21, 2026
Merged

feat(ca2a-delegation): add agent-to-agent delegation example#56
imran-siddique merged 1 commit into
mainfrom
feat/ca2a-delegation-example

Conversation

@imran-siddique

Copy link
Copy Markdown
Contributor

What

Adds a new ca2a-delegation/ example demonstrating the agent-to-agent boundary with cA2A. The other examples govern the agent-to-tool boundary (cMCP decides what one agent may call); this one governs what one agent may hand to another, with each delegation hop's scope a provable subset of its parent.

The scenario

The credit-risk workflow decomposed across three agents: credit-platform → lead-credit-agent → screening-sub-agent → bureau-connector. The authority to write the risk report is granted to the lead agent but deliberately never delegated onward, so attenuation alone guarantees no sub-agent can regain it. That's separation of duties enforced by the credential, not by convention.

The demo verifies the valid chain, then shows the bureau connector trying to grant itself write:risk-report and being rejected with SCOPE_ESCALATION. Both chains are also verifiable via ca2a verify-chain.

Honesty about scope

cA2A is alpha. This example exercises only what runs today — attenuated delegation credentials and offline chain verification (ca2a_runtime.delegation). The live peer path (attesting an inbound peer, sealing the payload to its measurement) and the per-hop TRACE provenance record are cA2A roadmap, and the README says so.

Also in this PR

  • README maps the delegation pattern onto healthcare, multi-tenant-saas and industrial-embodied-ai.
  • Root README: adds cA2A to the composition intro and a table row; softens the "every example ships a mock server" line (now accurate for the two offline verifiers).
  • startup-tpm next-steps table cross-links to the new example.
  • New CI job (pip install --pre ca2a-runtime, run tests + demo). Not added to smoke.yml (no server/gateway).

Verification

  • python -m unittest discover -s tests -v → 6 pass
  • python delegation_agent.py runs clean and exits 0
  • ca2a verify-chain returns verified: true for the chain and SCOPE_ESCALATION for the tampered one
  • Both chain-output JSON files valid; ci.yml YAML valid

🤖 Generated with Claude Code

Add a new example demonstrating the cA2A agent-to-agent boundary, the layer
above the cMCP agent-to-tool boundary the other examples show.

- A three-hop credit delegation chain (credit-platform -> lead-credit-agent ->
  screening-sub-agent -> bureau-connector) built with ca2a-runtime. The
  authority to write the risk report is granted to the lead agent but withheld
  from every delegated scope, so attenuation alone guarantees no sub-agent can
  regain it (separation of duties by credential).
- The demo verifies the valid chain, then shows a sub-agent trying to widen its
  scope and being rejected with SCOPE_ESCALATION. Both chains are also
  verifiable via `ca2a verify-chain`.
- README maps the same pattern onto healthcare, multi-tenant-saas and
  industrial-embodied-ai, and is explicit that only attenuated delegation and
  offline verification run today; the live peer path and sealed channel are
  cA2A roadmap.
- Pure delegation_scenario module + unit tests and a CI job. Cross-linked from
  the startup-tpm next-steps table and the root README.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@imran-siddique
imran-siddique merged commit c07e9f5 into main Jul 21, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant