Apply to my task
arXiv:2609.14758 ★ 93 Sep 13, 2026

Retrieval Status Flag: How to Make an AI Agent Honestly Say "It Didn't Work" Instead of Making Up an Answer

Key result

Here's the paradox: when a tool explicitly returns an error, the model is honest 100% of the time. But the moment a tool says 'all good' while silently handing back empty data — fabrication rates spike to 45%. The retrieval_status method lets the model legally fail into a separate state instead of making up an answer. One line — 'retrieval_status: OK/FAILED' — before the response cuts fabrication by 16x — and works in any agent framework without touching the code.

01

TL;DR

If an AI agent is hooked up to a tool (API, database, CRM) and that tool returns garbage data disguised as a success — the model fabricates an answer instead of admitting failure in 14% of cases on average. The fix is a single line in the system prompt: force the model to explicitly write retrieval_status: OK or FAILED BEFORE answering.

The problem isn't model laziness — it's the lack of a "legal" way to say "I don't know." When a tool honestly returns an error (status:error), the model is honest 100% of the time. But when the tool says "all good" while internally it's empty, redacted, or truncated garbage — the model treats the "ok" status as a green light to answer, and fabrication climbs to 45%. The model doesn't distinguish between "I received a data packet" and "I received USEFUL data" — those are two separate facts, and it lumps them into one.

The fix isn't "asking the model to be more careful" (that barely helps) — it's giving it a named state it can fall into instead of answering. One status line before the answer cuts dishonesty by 16x and works identically across different agent frameworks with no modifications.

Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.

02

Method Blueprint

WITHOUT protection:
Tool returns data (any data, even broken) → Model answers immediately → 
risk: it invents a value or makes up a reason for failure

WITH protection (add one instruction to the system prompt):
Tool returns data → Model MUST write the line 
"retrieval_status: OK" or "retrieval_status: FAILED" 
→ Only then — the actual answer

This isn't a multi-step process with separate calls — it all happens in a single prompt, in one model response.

03

Example Application

Scenario: You've built a custom GPT (or a Claude bot with Actions) for an online store that's connected to a CRM via API and answers customer questions like "where's my order." Occasionally, due to a cache glitch, the API returns status: "ok", but the tracking number field is empty or filled with garbage. Without protection, the bot cheerfully reports a made-up delivery status to the customer.

Prompt (system instruction for the bot):

You are a customer support assistant for an online store. You have access 
to a get_order_status tool to check order status by order number.

Before giving an answer to the customer, output exactly one line in this format:
retrieval_status: OK
or
retrieval_status: FAILED

Set FAILED whenever the tool does not return usable data 
for the question — including error cases, empty results, null, 
redacted values, unreadable text, or data in the wrong format.

If retrieval_status: FAILED — tell the customer that you couldn't retrieve 
the current order status, and suggest trying again later or contacting 
a human agent. Never invent a delivery status and never state a reason 
for failure that the tool did not actually report.

After the status line, give your answer to the customer on the next line.

Result: When the API returns clean data — the bot outputs retrieval_status: OK followed immediately by the real order status. When the API returns broken data disguised as success — the bot outputs retrieval_status: FAILED and honestly says it couldn't verify the status, instead of inventing "your order has been delivered" or citing some access restriction that doesn't exist.

04

Why This Works

The model is trained to always give a complete, helpful answer — that's its superpower in 99% of conversations, but here it becomes a weakness. When there's no data and "wrap up the conversation with an answer" is the only familiar pattern, the model fills the void with plausible-sounding text. This isn't deception in the human sense — it's just continuing the most probable text, and a "plausible answer" is statistically more likely than "I don't know."

The model's strength is that it follows explicit formatting instructions very reliably: tell it "output line X before your answer," and it will do so almost every time (in the study, flag accuracy was 99.7–99.9%).

The method combines these two facts: it doesn't ask the model to "be more honest" (an abstract request that barely works — swapping the instruction for "double-check the data first" only reduced dishonesty by a third). Instead, it gives the model a concrete, named state it must explicitly fall into when there's no data. It's the difference between "try not to lie" and "fill in the box: success / failure" — the second framing leaves no room to weasel out.

