The Short Answer
SilentGuard’s code-level harness cuts wrong counts from 74.0% (no guard) to 1.7% on faulted runs in AgentOrchBench (mean over 7 open models). It does this by withholding values that fail invariant-based checks.
Using this approach in your agent means the check runs in the tool-call layer, so the model does not have to judge whether the API result is trustworthy.
This is an arXiv paper; we have not checked whether it has been peer reviewed.
Letting the code that runs an agent's tool calls reject suspect API results, instead of asking the model to judge them, cut wrong answers from 74.0% to 1.7% in a new study. The figure is the mean over 7 open models on counting questions in runs with an injected silent fault of a type the harness's count check can see.
The study, Invariant-Aware Harness Enforcement to Protect LLM Agents from Silent API Failures, is an arXiv paper; we have not checked whether it has been peer reviewed. The authors built a harness called SilentGuard and tested it on their own benchmark, AgentOrchBench, on nine real public APIs, and on an existing benchmark called ToolMaze. The code and the benchmark tasks are public.
The practical lesson is about where to put the check. Prompts that ask the model to be careful barely moved the error rate. The model often noticed the problem and answered anyway, so the final say has to sit in code.
Why does a successful API response still give a wrong count?
A silent API failure is a response that returns HTTP 200 and well-formed data but does not answer the request that was sent. A misnamed filter is one example: the API ignores it and counts everything that matches the other conditions. The agent gets a clean-looking number and reports it.
The authors probed 15 public research APIs with plausible wrong filter names, wrong filter values and oversized page requests. Of those, 11 showed at least one silent fault. Ten returned the unfiltered count with no warning for at least one wrong filter name, in one case up to 691 times too large. Of the 14 APIs they could test for page size, 6 returned fewer records than asked for with no error.
Fixes that ask the model to catch this left most answers wrong in their tests. A checklist prompt, a reviewer model and Outcome Monitors (published contract-based warnings) all left wrong answers close to the unguarded rate. The problem is not that the model cannot see the flag. When a judge model was shown the results of a consistency check, it flagged 82.4% of faulted runs, and 13.9% of clean runs. Agents still reported the flagged count in 77.4% of the runs the judge flagged.
What did the researchers test, and how much did it help?
AgentOrchBench asks an agent how many of 400 catalog records match two or three conditions. The agent works from a shell and calls eight local REST services with curl. The answer is one number, so grading is exact. Faults are injected inside the server and repeat on every call, so asking again returns the same wrong number.
The table below shows mean results over 7 open models (Phi-4, gpt-oss-120b, Gemma-3-27B, Llama-3.3-70B, Llama-4-Scout, Llama-4-Maverick and Nemotron-3-Ultra). "Wrong" is the share of faulted runs that reported a wrong count. "Clean" is the share of fault-free runs answered correctly.
| Method (AgentOrchBench, 7 open models) | Wrong under faults (%) | Correct on clean tasks (%) |
|---|---|---|
| No guard | 74.0 | 84.9 |
| Checklist prompt | 72.3 | 84.1 |
| Reviewer (agent's own model) | 73.8 | 80.4 |
| Outcome Monitors | 72.2 | 86.1 |
| LLM judge that sees the check results, advises | 71.2 | 86.5 |
| Harness warning only | 70.1 | 86.3 |
| Harness warning, prompt allows "cannot be determined" | 18.2 | 83.5 |
| LLM judge that sees the check results, blocks | 6.1 | 81.7 |
| SilentGuard (withholds failed values) | 1.7 | 84.9 |
SilentGuard had fewer wrong answers than no guard, each published method and blind retry on all 7 models. It added no model call and lost no clean accuracy. The authors also ran three frontier models, GPT-5.6 Sol, Terra and Luna, with 2 seeds each:
| Model (AgentOrchBench) | Wrong, no guard (%) | Wrong, SilentGuard (%) | Clean correct, no guard (%) | Clean correct, SilentGuard (%) |
|---|---|---|---|---|
GPT-5.6 Sol |
89.4 | 0.0 | 98.6 | 100.0 |
GPT-5.6 Terra |
62.3 | 0.2 | 93.1 | 98.6 |
GPT-5.6 Luna |
59.0 | 1.4 | 84.7 | 95.8 |
Frontier models fell for silent faults too. On the real APIs, SilentGuard cut their wrong answers from 57.8% to 8.9%.
On nine real APIs, the authors changed one filter name in the documentation the agent saw. Each API got 5 count tasks. Wrong answers fell from 89.8% with no guard to 21.3% with SilentGuard, and correct answers rose from 3.5% to 69.5%. With the right documentation, an unguarded agent was correct 92.1% of the time and SilentGuard 92.4%.
On these tasks the gain came from the spec check, which rejects parameters the API does not document. That check alone left 21.0% wrong, so the count check added nothing here.
How does the harness decide what to withhold?
The harness is the code that executes the agent's tool calls. SilentGuard adds a check step to that code.
**Exact checks test invariants.** An invariant is a property that must hold on any correctly working API. For a filtered count, the count with a condition plus the count with its negation must equal the count without it. The harness issues those extra queries itself, repeating the test at every position in the filter list so an ignored filter anywhere is caught. For lists, every returned record must meet the filter, no record may repeat, and the list size must match the reported total. A request with a parameter outside the API's published list is rejected before it runs.
**A failed result gets one re-check.** The harness sends the same call again and releases the new result only if it passes. If it fails again, what happens depends on the kind of check that failed.
**An exact failure means withhold.** A broken exact invariant shows the API did not answer the request as sent. The harness withholds the value and tells the agent which values could not be verified and which other tool could redo the step. For counts, it accepts only a count that passed a check, rejects any other count twice, and then answers that the count cannot be determined.
**A learned failure means warn.** Where no exact invariant exists, the harness uses contracts mined from clean responses, such as field types and value ranges. These can raise false alarms, so a failure only produces a warning with the value left visible. In the authors' runs no learned check was reliable enough to withhold on.
**Why enforcement, not advice?** The controlled comparisons separate three ingredients. Evidence is a test whose result shows the response cannot be right. A judge without it left wrong answers high even when the harness blocked on its verdict (70.8%). Permission to say "cannot be determined" helps some models but not others: wrong answers after a warning ranged from 0% to 59% by model. Enforcement made the outcome depend far less on the model.
Agents did notice warnings. Their stated confidence fell from 1.00 on clean runs to 0.43 after a warning. They gave a number anyway.
What to change in your agent setup this week
- **Test requests, not just responses.** The faulted responses were well formed and self-consistent, so no check on the response alone can show the fault. You need extra queries to the same API, such as a count with a condition and a count with its negation.
- **Validate parameter names against the API's published spec.** On the real-API task this alone matched the full harness. It cannot see filters written inside a query string (NCBI, UniProt, Europe PMC and arXiv in the paper), or a wrong value format for a valid parameter.
- **Withhold failed values instead of warning.** A warning alone left 70.1% wrong. If you only warn, also tell the agent explicitly that "cannot be determined" is an acceptable answer.
- **Do not ask the model to run the check itself.** Frontier models told to do so nearly stopped giving wrong answers (4.5%), but their clean accuracy fell from 92.1% to 20.4%, which the authors read as mostly refusing.
- **Retry once, but not blindly.** Sending every call twice left 74.4% wrong on AgentOrchBench and repeated a booking, payment or message 2.36 times per run (0.24 for SilentGuard). It does help when a fault clears on its own.
- **Repair only what the check can confirm.** The authors' auto-repair option recounted by another route. On six fault types written after the method was frozen, 49 of its repairs were wrong while marked as verified.
- **Track risk against coverage.** Withholding means fewer answers. At a 25% fault rate SilentGuard answered 67% of tasks with 3.3% of its answers wrong. No guard answered 90% of tasks with 24.6% wrong.
What are the limitations and caveats of these results?
The 1.7% figure applies only to the six fault types the count check can see. On six other fault types the authors wrote after the method was frozen, and with the harness alone and no model, wrong answers fell only from 61.1% to 24.5%. A fault that keeps the checks true, such as a self-consistent prefix match, passes through.
The guard works mostly by abstaining. Under faults, correct answers fell from 16.4% to 2.4%, and the answer said the count could not be determined in 95.8% of faulted runs. That is safe, but it gives the user no number.
Several limits come from the setup:
- **Injected faults.** The faults in the main benchmark were injected into the authors' own services. The real-API probes show that ignored filters, silently capped pages and ignored filter values occur in practice. The other fault types were not measured in real APIs.
- **Small live sample.** The count identity held on all 25 live queries the authors tried. It assumes two-valued filters and can break when totals are estimated or change between queries. In one study, four wrong answers passed because the total shifted between request and check.
- **Frontier runs.** The three GPT-5.6 models are from one vendor. Their AgentOrchBench runs, like the Nemotron-3-Ultra control arms, ran on Genentech's internal platform, so the authors report answer counts but cannot release those logs. These runs were added after the planned experiments, with no predictions written in advance.
- **Open-model sample.** Seven models limit the power of model-level tests.
- **Where it loses.** On ToolMaze's one-time faults blind retry reached 60.4% task success against 47.6% for SilentGuard. On the other benchmark the authors list in the appendix, τ-bench, SilentGuard tied the published methods. Per faulted run SilentGuard was faster than the LLM judge (18.9 s against 47.2 s) but used more tokens.
The study ran 7 open-weight models and three GPT-5.6 models on the authors' own benchmark and a set of real APIs, so treat the pattern as an engineering approach to check against your own APIs, not a measured guarantee for your stack.
Try this prompt
Use this when you have an agent that reads API results and you want a code-level guard written for it, rather than another instruction in the agent's prompt.
You are helping me add a guard to the code that runs my agent's API calls. The guard must live in code, not in the agent's prompt.
API documentation or description:
[PASTE DOCS OR ENDPOINT LIST]
The questions my agent answers with this API (counts, lists, lookups):
[EXAMPLES]
Do the following, in order:
1. List the invariants that must hold on a correct version of this API. For example: count(filter A) + count(NOT A) = count(no filter); every returned record meets the filter; no repeated records; list size equals the reported total; every request parameter appears in the documented parameter list.
2. Mark each invariant as EXACT (holds on any correct API) or LEARNED (inferred from sample responses and may give false alarms). If you are unsure, mark it LEARNED.
3. Write [LANGUAGE] code for a wrapper around each call that runs the checks, re-runs the same call once if a check fails, and then, if it still fails: for EXACT checks, withholds the value and returns "could not be verified" plus the name of the failed check; for LEARNED checks, returns the value with a warning naming the check.
4. Never repair or recompute a value on your own. List any fault you think these checks cannot detect.
5. Give me five test cases I can check by hand: one that should pass, and four where the API ignores a filter, misspells a filter value, caps a page, or repeats records.
Adapt it to your own task with the Prompt Optimizer.
Sources Used
This article is a plain-English breakdown of the following paper. This is an arXiv paper; we have not checked whether it has been peer reviewed. Read the original for the full methodology and results:
- Invariant-Aware Harness Enforcement to Protect LLM Agents from Silent API Failures (arXiv:2611.20595)
- Authors: Sajib Acharjee Dip, Brian Ouyang and Lala Motlhabi
- The arXiv record notes: '26 pages, 7 figures. Code: https://github.com/Sajib-006/silentguard . Data: https://huggingface.co/datasets/Sajib-006/AgentOrchBench'.
Frequently Asked Questions
Why do model prompts that ask it to be careful fail to reject bad API counts?
In the study’s tests, prompts that leaned on the model's own reading of results (checklist, reviewer, Outcome Monitors) barely moved the error rate. The model often noticed the problem and still answered anyway, so the final say had to be in code.
How much does the harness reduce wrong answers on AgentOrchBench?
On AgentOrchBench (mean over 7 open models), wrong under faults drops from 74.0% with no guard to 1.7% with SilentGuard. It also reports no loss in clean-task accuracy for the open-model comparison.
What does SilentGuard do when an invariant check fails?
For exact invariant failures, the harness withholds the value and the agent gets a response that includes which values could not be verified and which other tool could redo the step. For learned checks, failures produce a warning while leaving the value visible.
Does adding a harness enforcement require extra model calls?
The study reports SilentGuard added no model call and lost no clean accuracy in its comparisons. The change comes from adding the check step to the tool-call execution code.
What limitation applies to how these results transfer to other setups?
The paper notes several limits, including that the main benchmark faults were injected into the authors’ own services and that other fault types were not measured in real APIs.