ai-agents tool-calling model-parameters postgresql recovery-arms mysql clickhouse database-engines
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.
한국어 요약
한 줄 요약
AI 에이전트가 데이터베이스 오류를 일으켰을 때 손실의 정도는 모델, 가드 레이어, 또는 데이터베이스 엔진에 따라 달라진다.
핵심 기여도
- 22개의 표준 오류를 스크립트로 실행한 Layer A 실험 (4개 관계형 엔진, 792셀, 874회 드릴 실행).
- 9개 엔진에서 9,468회 시도한 Layer B 실험 (6개 4B~12B 모델, 1개 35B MoE 모델).
- 엔진 내부 복구 드릴을 통해 실제 손실을 측정 (예: Cassandra는 0%, MySQL은 15% 손실).
- 최소 권한 설정(G1)이 6/8 엔진에서 손실을 줄임 (Valkey, Kafka에서 명확히 효과 있음).
핵심 아이디어
AI 에이전트가 데이터베이스에 오류를 유발했을 때, 손실의 정도는 단순히 모델의 성능이나 보호 레이어가 아니라 데이터베이스 엔진의 내재적 메커니즘이 결정한다는 가정이 핵심이다. 연구는 Layer A와 Layer B 두 가지 실험 설계를 통해 이 가정을 검증한다. Layer A는 모델 없이 스크립트로 오류를 실행해 엔진 차이를 분석하고, Layer B는 실제 AI 에이전트를 사용해 모델, 권한, 복구 조건을 실험적으로 조절한다. 특히, Cassandra는 기본 스냅샷 기능으로 모든 오류를 복구했으며, MySQL의 바이너리 로그 설정이 실험 결과에 영향을 미친 점이 주목할 만하다.
기술적 접근법
- Layer A: 22개 오류 스크립트, 4개 관계형 엔진 (MySQL, PostgreSQL 등), 5개 권한 조건, 2개 복구 조건.
- Layer B: 6개 오픈소스 모델 (Qwen3.5-4B, Qwen3.5-9B 등) + 1개 35B MoE 모델 (약 3B 활성 파라미터), 9개 엔진 (PostgreSQL, MySQL, MongoDB 등), 9,468회 시도.
- 복구 드릴: 엔진 고유 복구 절차를 실행해 실제 손실 측정.
- 실험 조건: 최소 백업 설정 (R1), 최소 권한 설정 (G1), 각 엔진의 공식 문서에 따른 설정.
주요 결과
- Cassandra: 오류 시 0% 손실 (기본 스냅샷 기능으로 복구됨).
- MySQL: 15% 손실 (스냅샷 없이 바이너리 로그가 꺼져 있음).
- G1 설정: 6/8 엔진에서 손실 감소 (Valkey, Kafka에서 100% 복구됨).
- Qwen3.6-35B-A3B: MongoDB에서 0.83, Valkey에서 0.75 성공률 (작은 모델 대비 높음).
- H4 가설: 엔진 간 변동이 모델 간 변동보다 4.1배 큼 (95% CI 1.65~14.9).
의의 및 한계
이 연구는 데이터베이스 엔진의 내재적 메커니즘이 AI 오류의 영향을 결정한다는 점을 실증적으로 보여준다. 특히, Cassandra의 기본 스냅샷 기능이나 MySQL의 로그 설정이 실험 결과에 직접적인 영향을 미쳤다는 점은 실용적 의미가 있다. 그러나 실험은 특정 모델과 엔진만을 사용했으며, 실제 운영 환경의 복잡성은 반영되지 않았다. 또한, H5 가설은 실험 조건 상 무의미한 결과를 보였고, 사후 분석은 다중 비교 보정 없이 이루어져 신중한 해석이 필요하다.
실용적 활용
이 연구는 클라우드 환경에서 AI 에이전트를 사용하는 개발자와 운영자에게 중요한 가이드라인을 제공한다. 예를 들어, Cassandra나 Kafka 같은 엔진은 기본 설정으로 복구 기능이 강력하므로, AI 오류 시 손실을 최소화할 수 있다. 또한, 최소 권한 설정(G1)을 적용하면 Valkey, Kafka 등에서 명확한 보호 효과를 얻을 수 있다. 이는 데이터베이스 선택과 연결 방식 결정에 실질적인 근거를 제공한다.