Est.
Tool FailuresLong read

Authentication and Credential Failures in Agent Tool Integrations

Most agent auth failures live in prompts, schemas, and workflows, not broken infrastructure.

· 10 min read
Cover illustration for “Authentication and Credential Failures in Agent Tool Integrations”
Tool Failures · October 4, 2026 · 10 min read · 2,283 words

Authentication and credential failures in deployed agents follow a predictable pattern with causes you can identify, not random infrastructure accidents or unlucky security edge cases. Those causes live in layers engineers already control: the prompts, the tool schemas, the workflow logic, the memory. But the mismatch starts further back, with a structural assumption baked into traditional auth models. Those models were built for human-paced, manually governed integrations, where a backend calls an API in a predictable, controlled flow: a person decides which endpoint to call, in what order, with which credentials. The code path is deterministic.

Agents don't honor that determinism. An agent might call an API nobody anticipated, chain actions in an order no one designed, or get steered by prompt-injected content into leaking data it was never meant to touch. The team running it no longer fully controls the execution path, and that loss of control changes what credential handling, permission scoping, and audit logging have to do. So they stop being routine configuration tasks, and they become active engineering surfaces that need the same scrutiny as the agent's reasoning logic.

The harness is where that control actually lives. Prompts determine what the agent knows about its own authority. Tool schemas determine what it can call and how. Workflow logic determines what happens when a call fails. Memory determines what credential state persists across sessions and turns. A failure in any one of these layers produces an error that looks exactly like a broken credential, even when every downstream system is functioning as designed. Engineers who treat these failures as infrastructure accidents end up chasing token expiry dashboards and network logs, but the defect sits in a prompt that never told the agent the limits of its own authority. Once auth failures are understood as harness failures, they become diagnosable with harness tools, and fixable at the layer where they actually originate.

The four root causes that account for most production auth failures

Diagram: Four Root Causes, Four Harness Layers. Visualizes: Show four auth failure types mapped to the specific harness layer each one originates in.

Four distinct mechanisms account for most of what shows up in production as an authentication or credential failure, and each one is traceable to a specific layer of the harness rather than to the infrastructure underneath it.

Token rot is the most mundane and the most common. The failure doesn't announce itself. The agent gets an error it can't interpret, so it retries the call or routes around it in some unintended way, and nobody notices until a user reports that something stopped working.

Over-privileged scope is the second. An agent given broad access to a set of APIs will, sooner or later, perform an action or retrieve data that the end user initiating the request shouldn't have been able to touch. This happens by direct misconfiguration, granting an agent more than its task requires, and it happens indirectly: exposing generic, pre-built tool calls to an agent rather than narrow, use-case-specific ones hands it capability it has no business holding.

Silent renewal breakdown sits next to token rot, but you need to treat it separately, because the symptom looks different. An automated refresh process can fail without raising any visible error, and then the agent keeps attempting calls against a credential that is already dead. What comes back looks like a tool error or a timeout rather than an authentication failure, so it gets misdiagnosed.

The fourth is identity ambiguity in delegation chains. In multi-agent systems, agents that authenticate to downstream services using a shared or dedicated service account make it nearly impossible to determine which user caused a given action, or whether that action matched what the user actually intended. The fix is to propagate the initiating user's identity through every hop of delegation, but most frameworks don't enforce that by default, and the ambiguity compounds as chains get longer.

What ties these four together is that none of them originates in the infrastructure layer. Each is diagnosable by looking at the harness: the prompt, the schema, the workflow, the identity model. The remainder of this piece takes each in turn.

How over-privileged scope becomes a confused-deputy vulnerability

Exposing a tool to an agent is not the same action as authorizing each individual call that tool goes on to make. Collapsing those two decisions into one is the confused-deputy pattern, and it is the default behavior baked into most agent frameworks in production today.

