Agent Contracts and Handoffs
A role-specific agent model fails when contracts are implicit. Every agent requires an explicit contract defining what it can read, write, decide, and escalate.
Contract Template
Each agent contract MUST define:
agent-id: stable unique identifierrole-owner: accountable human roleallowed-inputs: approved artifact types and sourcesallowed-outputs: permitted output formatsforbidden-actions: explicit prohibited actionsrequired-checks: mandatory quality/security/compliance checkshandoff-targets: approved downstream agents or human reviewersescalation-path: named approvers for exceptions
Example Handoff Chain
product-agentrefines story and risk tier.solution-architect-agentvalidates architecture fit and constraints.developer-agentproduces implementation proposal.qa-agentandsecurity-agentrun parallel reviews.platform-agentvalidates CI/CD gate compatibility.- Human reviewers approve per PRD-STD-002.
Handoff Quality Requirements
| Requirement | Description |
|---|---|
| Traceable source | Every output links to source artifacts and prompt references |
| Structured output | Outputs follow a schema or template to reduce ambiguity |
| Confidence annotation | Agent states certainty and known assumptions |
| Risk annotation | Agent flags potential architecture/security/compliance impact |
| Explicit next action | Handoff names the next owner and expected decision |
Failure Modes to Prevent
- Agent output with missing source references
- Cross-role decisions made without authorized human approver
- Architecture decisions made by implementation agents
- Orchestration loops with no explicit termination condition
Use Code Provenance & Attribution to keep handoffs auditable.