=== Multi-Agent Email Flow ===
Agent A (planner) registered: ag_01HXYZ...
Agent B (executor) registered: ag_01HXYZ...
Agent A grant token:
grantId: grnt_01HXYZ...
scopes: calendar:read, email:send
--- Agent A: Reading calendar ---
Scope verified offline: calendar:read
Calendar events found: 3
--- Agent A: Delegating email:send to Agent B ---
Delegated token issued:
scopes: email:send
delegationDepth: 1
--- Agent B: Sending email ---
Email sent: msg_1234567890
--- Failure: Agent B tries calendar:read (not delegated) ---
Blocked! Agent B cannot read calendar.
--- Failure: Revoking Agent A's grant (cascade to Agent B) ---
After revocation:
Agent A token valid: false (revoked)
Agent B token valid: false (cascade revoked)
--- Audit trail ---
[+] Agent A calendar:read — success
[+] Agent B email:send — success
[x] Agent B calendar:read — failure
[x] Agent B email:send — failure
Done! Multi-agent email flow with failure handling complete.