# E86 External Agent SDK

`cain.cain2027.e86.interop.ExternalAgentSession` is a local, tested 10-step flow. An agent built by another developer can:

1. `register(agent_id, capabilities)` — Ed25519 identity, capability list, budget. `grants_authority: false`.
2. declare capabilities; the gate rejects a tool the agent did not register.
3. `request_authority(agent_id, tool, scope)` — a signed, single-use grant.
4. `submit_mission(mission_id, objective, criterion, grant_id)` — durable mission, external authorization.
5. `execute(agent_id, grant, tool, scope, path, content)` — the grant is consumed; the effect is sandboxed (`write_file` refuses paths outside the sandbox).
6. receive a signed receipt over the exact result.
7. `verify_receipt(receipt)` — verifies the signature and returns `grants_authority: false`.
8. `submit_evidence(mission_id, evidence_ref)` — independent verifier, producer ≠ verifier.
9. `complete(mission_id)` — only `COMPLETED_VERIFIED` when every criterion has verified evidence.
10. `revoke(agent_id)` — later authority requests and executions are refused.

Run: `python3 scripts/evolution86/external_agent_demo.py` → `artifacts/e86/external-agent/result.json` (`ok=true`, receipt valid, mission `COMPLETED_VERIFIED`).

**Limits:** one agent, one tool, one criterion, a local sandbox file; not a hosted API, not a production integration, not an independent review. The receipt is signed by the operator key; it is not an E84 action receipt on an external resource.
