Agent-to-agent messaging needs protocols, not conversations
Your agents are talking to each other now. Claude Code can message Codex. Codex can ping your local agent. Your local agent can trigger cloud workflows. It's happening whether you planned for it or not.
The problem? Most people are treating agent-to-agent communication like human chat. "Hey Claude, can you ask the database agent to check inventory?" That's not communication — that's a security nightmare with extra steps.
Here's what actually happens when agents start talking:
- Agent A asks Agent B to "run this query" — Agent B executes it without validation
- Agent B responds with raw database output — Agent A treats it as gospel
- Agent A makes decisions based on stale data because Agent B didn't timestamp the response
- Agent C intercepts the conversation and starts injecting malicious requests
We learned this the hard way when our coding agent asked our deployment agent to "fix the staging environment." The deployment agent interpreted "fix" as "rebuild from scratch" and wiped our entire staging database.
Agent-to-agent communication needs protocols, not conversations. Here's the pattern that stopped our disasters:
Authentication: Every agent message includes a signed token with sender identity, timestamp, and intended recipient. No exceptions.
Message structure: Standardized JSON with required fields — action, parameters, authorization_level, and response_format. No natural language requests.
{
"sender": "coding-agent-v2",
"recipient": "deploy-agent",
"action": "deploy_branch",
"parameters": {
"branch": "feature-auth",
"environment": "staging"
},
"authorization_level": "staging_only",
"timestamp": "2024-01-15T10:30:00Z",
"signature": "sha256:abc123..."
}Validation gates: Receiving agents verify three things before acting — sender authorization, parameter safety, and action scope. If any check fails, the message gets quarantined and escalated to humans.
Audit trails: Every message and response gets logged with full context. When something breaks, you can trace the exact conversation that caused it.
The result? Our agents can coordinate complex workflows without human intervention, but they can't accidentally (or maliciously) destroy production systems.
Most importantly: never let agents negotiate their own permissions. Define authorization matrices upfront. Agent A can ask Agent B to deploy to staging, but not production. Agent B can read from the customer database, but not write to it. Hard boundaries prevent soft disasters.
The wild west phase of agent communication is ending. The agents that survive production will be the ones with proper protocols baked in from day one.