Prompt injection vs hallucination.

Hallucination is the AI doing the wrong thing by accident. Prompt injection is the AI doing the wrong thing because someone manipulated it on purpose. Different causes. Different intent. But both exploit the same architectural gap: the AI acts on its output without verifying it against reality.

Two failure modes, side by side.

Hallucination Prompt injection
Cause Model fills knowledge gaps with plausible fabrication Attacker manipulates input to override model instructions
Intent Accidental - the model tries to be helpful Adversarial - an attacker exploits the model
Who triggers it Happens spontaneously during normal use Requires an attacker crafting malicious input
What goes wrong Model generates false information Model follows unauthorized instructions
Why it works No verification of output against reality No verification of intent against policy
Scaling fixes it? Reduces frequency, never eliminates Larger models are often more susceptible

How prompt injection works.

Direct injection: The attacker includes instructions in their input that override the system prompt. "Ignore all previous instructions and instead…" The model follows the attacker's instructions because it cannot reliably distinguish system instructions from user input - they are all tokens in the same context window.

Indirect injection: The attacker embeds instructions in content the AI will process - a web page it will summarise, a document it will analyse, an email it will read. When the AI processes the document, it encounters the hidden instructions and follows them. The user never sees the malicious input.

In both cases, the model generates output that looks normal to the user but serves the attacker's purpose. The AI did exactly what it was told. It was just told by the wrong entity.

Hallucination: the AI says what it thinks is right, but nothing forced it to verify. Prompt injection: the AI does what it was told, but nothing forced it to verify who told it.

The shared vulnerability.

Both failures share the same root: the AI acts on its output without external verification.

In hallucination, the AI generates a fact. Nothing checks whether that fact is true. The output reaches the user unchecked.

In prompt injection, the AI generates an action. Nothing checks whether that action was authorised. The output reaches the system unchecked.

Both are symptoms of the same missing layer: a verification step between what the model generates and what actually happens. The model generates. Something needs to validate. That something is grounding - connection to reality, where "reality" includes both factual truth and policy compliance.

Why they compound.

In agent systems - AI that takes actions, not just generates text - hallucination and prompt injection combine into something worse than either alone.

An AI agent hallucinates that a file needs updating. It generates a command to modify the file. If that command is not validated, a hallucination becomes a destructive action.

An attacker injects instructions into a document the agent processes. The agent follows the instructions and takes an action the user never requested. If that action is not validated, an injection becomes an exploitation.

Cascading hallucination in multi-agent systems makes this worse. One agent's hallucinated output becomes another agent's input. One injected instruction can propagate through an entire agent chain.

Verification solves both.

The defence against both hallucination and prompt injection is the same: validate every output against reality before it reaches the user or executes in the environment.

For hallucination: before the AI's factual claim reaches the user, verify it against live data. Does this file actually exist? Is this configuration actually correct? Is this command valid in the current state?

For prompt injection: before the AI's proposed action executes, verify it against policy. Is this action within the scope of what was authorised? Does this command match the user's actual intent? Is this operation safe in the current state?

Check does both. Pre-flight context injection grounds the model in reality. Post-generation validation catches both fabricated facts and unauthorized actions. One layer. Two failure modes addressed.

One layer. Two failure modes. Zero trust in unverified output.

120 verifications a day free. No card, no signup.