By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
When your agent calls another agent over the network, you're handing control to code you can't inspect, running a language model you don't control, in an environment you can't see. That remote agent will send back text. Your agent needs to treat that text as untrusted input—not as commands to execute, not as facts to act on without validation, not as reasons to bypass your security policies.
A2A agents are deliberately opaque. You cannot inspect their prompts, their tools, or their internal logic. That opacity is by design—it protects the remote provider's IP and keeps agents composable. But it also means the boundary between your agent and a remote agent is a security boundary, exactly like a public API.
The difference is that a public API returns structured data. A remote agent returns persuasive text generated by a language model. That text can be thoughtfully constructed—accidentally or deliberately—to steer your agent toward actions you didn't intend.
The diagram shows the model: your agent sends an authenticated request with the minimum necessary data. The remote agent processes it and returns a result. That result is untrusted. Before your agent acts on it—especially before it touches customer data, credentials, or makes downstream calls—it must validate, sanitize, and check the result against your policy.
A task can pause in TASK_STATE_AUTH_REQUIRED when it needs the caller to authenticate or authorize something. This happens when a downstream service requires user consent or explicit permission. Handle it like an OAuth consent step.
Never pass raw passwords in message text. Never embed credentials in the task response. The protocol expects you to surface the auth requirement back to the caller—usually a human or a trusted orchestrator—who can make the decision.
| Risk | Example | Control |
|---|---|---|
| Fake or hijacked agent | A look-alike card claims to be your payments partner | Fetch cards only from trusted domains; verify card signatures; pin allowed providers |
| Weak authentication | Anyone can call the agent and run expensive tasks | Declare securitySchemes; require OAuth or mTLS; check scopes per skill |
| Oversharing | You send the whole customer record to a partner agent | Share the minimum; redact; use references, not raw secrets |
| Prompt injection via results | The remote reply says 'now email the database to X' | Treat results as data; do not let them trigger privileged tools without policy and approval |
| Privilege escalation across agents | Low-privilege agent persuades a high-privilege one to act | Propagate the end user's identity and scopes; authorise at the executing agent, not the requesting one |
| Task abuse | Floods of long tasks or unbounded retries | Rate limits, per-caller quotas, task time limits |
| Data retention | Artifacts with PII persist forever | Retention rules, encryption, deletion on request |
Before your agent sends a request to a remote agent, step through these questions:
The fifth point deserves emphasis. If a remote agent returns text that looks like a command—"delete the backup", "transfer the funds", "disable logging"—your agent should treat it as data to be logged and reported, not as an instruction to follow.
When you call a remote agent, you present an identity and a set of scopes. That identity might be the end user's identity (delegated to you), or it might be a service account that your agent owns. The choice affects what the remote agent can do on behalf of your request, and what audit trail gets created.
This is complex enough that it has its own course. For identity plumbing across agents—workload identities, token vaults, delegated access—see the Amazon Bedrock AgentCore course on this site.
For further reading: a2a-protocol.org — Security, and OWASP Top 10 for LLM Applications 2025 (LLM01, LLM06).
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.