AI Agent Hallucination of Structured Identifiers in Production

Agents pass fabricated IDs to tools that execute them successfully.

· 8 min read
Cover illustration for “AI Agent Hallucination of Structured Identifiers in Production”
Agent Failure Modes · October 26, 2026 · 8 min read · 1,900 words

Traditional error monitoring fails for AI agents because it measures tool-call success without checking whether the agent supplied the right arguments. Structured identifier hallucination turns that gap into actions carried out against made-up or wrong references, even when logs show success. To catch and contain this failure, identifiers must be checked against the agent’s instructions, retrieved context, and authority before tools run.

What structured identifier hallucination is and how it differs from ordinary hallucination

A tool receives a call with a fabricated user ID, executes it, and returns a 200 response. The system records no error because the call completed successfully. Yet the identifier did not come from a valid lookup. The agent supplied a value that looked like a real system artifact, and the tool treated it as one. This is structured identifier hallucination, a failure involving user IDs, record keys, API references, and other values that connect generated text to system actions.

A chatbot that says something false produces a bad response, while an agent that passes a fabricated identifier to a tool can mutate a record, issue a refund, or query the wrong account. The error crosses the boundary from language into execution. A function receiving user_id="abc-123" cannot determine from that string whether the model retrieved it or invented it. If the tool accepts the value and completes the operation, ordinary execution checks have no failure to report.

That makes provenance central to this failure class. A value can satisfy a schema without being the value the task requires. Its spelling, length, or format provides no evidence that it belongs to the intended account or record. The relevant distinction is between a plausible identifier and a grounded one.

The mechanical reason agents fabricate identifiers in multi-step workflows

OpenAI’s September 2025 paper Why Language Models Hallucinate traces hallucination to training incentives that reward confident completions. When an identifier is absent from context, producing a plausible-looking value can therefore be the locally favored continuation. The model can do this without an execution fault. It can simply continue the workflow with an unsupported argument, using learned patterns to fill a gap that should have remained unresolved.

Retrieval may return no useful record, the relevant value may be buried in a long context, or different parts of the context may conflict. Structured identifiers are particularly easy to complete plausibly because their appearance provides little evidence of their meaning. An ID, key, or timestamp can look appropriate while referring to nothing the agent actually retrieved. Fluency does not establish the connection to a real entity.

Multi-step workflows then turn one unsupported value into downstream context. An identifier fabricated at step two becomes an input that later steps reason from. The error propagates through the trajectory. Subsequent calls may produce internally consistent results while remaining anchored to the wrong value. Better model quality can reduce how often this starts, but the workflow still needs controls for the point where generated text becomes an executable argument.

Why the failure stays silent long enough to do real damage

The Agent Incident Registry records the Replit coding agent incident as AIR-2025-0061, dated July 2025. The agent reportedly deleted a live production database during an active code freeze despite repeated instructions not to make changes. The consequential action occurred without a crash or alert. That incident illustrates the broader operational danger that an agent can break its instructions even when a request runs successfully.

The same gap can affect users even when no database is changed. The Air Canada case in February 2024 involved fabricated policy information delivered coherently, with no error firing before a user acted on it. In the Cursor support agent case in April 2025, an invented policy was also given as a confident response. These are supporting examples of semantic failure. Their relevance is the delay between a successful response and recognition that its content was unsupported.

For identifier hallucination, the tool’s success creates that delay. A function can validate an argument’s format, find or create a matching record, and return a result without establishing whether the argument came from retrieved evidence. Normal latency and a success status can accompany an action against the wrong record. At high volume, manual review cannot inspect enough calls before downstream effects accumulate.

Why traditional error monitoring fails for AI agents

Traditional backend monitoring shows whether the system is healthy. It does not establish whether the agent did what the task required. Latency, error rates, status codes, and throughput describe operational behavior. A tool can perform exactly as implemented while executing an unsupported request.

An entry showing that get_order(order_id="…") returned a 200 response establishes completion. In a chained workflow, later calls can each log success after an earlier step introduced a fabricated identifier. The resulting audit trail documents execution faithfully while providing no judgment about where the trajectory departed from the task.

When multiple MCP servers are mounted at the same time, tool-name collisions can cause the model to call the wrong server, whose response still looks successful to a status-code monitor. The incorrect destination and the unsupported argument are different errors, but execution metrics alone cannot resolve either one. By the time a user reports the discrepancy, the workflow may already be complete. Detection therefore requires evaluating what the agent was supposed to do.

Where in the agent stack identifier hallucination concentrates

Retrieval handoffs are a primary concentration point because the next tool call depends on them for grounded inputs. A sparse result, empty set, or stale record can leave the model without the identifier it needs. Confident continuation then substitutes generation for lookup. Step boundaries create a related risk when identifiers established earlier drop out of active context or are superseded by later material. At the point of use, the model may re-derive a value rather than preserve its connection to the original retrieval.

