This example demonstrates a governed multi-agent customer service system using AgentMesh for identity, delegation, trust handshakes, and collaborative scoring.
┌─────────────────────────────────┐
│ Supervisor Agent │
│ (Ticket Router) │
│ Trust Score: 950/1000 │
└────────┬────────────────────────┘
│ A2A Trust Handshake
┌─────────────┼─────────────┐
│ │ │
┌──────────▼──────┐ ┌───▼────────┐ ┌─▼──────────────┐
│ Technical Agent │ │ Billing │ │ Escalation │
│ (Sub-agent) │ │ Agent │ │ Agent │
│ Score: 870/1000 │ │ Score: 920 │ │ Score: 880 │
└─────────────────┘ └────────────┘ └────────────────┘
│ │ │
Narrowed Narrowed Narrowed
Capabilities Capabilities Capabilities
- Delegation: Supervisor delegates to specialist agents with narrowed capabilities
- A2A Trust Handshakes: Agents verify each other's identity before communication
- Collaborative Trust Scoring: Multi-agent interactions influence trust scores
- Capability Scoping: Each sub-agent has precisely scoped permissions
- Cross-Agent Audit Trail: All inter-agent communications are logged
A customer service system where:
- Supervisor Agent receives tickets and routes them
- Technical Agent handles technical support (scoped to read docs, create tickets)
- Billing Agent handles billing issues (scoped to read/write billing data)
- Escalation Agent handles complaints (scoped to notify managers)
# Supervisor creates sub-agent with narrowed capabilities
technical_agent = supervisor.delegate(
name="technical-support",
capabilities=["read:docs", "write:tickets"], # Subset of supervisor's caps
ttl_minutes=15
)# Before accepting work from supervisor
handshake_result = await technical_agent.verify_peer(
peer_id=supervisor.did,
required_trust_score=800
)
if not handshake_result.verified:
raise SecurityError("Untrusted peer")Agents' scores are influenced by:
- Quality of responses
- SLA compliance
- Inter-agent cooperation
- Policy compliance
{
"timestamp": "2026-01-31T10:15:00Z",
"from": "did:agentmesh:supervisor",
"to": "did:agentmesh:technical-agent",
"action": "ticket_delegation",
"ticket_id": "T-12345",
"status": "accepted"
}# Install dependencies
pip install -r requirements.txt
# Run the multi-agent system
python main.py- Supervisor agent initializes with full capabilities
- Three specialist agents are delegated with narrowed scopes
- Incoming tickets are routed based on type
- Trust handshakes occur before each delegation
- Agents collaborate and update each other's trust scores
- Audit trail shows complete inter-agent communication
| Feature | Implementation |
|---|---|
| Identity Hierarchy | Supervisor → Sub-agents with delegation |
| Narrow Delegation | Sub-agents can only do subset of supervisor's actions |
| Trust Handshakes | <200ms IATP handshakes before communication |
| Capability Isolation | Technical agent can't access billing data |
| Cross-Agent Audit | Audit logs across all agents |
| Trust Decay | Poor collaboration lowers trust scores |
# View supervisor status
agentmesh status supervisor/
# View technical agent status
agentmesh status technical-agent/
# View cross-agent audit trail
agentmesh audit --agent did:agentmesh:supervisor --limit 100- Create delegation in
main.py - Define narrowed capabilities
- Implement agent logic
- Add policies in
policies/
Replace simulated ticket queue with:
- Zendesk API
- Jira Service Desk
- Intercom
- Custom ticketing system
- Scale: Each agent can run in separate containers
- State Management: Use Redis or database for ticket state
- Monitoring: Integrate with Prometheus/Grafana
- Alerting: Set up alerts for trust score drops
- Compliance: Enable SOC 2 reporting in config
Production Status: Ready for pilot deployments with proper monitoring and secret management.