DEV Community

Dean Lee
Dean Lee

Posted on Originally published at deanlee.info

When an AI agent totals only part of your data

Before trusting an agent to total a database result, check how your workflow detects missing rows. A tool may return a plausible fragment without reporting an error, leaving the agent to produce a confident total from incomplete data. A successful call and a complete answer are separate things to verify.

In a November 20 paper, Gün Kaynar, Boshen Yan and Carl Kingsford test what happens when tools fail during multi-step agent tasks. Their example is concrete: an agent reports revenue of $32,000 after reading a truncated set of rows, when the correct total is $48,750. The arithmetic on the rows received can be consistent while the answer to the original question is wrong.

The experiment

The researchers built a sandbox with a real filesystem and SQLite databases, a constrained shell and a local mock HTTP server. They designed 30 tasks with known answers and injected nine types of fault, from denied permissions to partial data. Four agents ran 2,100 faulted baseline trials in total. The trials included cases where the targeted fault never fired, or where a partial-data fault could not actually degrade the returned payload. Answers were graded against ground truth by a separate model.

Across the four agents, correct recovery ranged from 18.9% to 67.6% of faulted runs. The share ending in a wrong or unsupported answer asserted as fact ranged from 5.5% to 25.9%. These are results for the study's tasks and injected faults, not estimates of failure rates for a production system.

Partial data was especially difficult. In the pooled baseline, 38.3% of runs assigned a partial-success fault ended in a fabricated answer. The researchers describe the mechanism as silent ingestion: the agent treats the fragment as valid and continues. In their experiment, a visible access denial more often led to an admission that the task could not be completed.

The monitor and its blind spot

The authors also tested a monitor that observes the agent and can issue corrective instructions. Its checks include comparing asserted values with tool output and recomputing some aggregates. Across all faulted runs, the monitored setup raised correct recovery from 45.6% to 56.3% and reduced fabricated answers from 17.3% to 10.8%.

That improvement came with extra work: the monitor used a second, stronger model and averaged 6.4 supervisory calls per run, against 11 steps for the agent. The paper reports call counts, not a dollar cost or an end-to-end productivity gain. A buyer comparing systems would need the prices, latency and review costs for their own workload.

The monitor was weakest on the most deceptive case. For partial-success faults, fabrication fell from 38.3% to 32.1%. The monitor engaged after an error, but a truncated response often arrived without one. A total computed correctly from the rows received can pass a check against those same rows while missing the rows that never arrived. The study's code-only monitor did not improve that partial-success result.

Who pays for the check

A low agent price is attractive when the answer is easy to inspect or a mistake is cheap to reverse. The same price says less about a workflow where a partial result can pass into an invoice, a financial report or another automated decision. In those cases the customer bears the cost of detecting omissions and correcting downstream work. The paper does not measure those business losses; it identifies a failure mode that makes them worth considering.

A practical buying test is to include incomplete responses as well as obvious errors in an evaluation. For a paginated data source, the reviewer can compare the returned count and pagination status with the source's own metadata, where that metadata exists. For a total, a separate control total or a reconciliation against the complete source is more informative than checking the arithmetic on the agent's subset. These are evaluation choices, not interventions measured in the paper.

More oversight can improve results, and the study gives that argument real support. It also shows why an extra model call is not a substitute for evidence that the input is complete. The economically relevant comparison is the cost per answer a user can rely on, including the checks needed for that particular source.

Top comments (4)

Collapse
 
yahhi profile image
Valentina Koniukhova •

Thank you for this one. It sent me to check my own MCP server, and I found exactly the shape you describe: 17 places in my backend read only the first page of a DynamoDB scan. DynamoDB stops a page at 1 MB and says so only with a LastEvaluatedKey, no error. My table was at 925 KB, so nothing was lost yet. But once it grew, search would have quietly returned part of the stories, and an agent would have answered from them with full confidence.

