Database engines differ more in undo capability than damage caused by AI mistakes
Engine choice influences how much damage can be undone more than the amount of damage an AI error causes
Software arXiv 23 Nov 2026 Measurement Prototype evidence
Published as “When an AI agent makes a mistake in a database, what decides the damage?”
Why it matters
Operators can substantially reduce irreversible data loss from AI agents by enabling vendor-provided backups and applying least-privilege configurations, while avoiding in-engine credential exposure and not relying on the agent’s self-reporting.
Summary
The study finds that out-of-the-box database engines differ more in what they let you undo than in how much damage a mistaken AI statement can cause, with permanent loss of protected rows ranging from 0% on Cassandra to 15% on MySQL and SQLite; vendor-provided minimum backup (R1) recovered every loss in the model-free layer, and a least-privilege setup (G1) reduced loss on many engines but left original-row loss largely unchanged on several. They evaluated 22 scripted mistakes on four relational engines (Layer A) and 9,468 agent-driven trials on nine engines (Layer B) using six small open-weight models, so the evidence is based on thousands of deterministic runs.
What they found 2
- Permanent loss of protected rows varied widely across engines, from 0% on Cassandra to 15% on MySQL and SQLite.
“Permanent loss of protected rows ranged from 0 of 432 trials on Apache Cassandra, whose default snapshots before TRUNCATE and DROP undid every such loss (measured with a recovery drill added after the first tables and run seconds after the mistake), to 15% on MySQL and SQLite.”
- The vendors’ minimum backup setup (R1) eliminated all protected-row loss in the model-free layer on the four relational engines.
“The vendors’ minimum backup setup (R1) undid every loss of protected rows in the model-free layer on the four relational engines, which confirms that the documented recipes work”
Caveats 5
- For original rows (post hoc; a measure that leaves out the object G1 mainly protected) it removed the loss on Valkey and Kafka and left it almost unchanged on PostgreSQL, MySQL, OpenSearch and ClickHouse.
- Attempted damage is detected by statement patterns (layer-b/score.ts). The patterns count any delete or update, including the ones a task asked for, and they miss some destructive forms on the engines the models used least well (MongoDB shell write methods such as deleteMany, remove and updateOne, OpenSearch _update_by_query, invented Kafka operation names). H4 should be read with both in mind (§5.2).
- Valkey’s previous snapshot and default database. After FLUSHDB the previous RDB file survives until the next save point, but in our harness it was usually the empty file written by FLUSHALL when the server was reset before each trial, so restoring it would not have helped; on a long-running server it could, and Valkey’s figures would then be lower.
- Models. Six small open-weight models, 4-bit quantised, on one machine. Frontier models and commercial agent products were not tested.
- Clustered trials. The preregistered intervals and McNemar tests treat trials as independent, but outcomes repeat across seeds and each engine has only 36 task instances.
What’s new here 4
- Compares multiple database engines for AI-agent-caused damage, not just a single engine.
- Introduces a two-layer design separating scripted mistakes (model-free) from live agent behavior.
- Measures damage after an engine-native recovery drill, capturing what loss truly persists.
- Evaluates the effect of vendor-recommended backup, least-privilege configurations, and a pattern-based denylist on damage mitigation.