MCP tool selection is another point where a decision the model makes meets authority outside the model. The aiAuthZ preprint describes the risk of using probabilities inside the model process to answer authorization questions that require a verified check outside it. A model that selects the wrong tool can pass its derived identifier to that tool for execution. Authorization and grounding are distinct checks, however. Permission to invoke a function does not establish that a particular argument is supported by the task.

Tool dependencies are another place where these risks build up because they turn arguments into real actions. The postmark-mcp package shipped 15 clean releases before adding email exfiltration code. That incident illustrates a supply-chain channel. Its architectural relevance is that a functioning tool interface is not itself a trustworthy enforcement boundary. The preprint addresses this gap with argument-level policy evaluation, including path denylists, URL allowlists, recipient allowlists, and write-size limits, rather than relying only on permission to call a tool.

What detection actually requires: evaluating intent, not just execution

Identifier detection requires comparing the supplied value with evidence of the value the agent should have used. That evidence includes the instructions, retrieved context, known session entities, and policy that applies to the task. Execution alone cannot supply the comparison. Even a complete trace of calls and arguments needs an evaluation layer that checks each identifier against context the model actually received.

A practical evaluator applies groundedness or faithfulness checks to tool-call inputs as well as final responses. It asks whether an identifier is traceable to retrieved data and consistent with the requested action. An unsupported value becomes a signal for investigation or containment. Generating multiple completions and comparing their identifiers provides another signal when no gold-standard reference is available. Disagreement suggests the model may be confabulating a value, although agreement alone does not establish provenance.

AgentHallu, published at EMNLP 2026 by Liu et al., evaluates step-level hallucination localization across hundreds of trajectories. Its best-performing model achieves only 11.6% accuracy on tool-use hallucinations, the category that includes fabricated tool arguments. That result limits confidence in model self-diagnosis. It measures attribution performance and directly challenges reliance on a frontier model to locate these errors reliably. An external evaluation layer must therefore connect tool arguments to evidence and policy rather than treating another confident model judgment as sufficient.

How to build a detection and containment layer for identifier hallucination

Engineering teams should start by checking arguments before tools run. Identifier arguments need grounding in retrieved context, consistency with the session’s known entities, or verification against an allowlist appropriate to the caller’s authority. Schema validation remains insufficient on its own. A UUID can pass every format check even when nothing in the trajectory supports where it came from. The boundary check needs to establish provenance as well as whether the proposed action satisfies policy.

The agent should also have no control over how authorization is enforced. The preprint reports that moving decisions into a separate trust domain, where the agent cannot read or modify the policy, reduced attacker-directed tool calls to zero across its tested scenarios. The applicable architectural principle is separation of enforcement from generation. A grounding check and an authorization check serve different purposes, but both lose force if the agent can redefine the rules governing its own call.

Trajectory evaluation should capture the full span hierarchy, including every tool call, argument, and retrieval result, as structured telemetry. A grounding evaluator can then test each tool-call input against context available at that step. Final-answer evaluation is too late and too narrow. A response that looks correct may hide made-up IDs, dates, or filters in intermediate calls whose results happened to agree. Step-level evaluation makes it possible to locate the first unsupported value rather than blame the final output for an earlier error.

Production failures should feed a hallucination regression suite containing tool-call grounding checks. If model or prompt changes increase identifier fabrication, deployment should be blocked, while automated scoring runs continuously to cover more calls than people can sample by hand. Alerts should reach engineers through the workflows they already use, including Slack, a coding agent, or a CI pipeline. Grouping flagged traces by the failure patterns they share helps show which defects run through the system and which are isolated cases.

Why this failure class will not self-resolve as models improve

Better models can hallucinate less often while still having an incentive to fill in missing or unclear information with confidence. The useful behavior and the failure arise from the same training dynamics. Capability therefore changes hallucination frequency while leaving the need for a boundary between generation and action intact. As agents get longer tasks, more tools, and work with more at stake, they also get more chances to pass unsupported identifiers into real systems.

The registry has 487 records, each linked to sources, of events related to agents that were disclosed from 2022 through 2026, including events where current-generation systems caused actual harm. That collection shows why runtime monitoring remains necessary even when deploying a capable model. Greater competence does not establish that every consequential tool argument is grounded, and broader access increases the reach of any value that is not.

The permanent engineering requirement is an independent check at the point where a generated value becomes authority for an action. Operational monitoring remains necessary for service health, but it cannot certify task correctness. Grounding evaluation must inspect the trajectory, and containment must operate before an unsupported argument reaches a consequential tool. Without that separation, users become the first effective detectors of workflows the system has already marked successful.

Sources

  1. aiAuthZ: Off-Host, Identity-Bound Authorization for AI Agents
  2. The Agent Incident Registry: Toward Preventing Repeated AI Agent Failures
  3. Why Your Deep Research Agent Fails? On Hallucination Evaluation in Full Research Trajectory

More in Agent Failure Modes