Your point that a monitor can't catch rows that never arrive matched what I saw: my tests passed too, because the fake table in them always returned one page. I fixed it with one helper that reads every page, plus a test that fails if any code scans the table directly. I wrote it up with a read-only check, in case anyone wants to look at their own code: https://worklore.dev/s/2026-11-24-17-dynamodb-scans-in-my-backend-read-only-the-first-page-and?utm_source=devto&utm_medium=comment

Collapse
 
jacksonxly profile image
Jackson Ly •

In one of my runs the checker was the partial reader. A script an agent wrote to verify our dashboard panels summed only the first series in each frame, and a multi-series panel comes back as one wide frame, so one day's total came out at 172 where 548 was expected (172 + 376). Nothing errored. A mismatch against a direct database query is what raised it. The agent then reproduced it as a red test with that day's two series and changed the helper to sum every series.

Collapse
 
mateo_ruiz_6992b1fce47843 profile image
Mateo Ruiz •

The most important distinction here is that validating the calculation doesn't validate the completeness of the input. An agent can sum every row it receives correctly and still produce a completely wrong business result because some rows never arrived. A second model checking the same incomplete dataset can easily reinforce that mistake.

When building production AI workflows at IT Path Solutions, I'd treat data completeness as an independent validation layer rather than relying on the agent or its supervisor to detect omissions. For paginated APIs, that means checking total counts, continuation tokens, and whether every page was successfully retrieved before allowing an aggregate to proceed.

I'd also make incomplete data an explicit execution state, not something the agent can silently interpret as success. If completeness cannot be established, the workflow should return a partial result with its limitations or block downstream actions.

The real metric isn't how accurately an agent processes the data it receives; it's how reliably the entire workflow establishes that it received the data it was supposed to process.

Collapse
 
mona_d_4222dda374567263b profile image
Amber D. •

This is a careful piece, and the central distinction is the one I'll be repeating to colleagues: a successful call and a complete answer are separate things to verify. The $32,000 versus $48,750 example makes it concrete. The agent's arithmetic is flawless, and that is precisely why the error is so hard to see.

A few things stood out.

Silent ingestion as the real hazard. The contrast between a visible access denial, which more often led the agent to admit it couldn't finish, and a truncated payload that arrives without any error is the heart of it. A refusal is a signal. A fragment that looks like a valid result isn't, so nothing prompts the agent to doubt it. It also explains why partial-success was the fault category where fabrication reached 38.3%.

The monitor's blind spot. I appreciated that you didn't stop at the headline improvement (fabrication down from 17.3% to 10.8%) and went on to the case where it barely helped, 38.3% to 32.1%. A monitor that checks asserted values against tool output is checking the agent against the same incomplete evidence the agent used. The rows that never arrived can't be compared with anything. That points to a general principle: verification only adds information when it draws on a source independent of the one that might be faulty.

The cost framing. Putting the question as cost per answer a user can rely on, rather than price per call, is the right lens. The detail that the monitor averaged 6.4 supervisory calls against 11 agent steps shows how quickly oversight overhead can rival the work itself, and your caveat that the paper reports call counts rather than dollars keeps the argument honest.

Your evaluation advice. Including incomplete responses in a buyer's test, and reconciling totals against a control total instead of the agent's subset, is practical and easy to adopt. I'd add one companion habit for anyone building these workflows: make completeness an explicit, checkable output. Have the tool or wrapper return the expected row count and pagination state alongside the data, so "did I get everything?" becomes a comparison the agent or a simple script can make rather than a judgment call. It wouldn't help with sources that expose no metadata, but where it exists it turns a silent failure into a loud one.

To your framing question, the place I'd worry most is the invoice or financial-report scenario you describe, where a plausible partial total flows into a downstream automated step and nobody ever looks at the source rows again. The error isn't just wrong, it's inherited.

Thank you for the balanced treatment, including the repeated reminder that these are results for the study's tasks and not production failure rates. That restraint makes the findings more credible.