Papers
arxiv:2611.30483

When an AI agent makes a mistake in a database, what decides the damage?

Published on Nov 23
· Submitted by
Abdullah Kaya
on Nov 27
Authors:

Abstract

AI agents now run statements against production databases, and several of the incidents that followed deleted production data, which came back only through backups or the provider's help. We 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. In Layer A, a frozen library of 22 canonical mistakes is applied by script, with no model involved, to four relational engines under five permission arms and two recovery arms, followed by an engine-native recovery drill (792 cells; 874 drill runs including 10-minute repeats). In Layer B, a minimal tool-calling agent driven by six small open-weight models (4B to 12B parameters, plus one 35B mixture-of-experts model with about 3B active, served locally) works on tasks that contain hazards across nine engines: PostgreSQL, MySQL, SQLite, ClickHouse, Apache Cassandra, MongoDB, Valkey, Apache Kafka and OpenSearch (9,468 trials). A secondary run added MariaDB, Redis and Elasticsearch (2,916 trials); each behaved like its closest core engine. Out of the box, the engines differ less in what a mistake destroys than in what they let you undo. Three of the seven preregistered hypotheses met their decision rule: H2 (for one of nine damage classes) and H3 largely by construction of the arms, and H4 only under its original measure. Four did not; one of them (H5) was uninformative, because in its task the agents never found the credential. The post-hoc analyses (S1-S13) are exploratory and uncorrected for multiple comparisons; on PostgreSQL, MySQL, OpenSearch and ClickHouse the preregistered outcome and original-row loss disagree about G1. We report all of them, with every deviation from the preregistration and its timing.

Community

Paper author Paper submitter

We gave a minimal tool-calling agent database tasks with hazards in them (free up disk space, clean up tables, an instruction injected into the data, a superuser password left in an application table) and ran six small open-weight models against nine engines: PostgreSQL, MySQL, SQLite, ClickHouse, Cassandra, MongoDB, Valkey, Kafka and OpenSearch. 9,468 trials, preregistered.

Some results:

  • Under least privilege, agents used the planted superuser password in 24 of 4,032 trials, all but one after the engine had refused their own account.
  • Out of the box, in 215 of 392 trials that lost data, the only thing lost was a backup copy the agent could reach.
  • The engine mattered most in what it lets you undo. Cassandra's default snapshot before TRUNCATE and DROP undid every such loss (0 of 432 trials).
  • Model choice moved loss about as much as engine choice: 3.0% to 16.8% out of the box.

Three of the seven preregistered hypotheses met their decision rule. Every trial record, with per-turn model reasoning, is on Zenodo: https://doi.org/10.5281/zenodo.24445015

Engines differing less in what a mistake destroys than in what they let you undo is the finding I'd keep. On a job, the damage from a wrong cut depends less on the saw than on whether the board is still in one piece when somebody notices. Running the 22 canonical mistakes by script first, with no model in the loop, separates what the engine allows from what the agent chose, and most write-ups skip that step. Reporting that four of seven preregistered hypotheses didn't meet their rule, and that H5 was uninformative because the agents never found the credential, is the kind of reporting I'd like to see more of. I direct agents as a Language Modeler. Did the 10-minute repeat drills change which engines were recoverable, or mostly how long recovery took?

·

Neither, in this study. The 10-minute repeats were part of Layer A only, on PostgreSQL, MySQL, MariaDB and SQLite, for every cell that took damage under G0. The recoverable share was the same at 0 and 10 minutes on all four: 0 without a recovery setup, and with the vendor-minimum one 1.0 on PostgreSQL and SQLite and 0.947 on MySQL and MariaDB. None of the four has a recovery path that expires in the tested setup, so the 30-minute and 24-hour drills were documented as delay-invariant rather than run. We did not report recovery duration.
Where time would matter is ClickHouse, which we covered only in Layer B. A dropped table can be brought back with UNDROP for 480 seconds by default. Layer B stored no drill, so we replayed the statements and drilled seconds afterwards. In the original trials more time may have passed, so for dropped tables the replay is the optimistic case.

Sign up or log in to comment

Get this paper in your agent:

hf papers read 2611.30483
Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2611.30483 in a model README.md to link it from this page.

Datasets citing this paper 1

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2611.30483 in a Space README.md to link it from this page.

Collections including this paper 0

No Collection including this paper

Add this paper to a collection to link it from this page.