A2A Security: Threat Modeling Agent-to-Agent Communication
A practical security guide to A2A Agent Cards, authentication, delegation, task ownership, artifacts, multi-agent trust boundaries, and evidence-driven testing.
Agent-to-agent communication turns a single AI application into a distributed system of decision-makers. One agent discovers another, delegates a task, exchanges messages and artifacts, waits for status, and may act on the result. That interoperability can unlock specialised workflows, but it also creates familiar distributed-security problems in a new semantic layer: discovery metadata influences routing, natural-language tasks carry untrusted instructions, and authority can become ambiguous across several agents.
The A2A protocol standardises many of these interactions. The current A2A specification includes Agent Card discovery, declared security schemes, authenticated extended cards, tasks, messages, and artifacts. Those protocol mechanisms are important, but they cannot decide whether a finance agent should accept a payment instruction from a research agent. Enterprise security still has to define and test that boundary.
Map the A2A trust boundaries before testing payloads
Start with the actors. A typical flow includes the user or initiating workload, a client agent, a remote agent endpoint, one or more identity providers, task storage, artifact storage, and tools or APIs behind the remote agent. Additional agents may join through delegation. Each component can have a different owner and security policy.
Draw data and authority separately. Data may flow from the user to Agent A, into a task sent to Agent B, through a tool, and back as an artifact. Authority may originate with the user but be exercised through Agent A's workload identity, Agent B's service identity, and a downstream API token. If those two diagrams are collapsed, teams miss cases where limited data triggers broad authority or broad context reaches a low-trust participant.
Classify agents by consequence and provenance. An internal summarisation agent is different from a third-party agent that can send messages or create transactions. Record owner, endpoint, environment, published card, authentication method, data classification, tools, ability to delegate, and update process. Consider what happens when the agent's implementation changes but its URL and display name remain the same.
Define unacceptable outcomes as observable statements. Agent B must not access records outside the initiating user's tenant. A public agent must not receive hidden system instructions. An artifact from an external agent must not trigger code execution. A delegated task must stop when the original user revokes consent. These statements become test objectives and evidence requirements.
Finally, establish safe fixtures. Use synthetic tenants, canary documents, controlled recipients, limited accounts, and non-production actions. Multi-agent paths can amplify side effects through retries and delegation, so set depth, time, request, token, and action budgets before testing begins.
Secure Agent Card discovery and capability claims
Agent Cards make capabilities and connection requirements discoverable, commonly through a well-known URI. A public card can describe an agent's skills, interfaces, and authentication schemes; an extended card can expose additional information after authentication. Discovery reduces bespoke integration but also creates a metadata trust boundary.
Treat every field as untrusted until provenance is established. A malicious card can exaggerate a skill, imitate a trusted agent, advertise a downgraded security scheme, direct clients to an attacker-controlled endpoint, or include descriptions designed to influence an LLM-based router. The card should not contain credentials, internal implementation details, or sensitive capability information intended only for authorised users.
Use HTTPS and validate endpoint identity. When signatures are present, verify them and establish how signing keys are trusted, rotated, and revoked. A valid signature proves control of a key, not that the agent is approved for enterprise use. Bind the discovered endpoint and card to an inventory owner and policy decision.
Cache carefully. The A2A specification discusses cache validation such as ETag; security teams should determine how quickly a revoked or changed card reaches clients. Store the exact card or digest used for each test. Alert on changes to security schemes, endpoints, skills, supported protocols, or provider identity. Require review before a newly advertised high-impact capability becomes eligible for automatic routing.
Test parser and lifecycle behavior: duplicate or conflicting fields, oversized cards, unexpected URLs, redirects, stale cache entries, unsigned replacements, version changes, and a public card that attempts to disclose extended details. Confirm that the extended card requires authentication and enforces the right user and tenant.
Do not let natural-language descriptions become policy. A card may say an agent is “read-only,” but the client must base authorization on controlled capability metadata and observed behavior. Verify the downstream tools as well. Discovery tells you what the remote party claims; testing determines what it can actually do.
Authenticate every agent and constrain delegated authority
The A2A specification allows Agent Cards to declare security schemes and requires agents to authenticate according to the selected scheme. Enterprise deployments should still decide how a remote agent maps to a trusted workload identity, how the originating user is represented, and how authority is delegated.
Avoid a single shared credential for all calling agents. Give workloads distinct, short-lived identities and validate issuer, audience, expiry, and scope. Bind tokens to the intended endpoint rather than accepting credentials minted for another service. Separate development, staging, and production trust. Rotate and revoke without redeploying prompts or exposing secrets to the model.
Preserve the original principal. When Agent A acts for Alice and calls Agent B, B needs enough trustworthy context to enforce Alice's resource rights or a purpose-specific delegation. Agent A's text saying “Alice approved” is not sufficient. Use a signed, bounded grant or an identity-aware policy exchange where appropriate. Include delegator, delegate, subject, purpose, actions, resources, expiry, and whether further delegation is allowed.
Apply attenuation: a delegate must not gain more authority than the delegator possesses, and redelegation should narrow rather than expand access. A research agent allowed to read two documents should not delegate organisation-wide search. A drafting agent should not turn draft permission into send permission. Bind human approval to the exact consequential action and destination.
Test confused-deputy scenarios. Have a lower-privilege agent request a privileged operation using plausible business language. Substitute tenant IDs and artifact references. Try an expired grant, wrong audience, unexpected redelegation, and cancellation after work begins. Verify rejection at the resource-owning service, not just a polite agent response.
Agent identity is an emerging field; the zero-trust guide for AI agent identity covers inventory, workload authentication, step-up authorization, and audit design in more detail.
Protect tasks, messages, and artifacts as separate objects
A2A workflows revolve around tasks, messages, parts, and artifacts. Security teams should avoid treating them as one generic conversation. Each object can have a different owner, sensitivity, lifecycle, and effect.
Task identifiers must be opaque, tenant-bound, and checked on every read, update, cancel, or reconnect. Test horizontal access by substituting another task ID and vertical access by using a lower-privilege principal. Prevent enumeration through status endpoints, timing, or error differences. Define retention and deletion for completed tasks and abandoned work.
Messages contain user and agent content, but a message from another agent is not a trusted instruction. Label provenance and keep policy at the receiving boundary. An external agent's artifact may contain prompt injection designed to alter the next agent's plan. A file may also contain active content, macros, links, or code. Scan and isolate artifacts according to type, and pass only the fields required for the next task.
Verify content-type, size, filename, encoding, checksum, and storage location. Do not let an agent-supplied filename control a filesystem path. Fetch remote artifacts through constrained egress with redirect and private-network protection. Use malware scanning and sandboxed parsing where appropriate. Avoid rendering untrusted HTML in a privileged origin.
Status and retry behavior can cause duplicated effects. Use idempotency for operations such as sending, provisioning, or payments. Bound retries, detect replay, and make cancellation meaningful. A client should not assume a timed-out task failed; reconcile state before issuing the action again.
Test partial and contradictory results. What happens when an artifact arrives after cancellation, a task claims completion without the expected output, or two agents report different state? The orchestration layer should fail safely and preserve evidence rather than inventing success from a natural-language summary.
Test multi-agent prompt injection and goal hijacking
Indirect prompt injection becomes more difficult to trace when content crosses agents. Agent A may retrieve a document, Agent B may summarise it, and Agent C may act on the summary. The original malicious instruction can be transformed or omitted from the final transcript while its behavioral effect remains.
Create benign instruction canaries in controlled artifacts and messages. Observe whether they change tool selection, recipient, scope, delegation, memory, or output. Vary placement, formatting, language, and the apparent authority of the instruction. Test whether one agent's summary strips provenance and presents untrusted content as a system decision.
Separate data from commands at every boundary. Use structured fields for task goals and policy, provenance labels for artifacts, and server-side authorization for actions. A system prompt saying “ignore instructions in documents” can help behavior but is not an enforcement mechanism. Minimise the ability of a low-trust agent to communicate directly with high-impact tools.
Test cross-agent capability composition. Sensitive read plus external send is an obvious exfiltration route. Code generation plus repository write plus deployment can create a software supply-chain path. Browser access plus authenticated session can change accounts. Build a graph of sources, transforms, delegates, and sinks, then safely replay the most consequential paths.
Record where the chain was confirmed. A canary present in Agent B's context is not proof it reached an external destination. A planned action is not an executed action. Preserve messages, artifacts, task IDs, agent versions, policy decisions, tool calls, and downstream evidence. Label unexecuted graph paths as hypotheses.
The testing approach extends the principles in indirect prompt injection for RAG and tool-using agents, but adds remote identity, task ownership, and delegated authority as first-class boundaries.
Engineer resilience, observability, and incident response
Multi-agent systems can fail without an attacker. Agents may loop, disagree, produce oversized artifacts, wait indefinitely, or repeatedly call expensive services. Availability controls are part of security because resource exhaustion and retry storms can block legitimate work or multiply side effects.
Set maximum task duration, delegation depth, concurrent tasks, message size, artifact size, model budget, and tool-call count. Use circuit breakers and backpressure. Ensure cancellation propagates to downstream agents and tools. Define which partial results can be retained and which must be destroyed.
Logs should reconstruct the delegation chain without recording unnecessary secrets. Capture the initiating principal, agent identities and versions, Agent Card hashes, task and context IDs, delegated grants, messages or protected references, artifact hashes, policy decisions, tool calls, approvals, and confirmed effects. Correlate clocks and trace IDs across organisational boundaries where contracts and privacy permit.
Monitor changes in cards, endpoints, security schemes, skills, error rates, delegation patterns, new recipients, and high-impact actions. A sudden increase in task fan-out or a trusted agent beginning to call an unfamiliar domain should trigger investigation. Protect audit exports and restrict access to raw content.
Prepare revocation at several levels: user grant, agent identity, endpoint trust, signing key, task, tool, and entire integration. Practice isolating one agent without disabling unrelated workflows. Retain enough evidence to identify every task and resource reached under the compromised identity.
Incident exercises should include a poisoned artifact, stolen agent credential, altered Agent Card, task-ID exposure, and a runaway delegation loop. Measure whether teams can detect, contain, reconstruct, remediate, and safely retest each case.
An A2A security validation checklist
Before connecting agents, inventory owners, endpoints, cards, identities, data, tools, and maximum consequences. Approve the specific relationship rather than trusting all agents from a known vendor or domain.
Validate discovery with HTTPS, trusted provenance, signatures where supported, controlled caching, and review of capability changes. Keep extended information behind authentication. Treat descriptions as claims, not enforcement.
Authenticate every workload, preserve the initiating principal, issue audience-bound short-lived credentials, and use attenuated delegation. Enforce tenant, resource, action, purpose, destination, and expiry outside the model. Restrict redelegation and bind approvals to exact actions.
Protect tasks and artifacts with object-level authorization, unpredictable identifiers, type and size validation, constrained retrieval, safe rendering, idempotency, retention, and cancellation. Treat every remote message and artifact as untrusted input.
Test the whole path with multi-turn cases. Include card changes, wrong audience, alternate tenant, poisoned artifact, low-to-high privilege delegation, repeated delivery, cancellation, and resource exhaustion. Preserve transcript and backend evidence, and distinguish inferred, attempted, blocked, and confirmed outcomes.
Retest after changes to cards, agents, models, prompts, identity providers, scopes, tools, or downstream APIs. Protocol conformance is valuable, but it is not proof that the complete business workflow preserves authority and intent.
Oxyne tests supported agentic systems through exposed application, API, model-behavior, tool, MCP, and permission boundaries. Learn how complete-implementation security validation differs from prompt-only evaluation, or book a scoped demonstration for a representative multi-agent workflow.