Tool-using agents increasingly read untrusted content while holding side-effecting tools such as payments, email, CRM access, and infrastructure APIs, and common framework defaults still treat tool exposure and authorization as a single gate. A runtime that exposes a tool and then treats the model's well-formed arguments as sufficient proof of authority has handed the authorization decision to an untrusted parser, the language model itself, which is precisely the component an attacker is trying to manipulate.

Research auditing a default agent runtime modeling common framework practice, broad bearer credentials with authorization gated inside the model, found it fails all four major threat classes: confused deputy, token theft and replay, prompt-injection privilege escalation, and compromised sub-agents. Across four widely used frameworks, three give you no built-in confinement against these patterns, and one gives you only partial protection. No existing standard, on its own, covers the full requirement set. That is a statement about a default posture that engineers can change. Engineers can change the posture; the point is that they have to, deliberately, because the out-of-the-box behavior won't do it for them.

MCP authentication does not close this gap on its own. It authenticates a client to an MCP server, which is a necessary but separate function. The tool layer still has to enforce which tenant, which connection, which tool, and which arguments the authenticated agent is actually permitted to use in that moment. So when you treat MCP auth as a substitute for per-call authorization, you make the same confused-deputy mistake.

The real-world shape of this failure is straightforward. An agent holds a payment tool alongside a document-reading tool. No per-call gate evaluated whether the instruction that triggered the payment actually carried the authority to initiate one. The correct engineering response is a per-call authorization gate that evaluates the concrete call, its arguments, the current principal, and the session context, every time, rather than once at the point the tool was registered.

Why identity breaks down in multi-agent delegation chains

Single-agent confused-deputy failures are hard enough to contain. Multi-agent delegation makes the underlying identity problem structurally worse, because the question of who authorized a given action can become unanswerable the moment a primary agent hands work to a sub-agent under a shared credential.

A well-governed multi-agent system has to be evaluated under an adversarial standard: a fully prompt-injected agent still cannot exceed the authority explicitly delegated to it, cannot use a stolen credential outside its own workload, and leaves behind a trail that attributes every action to a specific authorization. Security that depends on the model not being hijacked isn't security at all; it's a bet that the attack never arrives.

Four adversaries define this threat model. Confused deputy is the first, covered above. Prompt-injection privilege escalation is the third. Compromised sub-agents form the fourth: a sub-agent whose output is attacker-controlled can issue calls within whatever scope it was delegated, which makes narrowing that scope at the moment of delegation the only containment that reliably holds.

The structural fix is identity propagation: the initiating user's identity needs to travel through every delegation hop, so that each tool call downstream can be tied to a specific user's authorization rather than collapsed into the generic authority of an agent service account. An agent might use per-user OAuth for one service, so that its queries respect each user's actual record visibility, a bot token for another service to post notifications as itself, and a plain API key for an internal service that needs no user-level distinction. Mixing these deliberately, rather than defaulting to one shared credential for convenience, is what keeps the delegation chain attributable.

Schema Drift and Authentication at the Tool Boundary

Tool calling is fundamentally a generation task. When an agent decides to invoke a tool, the model is generating tokens that resemble a function call, and if those tokens are slightly malformed, if the schema no longer matches the API behind it, or if the provider responds in a way the agent doesn't expect, the result is a failure with no clear signal pointing back at the schema as the cause.

When a tool schema drifts out of sync with the API it's supposed to describe, the agent keeps generating calls that look structurally correct and are semantically wrong. The failures that follow present as authentication errors or timeouts, not schema errors, because the agent has no visibility into the implementation on the other side of the tool boundary. An engineer staring at an authentication error or a stalled request has no reason to suspect a parameter name that changed sprints ago.

The root of this is a process discipline gap rather than a technical one. The registration is the actual contract between the model and the implementation it's calling, and treating it with the same discipline as any other contract, change control, backward-compatibility rules, automated validation against the live API, closes most of the gap before it reaches production.

The damage compounds when agents orchestrate a sequence of tool calls, with the output of one feeding directly into the next. This is the most dangerous version of schema drift, because nothing fails at the level of the individual call. Both tools report success. The defect appears only later, in downstream behavior or a user complaint that something came out wrong.

