A single agent that calls an API is a solvable identity problem: the front door validates the user's token, resolves the tenant, and passes both to the tool. Add a second agent and the problem changes character. The second agent receives a request from a program, not from a person, and most agent frameworks do not forward the user's claims by default. The runtime treats the call as "agent A is talking to agent B," and whatever tenant the first agent had in memory is now a piece of context that may or may not be serialized into the payload.
The Azure architecture guidance on multitenant agentic systems names this explicitly. A shared agent's identity typically has permissions to work across multiple tenants but does not inherently understand tenant context, and model behavior cannot be relied on to propagate tenant or user context even when it appears correct in tests: the tenant id should be set and propagated only in deterministic code (Microsoft's multitenant agentic guidance). Subagent invocation and agent handoff is called out as one of five distinct tenant-context loss risks, alongside agent identity, model decisions, tool calling and data stores.
The reason the risk is severe for agents rather than ordinary services is that a wrong database query returns bad data, while a misconfigured agent acts. It updates the wrong opportunity stage, posts to the wrong channel, creates the wrong ticket, in systems you do not own, and the downstream API accepts the call because the credential was valid (Scalekit on multi-tenant tool calling). That is the failure mode your schema and tests have to prevent.
Why ambient context fails
Ambient context means anything the agent does not have to state: a thread-local, a language model's conversational memory, a session variable on a pooled connection, or "the agent only serves one tenant anyway." Each of these breaks for a different reason. The model's memory is attacker-reachable through prompt injection, which is why the OWASP AI Agent Security Cheat Sheet treats indirect injection through retrieved documents and tool outputs as a core risk and asks that authorization be enforced in the execution component, outside the agent's context (OWASP AI Agent Security Cheat Sheet). Pooled connections outlive a request, which is exactly the trap the Postgres RLS write-up describes: a session-wide tenant setting can leak into the next request served by the same connection, while a transaction-local one disappears when the transaction ends (Postgres Row Level Security for Multi-Tenant SaaS).
There is also a harder research result worth knowing. When the tenant identifier is a tool parameter chosen by the model, a correctly validated parameter still serves the attacker, because the model is a stochastic deputy whose authority is bounded by its prompt rather than by the caller's credential. In a reported ablation, a validated tenant parameter served 26 of 26 out-of-scope attempts, and removing the parameter from the tool schema so that no signature could express the read was the structural fix, with 12 of 56 remaining trials escaping by forging writable scope (The Stochastic Deputy, arXiv). The lesson for agent chains is direct: identity has to be bound to a credential and enforced below the agent, not selected by the agent.



