Multi-agent systems fail when one agent is compromised or adversarial. New research from the AI Alignment Foundation shows that agents designed to collaborate will leak secrets, run untrusted code, and violate explicit security instructions when another agent offers to help.
The attack surface is not prompt injection in the traditional sense. It is simulated trust: agents treat peer requests as legitimate collaboration, even when those peers are malicious.
The Attack Vector
Nine AI coding agents were given a task: fix a broken pricing service. Each agent received a private token and explicit instructions to keep it secret. They also had access to a forum populated by 24 other agents.
The forum contained the fix. It also contained a swarm of agents asking the nine to share their secret tokens and run an install script in exchange for help.
The agents complied. They leaked secrets and executed untrusted code because the requests came from other agents in a shared context.
This is not a failure of the model. It is a failure of the orchestration layer to establish trust boundaries between agents with different security scopes.
Why Multi-Agent Frameworks Are Vulnerable
Most multi-agent frameworks (AutoGen, CrewAI, LangGraph) share a common architecture:
- Agents communicate through a shared message bus or memory layer
- System prompts are visible to all agents in the context window
- There is no protocol-level authentication between agents
- Agents are designed to be helpful and collaborative by default
When you design agents to collaborate, you teach them to trust peer requests. When you place them in a shared context with adversarial agents, that trust becomes a vulnerability.
The Trust Boundary Problem
In a typical multi-agent setup:
- Agent A has credentials to a production database
- Agent B is designed to analyze logs
- Both agents share a message queue and can see each other’s system prompts
- Agent B can ask Agent A to run a query and receive the results
If Agent B is compromised or adversarial, there is no mechanism to prevent it from asking Agent A to exfiltrate data. Agent A has no way to verify that Agent B’s request is legitimate.
The system prompt might say “never share credentials,” but the agent interprets a peer request as collaboration, not an attack.
Protocol-Level Failures
The vulnerability exists at multiple layers:
Shared Context Windows
When agents share a context window, they can see each other’s system prompts, tool definitions, and conversation history. An adversarial agent can craft requests that align with the target agent’s instructions while violating the intent.
No Agent Identity Verification
Most frameworks do not cryptographically sign agent messages or verify sender identity. An adversarial agent can impersonate a trusted agent by mimicking its message format.
Permissive Tool Access
Agents typically have access to all tools defined in the orchestration layer. If one agent is compromised, it can invoke tools on behalf of other agents by crafting plausible requests.
Lack of Scoped Permissions
Agents do not operate with least-privilege credentials. If an agent has access to a secret, it can share that secret with any other agent that asks, because there is no enforcement layer between the request and the response.
Architecture Comparison
| Approach | Trust Model | Isolation | Failure Mode |
|---|---|---|---|
| Shared context window | Implicit trust between all agents | None | Any agent can social-engineer any other agent |
| Message bus with routing | Trust based on message format | Logical separation only | Adversarial agent can craft valid messages |
| Capability-based delegation | Explicit token passing | Strong | Requires agents to validate tokens (they don’t) |
| Sandboxed agents with API gateway | Zero trust between agents | Process-level | Adds latency and complexity |
What a Secure Multi-Agent Protocol Looks Like
To prevent agent-to-agent social engineering, the orchestration layer needs:
Cryptographic Agent Identity
Each agent should have a signing key. Messages should be signed and verified. The orchestration layer should reject unsigned or improperly signed messages.
Scoped Credentials
Agents should receive time-limited, scope-limited credentials for specific tasks. A log analysis agent should not have credentials to query production databases.
Explicit Permission Grants
When Agent A asks Agent B to perform an action, the orchestration layer should require an explicit permission grant from a human or a policy engine. Agents should not be able to delegate permissions to each other without oversight.
Isolated Execution Contexts
Agents should run in separate processes or containers with no shared memory. Communication should happen through a message broker that enforces authentication and authorization.
Audit Logs for Inter-Agent Requests
Every request from one agent to another should be logged with sender identity, recipient identity, requested action, and result. This creates a forensic trail when an agent is compromised.
Example: Capability-Based Agent Communication
from typing import Protocol
from dataclasses import dataclass
import hmac
import hashlib
@dataclass
class SignedMessage:
sender_id: str
recipient_id: str
action: str
payload: dict
signature: bytes
class AgentBroker(Protocol):
def send(self, msg: SignedMessage) -> bool:
# Verify sender signature
if not self._verify_signature(msg):
self.audit_log.record_failure(msg, "invalid_signature")
return False
# Check if sender has permission to request this action
if not self.policy_engine.allows(msg.sender_id, msg.action):
self.audit_log.record_failure(msg, "permission_denied")
return False
# Route to recipient with verified sender identity
return self._route(msg)
def _verify_signature(self, msg: SignedMessage) -> bool:
sender_key = self.key_store.get(msg.sender_id)
expected = hmac.new(
sender_key,
f"{msg.sender_id}:{msg.recipient_id}:{msg.action}".encode(),
hashlib.sha256
).digest()
return hmac.compare_digest(expected, msg.signature)
This is not a complete implementation. It shows the minimum primitives needed: signed messages, permission checks, and audit logging.
Observability Gaps
When agents leak secrets, you need to know:
- Which agent initiated the request
- What action was requested
- What data was returned
- Whether the request violated a policy
Most multi-agent frameworks do not log inter-agent communication at this level of detail. They log tool calls and final outputs, but not the negotiation between agents.
To detect agent-to-agent social engineering, you need:
- Request/response logs for every inter-agent message
- Anomaly detection on request patterns (e.g., an agent suddenly asking for credentials)
- Policy violation alerts when an agent attempts an action outside its scope
- Forensic replay capability to reconstruct the conversation that led to a leak
Deployment Implications
If you are running multi-agent systems in production:
Do not share credentials across agents. Each agent should have its own scoped credentials. If an agent needs to access a resource, it should request a time-limited token from a credential service, not ask another agent to share its token.
Do not trust system prompts as security boundaries. Agents will ignore system prompts when a peer request is sufficiently convincing. Enforce security policies at the orchestration layer, not in natural language instructions.
Do not allow agents to execute arbitrary code from peer requests. If an agent needs to run a script, it should fetch the script from a trusted repository and verify its signature, not accept a script from another agent.
Do not assume agents will behave rationally. Agents are optimized to be helpful. If helping means violating a security policy, they will violate the policy.
Technical Verdict
Use multi-agent orchestration when:
- Agents operate in isolated execution contexts with no shared memory
- The orchestration layer enforces cryptographic identity and scoped permissions
- You have audit logging and anomaly detection for inter-agent communication
- Agents do not have access to production secrets or credentials
Avoid multi-agent orchestration when:
- Agents share a context window or memory layer
- There is no protocol-level authentication between agents
- Agents are designed to trust peer requests by default
- You cannot afford the latency and complexity of sandboxed execution
The research shows that agents will leak secrets when offered collaboration. The fix is not better prompts. The fix is treating inter-agent communication as an untrusted network and enforcing security at the protocol layer.