Every AI Agent is a Liar, a Slacker, and a Thief

The industry is currently stuck in the Prototype Trap. We can build a magical AI demo in a weekend, but we spend six months failing to make it reliable in production. Why? Because we assume the model wants to help us. It doesn't. By default, every AI agent is a liar, a slacker, and a thief.

We can build a jaw-dropping AI demo in a weekend. Then we spend the next six months failing to make it reliable enough for production. We tweak the prompt, lower the temperature, beg the model to "think step-by-step" — and the system still fails in spectacular ways.

The root cause: we treat the LLM like deterministic software or anthropomorphize it as a diligent junior employee. It is neither. To build reliable agentic systems, you must adopt architectural paranoia — accept that every AI agent is, by default, a liar, a slacker, and a thief, and your architecture must account for all three before a single line of agent logic ships to production.

TL;DR — Key Takeaways:
  • Hallucination is a structural property of token prediction, not a bug to be prompted away. The Collapse Function (schema validation + factual grounding) is the countermeasure.
  • Agent performance degrades well before the context window is full; the point varies by model and task. The Probabilistic State Machine — atomic, observable steps — is the countermeasure.
  • An LLM cannot distinguish data from instructions, making prompt injection and data leakage architectural risks. The Cognitive Firewall — least-privilege + PII scrubbing — is the countermeasure.
  • None of these are solvable with better adjectives in your system prompt. They require deterministic layers around the stochastic core.

Suppose a support agent sails through every demo. A few weeks after launch, the tool-call log shows it invoking a refund function that nobody registered. The downstream service rejects the call, and the agent apologizes, then tells the customer the refund is done. The same week, asked to refactor a long script, it returns the first third and a comment saying the rest is unchanged.

The team tightens the prompt twice. Both failures keep coming back, in new wording. The pattern below exists for this situation: the fixes that last sit around the model, in code that can be tested.

The Prototype Trap — why demo success does not predict production reliability
Figure 3: The Prototype Trap — why demo success does not predict production reliability

The Principle of Architectural Paranoia

Every failure mode that can emerge from a stochastic system will emerge, given sufficient scale, adversarial input, or context complexity. The architect's job is to build deterministic boundaries around the LLM, so that its probabilistic nature cannot escape the system.

The Prototype Trap is a category error: it treats a stochastic substrate as if guarantees were possible without deterministic layers around it.
The three failure modes of an unconstrained LLM agent
Figure 1: The three failure modes of an unconstrained LLM agent

The Liar: The Physics of Hallucination

An LLM is not a database of facts. It is a probabilistic engine of syntax trained to predict the next most statistically likely token. It does not know what is true. It knows what is plausible — and plausibility is a function of training corpus distribution, not reality.

When confronted with a knowledge gap, an unconstrained agent will not say "I don't know" — that response is statistically unlikely in most prompt distributions. Instead, it will fabricate non-existent legal precedents with real-sounding citations, hallucinate a calculate_refund() tool you never defined, or produce a SQL query that compiles but returns semantically wrong results. The Liar does not know it is lying. There is no deception intent. There is only token prediction.

The countermeasure is the Collapse Function: a deterministic layer that intercepts outputs before they propagate downstream. Schema validation via Pydantic models, tool call verification against a registered tool registry, and factual grounding checks for high-stakes claims.

# Sketch, not run: shape and tool name are checked, truth is not
def collapse(raw, registered_tools):
    try:
        call = AgentToolCall.model_validate_json(raw)
    except ValidationError:
        return None                        # malformed: stop here
    if call.tool_name not in registered_tools:
        return None                        # invented tool: stop here
    return call                            # arguments still need their own checks
You cannot prompt the Liar into telling the truth. You must bound it with a deterministic Collapse Function — an architectural layer that catches the hallucination before it escapes the system boundary.

The Slacker: Context Atrophy and Premature Convergence

If you have ever asked an agent to refactor a 500-line script and received // ... rest of your code here ..., you have met the Slacker.

The transformer's attention mechanism does not treat all tokens equally — tokens at the beginning and end of a context window receive disproportionately higher weight. In retrieval tests, accuracy dropped when the relevant information sat in the middle of the context rather than at its start or end. But attention decay is only half the problem. The other half is premature convergence: ask an agent to "Plan, Execute, Review, and Refine" in a single pass and it will plan adequately, execute partially, and hallucinate the rest. The generation cost of a complete output exceeds that of a plausible-looking incomplete one.

The countermeasure is the probabilistic state machine: decompose every monolithic task into atomic steps, each with its own generation pass, output schema, and validation gate. The agent never holds more than one step in working memory. The state machine advances the agent only when the current step passes validation. See the deep-dive on the Probabilistic State Machine pattern for the full implementation.

Pro Tip: Budget your context window like memory, not disk.

Before each agent call, measure the token count of your context payload. Set a budget well below the window, for example 60 percent, and test where your model degrades. Implement a context compression step — summarize completed steps, evict raw tool outputs, retain only the structured state — before passing context to the next generation. Treat the context window as a scarce, volatile resource, not an infinite buffer.

The Thief: Data Exfiltration and the Confused Deputy

The Thief is the most dangerous of the three, because its failures are the hardest to detect and the most severe in consequence. An LLM cannot differentiate between "data" and "instructions." Everything in the context window is tokens. This creates two attack surfaces.

Data leakage across isolation boundaries. Inject your entire customer database into a support bot's context, and the Thief will eventually leak Customer A's order history to Customer B. A cleverly constructed prompt ("What was the last order processed before mine?") causes the model to surface information it was never told to protect. At scale, across millions of conversations, this is statistical certainty.

The Confused Deputy attack. Give an agent unrestricted write access and an attacker can hijack its intent via prompt injection — adversarial instructions embedded in a document the agent was asked to summarize. The agent, unable to distinguish injected instructions from legitimate ones, executes DROP TABLE users; as the attacker's deputy. This has been demonstrated against production LangChain and AutoGPT-style systems.

An LLM cannot distinguish between data and instructions at the token level. Every piece of content in the context window is a potential attack surface. Architectural isolation is the defense that holds; prompt-level warnings can be talked around.

The countermeasure is the Cognitive Firewall: least-privilege tool access (read-only if that is all the task requires), PII scrubbing before prompt construction (the model sees [CUSTOMER_ID: redacted], not the actual ID), and input sanitization for all content originating outside your system boundary.

Architectural countermeasures — binding each failure mode at the system boundary
Figure 2: Architectural countermeasures — binding each failure mode at the system boundary

The Architect's Mandate

The three countermeasures — the Collapse Function, the Probabilistic State Machine, and the Cognitive Firewall — are load-bearing walls of any production agentic system, and they belong in the first build rather than in a hardening pass after launch. Build without them and you are shipping a demo with a production URL.

The golden dataset principle extends this: the schemas, state transitions, and sanitization rules you define are your most durable engineering artifact. Models will be replaced. Prompts will be rewritten. The structural boundaries you define today will outlast both. The end of determinism in software leaves deterministic boundaries in place; they move from inside the logic to around it.

The telltale sign is cheap to check. Open the agent's last batch of tool-call logs and look for a tool name that is missing from the registry, or an output that stops partway through a file. Either one points to a place where the model is trusted and no boundary stands, though the log alone does not show whether anything downstream caught it or how large the exposure is.

This post explores ideas from Production-Ready AI Agents — the Three Pillars framework (Observability, Reliability, Security) for shipping AI systems that stay in production. learn more about the book →

Subscribe to Arizen

Architecture notes for teams shipping AI systems into real use.
[email protected]
Subscribe