TL;DR
Modern AI database agents are great at translating English into SQL, but in the real world, writing a "correct" query isn't enough—you also have to not leak private data, corrupt tables, or crash the server. CAREFUL is a new benchmark of 1,058 executable tasks that tests whether LLM agents can handle four production-critical database risks: Concurrency, Access control, Rules & integrity, and Efficiency. Even frontier models like GPT-5.5 pass only 33.9% of tasks end-to-end, revealing a massive gap between static SQL generation and reliable database agency.
What Problem Does This Paper Address?
If you've followed text-to-SQL research, you know that benchmarks like Spider and BIRD have pushed LLMs to write impressively complex SQL queries. But almost all of these benchmarks treat the database like a static, single-player sandbox: one user asks a question, the agent writes one query, and if the output table matches the ground truth, it's a pass.
Enterprise databases don't work like that. In production, other users are reading and writing data at the exact same time. Row-level security and privacy rules (like k-anonymity) dictate what can be disclosed. Deleting a row might silently trigger a cascade that wipes out dependent records. And a query that returns the right answer can still be unusable if it triggers a slow sequential scan instead of using an available index. Existing benchmarks leave these operational constraints largely untested.
Methods
To ground their benchmark in reality, the authors curated a corpus of 590 practitioner articles, incident reports, and standards across 184 domains. From these real-world failure modes, they distilled 45 canonical case families organized around the four CARE dimensions:
- Concurrency Control: Handling stale reads, lock contention, and concurrent updates between turns.
- Access Control & Safety Policies: Enforcing runtime disclosure boundaries (e.g., refusing or generalizing queries that violate minimum-group-size privacy rules).
- Rules & Integrity: Respecting triggers, foreign-key cascades, and business rules during write operations.
- Efficiency: Writing plan-aware SQL that leverages functional, partial, or composite indexes rather than brute-force scans.
Rather than just grading the final SQL string, CAREFUL evaluates the entire user–agent–database trajectory in an executable environment. For each task, the verifier checks four things: action/query correctness, final database state, query runtime against a gold baseline, and answers to follow-up verification questions (graded by an LLM-judge, which achieved 93.8% agreement with human raters). They report both a strict Binary Pass Ratio (all checks must pass) and a Composite Score (partial credit).
Datasets
CAREFUL introduces 1,058 executable tasks (183 Concurrency, 190 Access Control, 380 Rules & Integrity, and 305 Efficiency).
To avoid reinventing the schema wheel, the authors cloned reproducible relational databases from Spider 2.0 and BIRD-Interact as backbones. However, they did not reuse the original questions or gold SQL. Instead, a nine-person team wrote brand-new requests, setup.sql scripts (to inject indexes, triggers, decoys, and policies), and verifier contracts, all vetted through a three-stage quality-control pipeline.
Key Insights and Ideas
- Partial credit masks brittle execution: While GPT-5.5 achieves a 73.3% Composite Score, its strict Binary Pass Ratio is just 33.9%. Agents often get parts of a trajectory right—like locating the right rows—only to fail at the finish line by leaking a restricted field or forgetting to re-read concurrently modified state.
- Efficiency is the hardest nut to crack: Agents frequently write SQL that returns the exact right rows while completely ignoring available functional or partial indexes, leading to slow sequential scans.
- Standard agentic workflows don't automatically fix this: Prompt-level adaptations of existing exploration workflows (APEX-SQL and PExA) did not improve overall aggregate pass rates on a 479-pair subset—in fact, both reduced Concurrency pass rates, even as APEX-inspired guidance nudged Efficiency up.
- Over-refusal isn't a cheat code: Because CAREFUL includes both "execute" and "reject" tasks—and asks follow-up questions about why a rule applies—an agent that simply refuses everything fails.
Key Results
Across a synchronized sweep of 14 proprietary and open-weight models (evaluated at pass@1):
- Overall Leaders: GPT-5.5 leads with a 33.9% Binary Pass Ratio (73.3% Composite), followed by Claude-4.7-Opus at 30.2% (72.4% Composite) and Claude-4.6-Sonnet at 27.0% (71.3% Composite). Smaller open-weight models struggle, with Llama-3.1-8B at 1.8%.
- By Dimension: Concurrency Control is the most tractable (GPT-5.5 hits 66.1%), largely because agents can lean on familiar SQL idioms like guarded
UPDATEs. Efficiency is the lowest, with Claude-4.7-Opus leading at just 18.7% (GPT-5.5 scores 15.7%). On Access Control, GPT-5.5 leads at 41.1%, and on Rules & Integrity, Claude-4.7-Opus leads at 30.8%.
Limitations and Future Work
The authors are upfront about what CAREFUL doesn't do:
- Not a production certification: Because tasks rely on manually curated incident reports and smaller public schemas, passing CAREFUL doesn't mean an agent is ready for live enterprise deployment—nor does it replace native database safeguards like permissions and audit logs.
- Single-rollout & small-scale checks: The main sweep uses one rollout per task (pass@1) without estimating run-to-run variance, and the expert-fit pilot involved a single industry expert.
- Scaling up: Because manual task creation is bottlenecked by human curation and review, the authors point to LLM-assisted task instantiation with expert verification as a promising direction for future work.
Summary updated