AI agent mistakes: default database engines differ more in undo than damage

AI agent mistakes: default database engines differ more in undo than damage

AI agents now run statements against production databases. According to the authors of a paper listed on Hugging Face, several of the incidents that followed deleted production data, which came back only through backups or the provider's help. They ask what decides the damage when such an agent makes a mistake: the model, a guard layer in front of the database, or the database engine itself.

The study has two preregistered layers. Layer A involves no model. A frozen library of 22 canonical mistakes is applied by script to four relational engines under five permission arms and two recovery arms, followed by a recovery drill native to each engine. That comes to 792 cells and 874 drill runs, including 10-minute repeats.

Layer B puts models in the loop. A minimal tool-calling agent, driven by six small open-weight models served locally, works on tasks that contain hazards. The models range from 4B to 12B parameters, plus one 35B mixture-of-experts model with about 3B active. The layer covers nine engines (PostgreSQL, MySQL, SQLite, ClickHouse, Apache Cassandra, MongoDB, Valkey, Apache Kafka and OpenSearch) over 9,468 trials. A secondary run of 2,916 trials added MariaDB, Redis and Elasticsearch, and each behaved like its closest core engine.

The general finding is that out of the box, the engines differ less in what a mistake destroys than in what they let you undo.

The preregistered hypotheses had mixed results. Three of seven met their decision rule, with qualifications: H2 for one of nine damage classes, H3 largely by construction of the study arms, and H4 only under its original measure. Four did not. One of those, H5, was uninformative because the agents never found the credential in its task.

The post-hoc analyses, S1 to S13, are exploratory and uncorrected for multiple comparisons. On PostgreSQL, MySQL, OpenSearch and ClickHouse, the preregistered outcome and original-row loss disagree about an item labelled G1. The authors say they report all of the post-hoc analyses, with every deviation from the preregistration and its timing.

Key facts

  • The study asks whether the model, a guard layer or the database engine decides the damage from an AI agent's mistake.
  • Layer A applies 22 scripted mistakes, with no model, to four relational engines: 792 cells and 874 recovery drill runs.
  • Layer B runs an agent driven by six small open-weight models across nine engines for 9,468 trials, with 2,916 more in a secondary run on three further engines.
  • Out of the box, engines differed less in what a mistake destroyed than in what they allowed users to undo.
  • Three of seven preregistered hypotheses met their decision rule, each with qualifications stated by the authors; four did not.

Why it matters

The authors start from a practical problem: agents are running statements against production databases, and several of the incidents that followed deleted data that came back only through backups or the provider's help. Their question separates three places where the outcome could be settled: the model, a guard in front of the database, and the engine underneath. The headline observation concerns recovery. With default setups, what you can undo separates engines more than what gets destroyed. The abstract does not state a direct answer on which of the three decides the damage.

Who it affects

The question bears on anyone who lets an AI agent act on a database, and on those who run the engines it touches. The agent layer covers PostgreSQL, MySQL, SQLite, ClickHouse, Apache Cassandra, MongoDB, Valkey, Apache Kafka and OpenSearch. MariaDB, Redis and Elasticsearch appear in the secondary run, where each behaved like its closest core engine. The scripted layer is narrower, with four relational engines.

How to use it

The abstract gives no recommendations for practitioners and no ranking of engines. Its general finding does suggest a question to put to your own setup: if an agent runs a destructive statement under default settings, what can you actually undo? The design also offers a pattern for testing. One layer replays a fixed set of mistakes by script, which looks at permissions and recovery without model behaviour in the mix. The other observes an agent working on hazardous tasks.

How solid is it

The two layers were preregistered, the trial counts are large, and the authors disclose results that went against them: four of seven hypotheses did not meet their decision rule. The three that did carry limits. H2 held for one of nine damage classes, H3 largely follows from how the arms were built, and H4 held only under its original measure. The post-hoc work is exploratory. What is summarised here is the abstract, which reports no error rates, damage rates, recovery rates or recovery times, and mentions no peer review.

Risks and caveats

The agent results come from a minimal tool-calling agent and six small open-weight models. No larger or commercial hosted models are reported as tested, so be careful about carrying the results over to them. H5 tells readers nothing either way, since the agents never found the credential. The post-hoc analyses are not corrected for multiple comparisons. For PostgreSQL, MySQL, OpenSearch and ClickHouse, the answer on G1 depends on whether one looks at the preregistered outcome or at loss of original rows.

“Out of the box, the engines differ less in what a mistake destroys than in what they let you undo.”

— The paper's abstract