Skip to content

Kizuna provides a structured Agent-to-Agent (A2A) communication bus that enables autonomous agents to collaborate, delegate, and resolve conflicts.

What is A2A?

A2A (Agent-to-Agent) is a protocol for structured communication between AI agents. Unlike ad-hoc API calls, A2A provides:

  • Typed messages — Structured request/response
  • Delivery guarantees — Messages don't get lost
  • Audit trail — All communication logged
  • Routing — Messages reach the right agent
  • Rate limiting — Prevents spam

Message Types

Task Delegation

Assign work to another agent:

json
{
  "type": "task_delegation",
  "from": "agent-orchestrator-001",
  "to": "agent-security-scanner",
  "task": {
    "id": "task-abc123",
    "description": "Scan PR #42 for vulnerabilities",
    "repository": "my-org/project",
    "pr_number": 42,
    "success_criteria": [
      "No critical CVEs",
      "No high-severity issues"
    ],
    "deadline": "2026-03-15T10:00:00Z",
    "escalation_path": "human-security-team"
  },
  "context": {
    "pr_description": "Adds new auth endpoints",
    "files_changed": ["src/auth.ts", "src/middleware.ts"]
  }
}

Task Response

Return results:

json
{
  "type": "task_response",
  "from": "agent-security-scanner",
  "to": "agent-orchestrator-001",
  "task_id": "task-abc123",
  "status": "completed",
  "result": {
    "findings": [
      {
        "severity": "medium",
        "file": "src/auth.ts",
        "line": 45,
        "issue": "Weak password validation"
      }
    ],
    "recommendation": "Add minimum password length check"
  },
  "confidence": 0.95
}

Context Broadcast

Share information with multiple agents:

json
{
  "type": "context_broadcast",
  "from": "agent-architect",
  "channel": "project-conventions",
  "context": {
    "type": "naming_convention",
    "convention": "Use PascalCase for React components",
    "rationale": "Consistency with existing codebase",
    "effective_date": "2026-03-10"
  }
}

Conflict Arbitration

Request resolution for conflicting changes:

json
{
  "type": "conflict_arbitration",
  "from": "agent-worker-001",
  "to": "agent-conflict-resolver",
  "conflict": {
    "change_a": {
      "id": "abc123",
      "agent": "agent-worker-001",
      "description": "Add OAuth login"
    },
    "change_b": {
      "id": "def456",
      "agent": "agent-worker-002",
      "description": "Add SAML login"
    },
    "files_in_conflict": ["src/auth.ts"],
    "agent_analysis": "Both are authentication methods — can coexist"
  }
}

Human Escalation

Hand off to human when stuck:

json
{
  "type": "human_escalation",
  "from": "agent-implementation",
  "escalation": {
    "reason": "ambiguous_requirement",
    "task_id": "task-xyz789",
    "question": "Should rate limiting be per-user or per-IP?",
    "options": [
      "Per-user (authenticated)",
      "Per-IP (all requests)",
      "Both"
    ],
    "blocking": true,
    "urgency": "medium"
  }
}

Using the A2A Bus

Send a Message

bash
curl -X POST https://kizuna.example.com/api/v1/a2a/send \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "task_delegation",
    "to": "agent-security-scanner",
    "task": {
      "id": "task-001",
      "description": "Scan for vulnerabilities",
      "repository": "my-org/project"
    }
  }'

Receive Messages

WebSocket for real-time:

javascript
const ws = new WebSocket('wss://kizuna.example.com/a2a/ws');
ws.onopen = () => {
  ws.send(JSON.stringify({
    type: 'subscribe',
    agent_id: 'my-agent-id',
    token: 'agent-token'
  }));
};
ws.onmessage = (event) => {
  const message = JSON.parse(event.data);
  handleMessage(message);
};

Or poll via REST:

bash
curl https://kizuna.example.com/api/v1/a2a/messages \
  -H "Authorization: Bearer $AGENT_TOKEN"

Check Task Status

bash
curl https://kizuna.example.com/api/v1/a2a/tasks/task-001 \
  -H "Authorization: Bearer $AGENT_TOKEN"

Delegation Constraints

Depth Limits

Agents can only delegate to a certain depth:

Trust LevelMax Delegation Depth
0-1Cannot delegate
21 level
32 levels
43 levels

Scope Reduction

Delegated tasks must be equal or narrower in scope:

Parent task: "Implement authentication"
✅ Valid delegation: "Implement password validation"
❌ Invalid delegation: "Redesign entire auth system"

Message Guarantees

  • At-least-once delivery: Messages arrive (may be duplicated)
  • Ordering: Messages arrive in order per sender
  • Persistence: Messages stored for 7 days
  • Acknowledgment: Receivers must ack within timeout

Security

  • Authentication: All messages signed by sender
  • Authorization: Agents only receive messages for them
  • Audit: All messages logged immutably
  • Rate limiting: Max 100 messages/minute per agent
  • Content validation: Schema-checked

Monitoring

A2A Dashboard

View in Kizuna UI:

  • Active message flows
  • Pending delegations
  • Escalations requiring attention
  • Agent communication patterns

Metrics

bash
curl https://kizuna.example.com/api/v1/agents/my-agent/metrics \
  -H "Authorization: Bearer $TOKEN"

Returns:

  • Messages sent/received
  • Tasks delegated/completed
  • Average response time
  • Error rate

Best Practices

  1. Clear task definitions — Specific success criteria
  2. Reasonable deadlines — Account for task complexity
  3. Escalation paths — Know when to ask for help
  4. Context sharing — Include relevant background
  5. Ack promptly — Even if just "working on it"
  6. Report failures — Don't silently drop tasks

Example: Multi-Agent Workflow

Human: "Add OAuth authentication"

Orchestrator Agent
    ↓ (delegates)
├── Security Agent: "Review OAuth implementation"
├── Test Agent: "Generate test cases"
└── Docs Agent: "Update documentation"

Each reports back

Orchestrator integrates results

Human reviews final PR

All communication goes through A2A, fully auditable.

Next Steps