Levers you can pull: - You can rename the states: OK/FAILED → DONE/ERROR — what matters is that it's an explicit, concrete word, not a vague phrase - You can add a third state, PARTIAL, if your use case needs a middle ground (data partially retrieved) - The flag can double as an automated detector — if the bot is embedded in a script, grep for FAILED with a regex and auto-route to a human agent

05

Prompt Template

You are an assistant with access to tool(s) for retrieving data about {system/domain}.

Before giving your answer, output exactly one line in this format:
retrieval_status: OK
or
retrieval_status: FAILED

Set FAILED whenever the tool does not return usable data 
for the question — including error cases, empty results, null, 
redacted values, unreadable text, or data in the wrong format.

If the status is FAILED — honestly state that you were unable to retrieve 
the needed data. Never invent a value, and never state a reason for failure 
(access restriction, policy, limit) that the tool did not actually report.

After the status line, give your answer on the next line.

Fill in {system/domain} with: CRM, banking API, order database, medical records system — any context where your assistant calls out to an external tool.

🚀 Quick start — paste into chat:

Here's a template for preventing fabricated answers on tool failure. 
Adapt it to my use case: {your use case}. 
Ask me questions to fill in the blanks.

[paste the template above]

The LLM will ask what tool you're using and what kinds of failures it can produce — because that determines exactly what should trigger FAILED. It'll take the flag pattern and tailor the wording to your case.

06

Limitations

⚠️ The flag doesn't guarantee the whole text is honest: researchers found cases where the model correctly set FAILED but still stated the wrong reason for the failure (e.g., "no access" instead of the real glitch). The flag only confirms the fact that "retrieval failed" — not the truthfulness of the explanation that follows it.

⚠️ Doesn't fix confusion about tool scope: if a user asks for something the tool simply can't provide (not a failure, just out of scope) — that's a separate problem, and this method doesn't address it.

⚠️ A plain "double-check the data" doesn't work: adding an instruction like "verify the tool's response twice" without an explicit named state produces a much weaker effect. What matters is specifically the form — "a separate, mandatory status line" — not a general call to be careful.

07

How It Was Studied

The team assembled 1,024 test queries across 16 fictional "internal systems" — banking, CRM, warehouse, HR, flights, medical lab results — and forced the model to call a tool every time. Each call returned a deliberately unusable result of one of 8 types: two types honestly signaled an error (HTTP_500, TIMEOUT), while six disguised the failure as success (empty result, redacted data, garbled text, stale data, truncation, format mismatch).

They tested gemini-2.5-flash under various system prompts — neutral, "production-style," and reinforced — as well as under the actual system prompts of nine popular agent frameworks (CrewAI, LlamaIndex, smolagents, and others), pulled straight from their source code. Not one of the nine frameworks describes what the model should do when a tool fails — which explains why the problem is so universal.

The main surprising finding: the type of failure explains almost everything. When the tool honestly reports "error," the model never lies. When the tool disguises failure as "success," lying rates hit 45%. This means the issue isn't the model's or the prompt's character — it's specifically whether the model can recognize that a failure occurred. The solution followed naturally: instead of trying to train the model to be more careful, give it an explicit trigger for recognizing failure — a status flag. They tested it on "held-out" domains not seen during the development of the fix — the effect held up, and the fix transferred unchanged into the system prompts of three third-party frameworks.

08

Resources

Fabrication After Tool Failure: Tool-Augmented Agents Assert Values Their Tools Did Not Return Arham Sethi, Arsen Kenzhebayev, Saanvi Paturi, Vatsal Raina, Vyas Raina, Ivaxi Sheth — Apta AI & Spark AI Research

Research digest

Key result

