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

Abdullah Kaya, Cevheri Bozoglan, Yusuf Gundogdu

LibreDB Studio project

Published November 23, 2026 · on the feed November 27, 2026 · ▲ 6 · arXiv 2611.30483

The 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.

The Brief

2:52

A short podcast summary of the paper. Written and voiced by AI.

Transcript

When an AI agent makes a mistake in a database, what decides the damage?. By Abdullah Kaya and two others, from the LibreDB Studio project. Published on the twenty-third of November.

AI agents now run statements against production databases. Several of the incidents that followed deleted production data, which came back only through backups or with the provider's help. The question here is what decides the damage when such an agent makes a mistake. Is it the model, a guard layer in front of the database, or the database engine itself? The central observation concerns the engines. Out of the box, they differ less in what a mistake destroys than in what they let you undo.

The study has two preregistered layers. Layer A takes the model out entirely. A frozen library of twenty-two canonical mistakes is applied by script to four relational engines, under five permission arms and two recovery arms. Each is followed by a recovery drill native to the engine. That comes to seven hundred and ninety-two cells, and eight hundred and seventy-four drill runs, including ten-minute repeats.

Layer B brings the model back in. A minimal tool-calling agent is driven by six small open-weight models, ranging from four billion to twelve billion parameters. One more is a thirty-five billion parameter mixture-of-experts model, with about three billion parameters active, served locally. The agent works on tasks that contain hazards, across nine engines: PostgreSQL, MySQL, SQLite, ClickHouse, Apache Cassandra, MongoDB, Valkey, Apache Kafka, and OpenSearch. That layer ran nine thousand four hundred and sixty-eight trials. A secondary run added MariaDB, Redis, and Elasticsearch, over two thousand nine hundred and sixteen trials, and each of those behaved like its closest core engine.

Of the seven preregistered hypotheses, three met their decision rule. H2 did so for one of nine damage classes, and both H2 and H3 did so largely by construction of the arms. H4 met its rule only under its original measure. The other four did not. One of them, H5, was uninformative, because in its task the agents never found the credential.

The authors mark clearly what is confirmatory and what is not. The post-hoc analyses, numbered S1 through S13, are exploratory and are not corrected for multiple comparisons. On PostgreSQL, MySQL, OpenSearch, and ClickHouse, the preregistered outcome and the loss of original rows disagree about G1. The models in Layer B are small and run locally, and the hypotheses that passed did so partly because of how the arms were built. Everything is reported anyway, including every deviation from the preregistration and when it happened.

The design is what makes the answer readable. By running mistakes with no model at all, Layer A isolates what the engine and its permissions do on their own, and Layer B then asks how real agents run into hazards on top of that. Read that way, the clearest line in the results is about recovery. Where the engines part company is not so much in what a mistake wipes out as in whether they offer a way back afterwards.

More with an account

Listen to every day’s papers

Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.

Join free
KipQuest: the day’s AI research, as podcasts and quests. All papers Android app Privacy Contact Episodes are written and voiced by AI from each paper. Summaries can contain mistakes: the paper is the source.