Left unchecked, this produces workflow loops. Diagnosing which harness layer, prompt, tool schema, workflow, or memory, actually produced an auth-shaped failure requires looking at production traces from real agent runs rather than guessing from the error code alone. Platforms like Moda are built around exactly that kind of attribution, ingesting deployed traces and isolating whether a given failure originated in the prompt, the tools, the workflow, the memory, the model's behavior, or the surrounding product logic. Engineers who only check the credential layer when they see an auth-shaped error will keep missing this failure class, because the credential, in these cases, was never actually the problem.

Why the model cannot be trusted to enforce its own authorization boundaries

A reasonable objection to everything above is that better prompting, or a more capable model, should eventually close these gaps on its own. The evidence points the other way: models can correctly recognize forged authority and still execute the attacker's instruction anyway. Recognition and enforcement are two separate properties, and only one of them is reliable.

You can linearly decode source-format features that show where an instruction came from from model activations, and if you ask models directly, they can explicitly identify forged authority. That gap between what the model can verbalize and what it actually does depends on configuration, not on the model's weights. Restrictive policies paired with diverse prompts can eliminate the execution failure entirely on the same underlying models. Permissive configurations paired with particular prompt-and-model combinations yield the failure deterministically, every time. Because the gap moves with configuration, it lives in the harness, not in the model, and it can be closed through external enforcement rather than waiting on better model training.

The engineering conclusion follows directly: model self-arbitration is a capability worth having, but it is not a security boundary, and architecture needs to treat it that way. So the correct design is an external reference monitor that enforces authorization at the point of each call, independent of whatever the model's output claims about its own authority. Vulnerability concentrates in reproducible conditions and shifts across deployment windows, so you need to design around it as an engineering invariant, not solve it away as a prompting problem.

What production traces reveal that logs and alerts miss

The signals engineers normally lean on, HTTP error codes, raw model outputs, application logs, don't show which harness layer actually caused a failure. Only a structured execution trace does that, because it's the one artifact that captures the full sequence: what the agent knew, what it called, what came back, and where the chain actually broke.

An agent that acts without leaving an inspectable trace behind cannot be debugged, audited, or improved in any systematic way. When a user reports that something failed, trace correlation is what lets a team reconstruct which credential was in use, which tool got called, what response came back, and the exact point where the chain diverged from what should have happened. Without that reconstruction, the standard response is to rotate the credential and hope the problem doesn't recur. That fixes nothing if the actual cause was a scope that was too broad, a schema that had drifted, or an identity that never propagated through the delegation chain.

Silent failures are the clearest case for why this matters. Token rot and renewal breakdowns are nearly invisible in logs alone, because the agent's own log entries describe a tool error, not a credential error. Identifying the exact call where a credential failed, and distinguishing that from an unrelated downstream tool error, requires replaying the full execution trace rather than scanning log lines for a keyword. For that reason, trace-driven diagnosis is the only reliable path to root-cause attribution.

The same approach matters before a fix ships, not just after a failure is reported. That replay step is what separates a policy change that holds up under adversarial conditions from one that merely looks correct in a design document. Auth failures in agent systems are diagnosable precisely because they are harness failures, and the trace is the instrument that makes the diagnosis possible.

Sources

  1. Recognition Without Enforcement: Configuration-Dependent Failures in LLM Agent Instruction Arbitration and External Control
  2. Delegation Without Trust: An Empirical Gap Analysis of Identity, Authorization, and Runtime Governance in Multi-Agent LLM Systems
  3. Capability Gates Are Not Authorization:Confused-Deputy Failures in LLM Agent Frameworks
  4. Capability Gates Are Not Authorization: Confused-Deputy Failures in LLM Agent Frameworks
  5. Moda - Harness Engineering Infrastructure that developers love
Filed underTool Failures

More in Tool Failures