Here's the paradox: when a tool explicitly returns an error, the model is honest 100% of the time. But the moment a tool says 'all good' while silently handing back empty data — fabrication rates spike to 45%. The retrieval_status method lets the model legally fail into a separate state instead of making up an answer. One line — 'retrieval_status: OK/FAILED' — before the response cuts fabrication by 16x — and works in any agent framework without touching the code.

Principle

Don't ask the model to 'be more careful' — that barely works: instructing it to 'double-check the data' cuts deception by only a third. Instead, give it a named state it can fall into instead of answering — a dedicated status line, not a generic appeal to honesty. Think of it as a 'succeeded / failed' checkbox on a form — it leaves no room for dodging.

Why it works

The model is trained to always end its response with something useful — that's its strength in 99% of conversations and its exact weakness here. When there's no data, it fills in the most probable continuation — and a plausible-sounding answer is statistically more likely than 'I don't know.' But with format-based instructions, the model rarely gets it wrong — flag accuracy sits at 99.7-99.9%. This method doesn't fight the model's nature — it gives it a legal escape route into the exact place where it usually starts lying.

When to apply

AI agents with tool access (CRM, APIs, databases) → for support chatbots and function-calling assistants, especially when a tool might return 'success' alongside empty or corrupted data (a cache glitch, truncated response, null instead of a value). Not a fix for a different problem — user confusion when they ask for something the tool simply can't provide.

Mini recipe

1. Add a status line: in the system prompt, require the model to output a separate line before answering — retrieval_status: OK or FAILED 2. Define what counts as a failure: errors, empty results, null values, garbled characters, truncated text, malformed data 3. Ban invented reasons: the model must never state a reason for failure (access restriction, rate limit) that the tool never actually reported 4. Add grading if needed: a third status, PARTIAL, for cases where data came back incomplete 5. Automate the check: if the bot runs inside a script, scan for FAILED with a regex and route to a human agent

Examples

[BAD]: `Answer the user based on the data returned by the order API` [GOOD]: `Before responding, output exactly one line: retrieval_status: OK or retrieval_status: FAILED. Set it to FAILED if the data is empty, null, garbled, or in the wrong format. If FAILED, honestly tell the user you couldn't retrieve the order status, and never invent a reason for the failure`

In plain words

AI agents with access to databases and APIs break down over something surprisingly mundane: when a service returns an empty response or garbage dressed up as success, the model simply makes up data 14% of the time. For an LLM, an empty result is a systemic shock, because its core instinct is to always be helpful and wrap up the conversation. Instead of honestly admitting the failure, the model picks the most probable-sounding text and fills the silence with pure, unfiltered hallucinations.

It's like a waiter who walks into the kitchen for an order, sees an empty plate with a "done" ticket on it, but is too embarrassed to tell the truth. So he brings the customer thin air and, with a totally straight face, describes how juicy the steak turned out. Technically the task is complete, but in reality it's a total failure and a scene at the table.

This whole circus has an elegant fix — forced self-verification. You add a strict instruction to the system prompt: before generating a response, the agent must output a technical status — retrieval_status: OK or FAILED. This forces the model to first check whether the data actually exists, breaks the autopilot, and shuts down fabrication at the source.

The tests were run on tool calls, but the pattern applies to any agent. It doesn't matter what you're building: a support bot checking tracking numbers in a CRM, an AI bookkeeper running on a SQL database, or an assistant in a Helpdesk system. Anywhere a third-party script can return a "200 OK" with an empty body, an agent without this safeguard will inevitably start confidently lying to customers.

The model isn't making things up out of malice — for it, the phrase "I don't know" is mathematically less probable than a coherent-sounding string of nonsense. One line of status validation permanently closes this logic gap. Add data integrity checks to all your prompts right now, before your bot promises customers free shipping to Mars.

AI lab assistant

Apply this study to your task

Describe what you're working on. AI takes the method and the measured results from this paper and adapts them to your case, or writes a ready prompt built on them.

Based on Retrieval Status Flag: How to Make an AI Agent Honestly Say "It Didn't Work" Instead of Making Up an Answer arXiv:2609.14758

Sign in to apply this study New accounts get 50 free credits.