Fault-Tolerant Sandboxing for AI Coding Agents: A Transactional Approach to Safe Autonomous Execution¶
๐ Published (v1): 2025-12-14 19:03 UTC ยท Source: Arxiv ยท link
Ask a follow-up
Open an assistant pre-loaded with this paper's context.
๐ฌ Ask ChatGPTโฆ Ask Claude
TL;DR¶
This paper proposes a transactional sandboxing framework for AI coding agents that wraps every tool-call in an ACID-style snapshot/rollback mechanism, enforced by a lightweight policy engine. Deployed on a Proxmox/EVPN testbed with the Minimind-MoE SLM (~26M params), it achieves 100% interception of destructive commands and 100% rollback success at only 14.5% latency overhead (~1.8s per transaction).
Problem¶
Autonomous LLM coding agents can issue destructive or state-corrupting shell commands with no mechanism to validate intent before execution or restore a consistent filesystem state on failure. Existing approaches are inadequate: containers and VMs incur heavy startup latency; Python venvs offer no filesystem rollback; commercial CLIs (e.g., Gemini CLI) require interactive authentication, breaking headless agentic loops.
Method¶
A two-layer sandboxing framework wraps every agent tool-call:
-
Policy Engine: Classifies each incoming command as
Safe(read-only; bypass snapshot),Unsafe(destructive; block immediately), orUncertain(state-modifying; trigger checkpoint). Classification uses a static blacklist/whitelist with regex parsing. -
Snapshot-Rollback (Algorithm 1): Before executing any
Uncertaincommand, the framework callsSNAPSHOT(S_curr)viashutilcopy-on-write over a ZFS-backed volume. On non-zero exit code, it restoresS_curr โ S_snap(rollback). On success, it discards the snapshot (commit). This models each tool-call as an atomic ACID transaction:S_{t+1} = S_t + ฮCif execution succeeds, elseS_t.
The agent uses Minimind-v1-MoE (~26M params, MixFFN from DeepSeek-V2) served via nano-vllm, running in an LXC container isolated via EVPN/VXLAN on Proxmox VE 9.0.
Key Contributions¶
- Formal definition of transactional semantics for LLM tool-use (ACID framing applied to agent actions)
- Policy-based pre-execution interception layer with three-tier classification
- Prototype snapshot-rollback implementation using filesystem-level copy-on-write
- Empirical evaluation on a realistic Proxmox/EVPN testbed; quantified latency cost of safety
- Comparative analysis exposing the "interactive auth barrier" that disqualifies Gemini CLI for headless autonomy
- SLM vs. LLM trade-off analysis in the agentic context, with economic modeling
Results¶
- 100% interception rate for blacklisted (destructive) commands (20/20 attempts blocked)
- 100% rollback success rate for induced state-corruption scenarios (20/20 rolled back)
- 100% commit success rate for valid state-change commands (20/20 committed)
- Baseline execution: 4.69s; sandboxed: 6.51s; overhead: ~1.82s (14.5%)
- Gemini CLI: 0% success in headless environment (100% failure due to interactive auth prompt)
- Test suite: 10 scenarios (5 happy-path, 5 adversarial) on a 250MB Python project workspace
Limitations¶
- Snapshot mechanism uses
shutilfilesystem copy, not true ZFS snapshots; overhead scales with workspace size - No support for stateful external APIs โ HTTP calls (Terraform, Netconf, cloud APIs) cannot be "un-sent" via filesystem rollback; compensating transactions (Sagas pattern) are unimplemented
- Policy engine relies on static blacklist/whitelist; no semantic understanding of command intent
- Minimind-MoE (~26M params) is extremely small; SLMs exhibit shallow reasoning, hallucination on out-of-distribution tasks, small context windows, and "stubbornness loops" when retrying policy-blocked commands
- Evaluation limited to 10 scenarios on a single 250MB project; no benchmark against SWE-bench or standard agentic evals
- No sandbox-aware prompting implemented despite identifying it as necessary for agent learning
Relevance to Harnesses / Meta-Harnesses¶
This paper directly addresses a core infrastructure concern for any harness that invokes LLM agents to execute shell commands or filesystem operations autonomously: how to make each agentic "step" atomic and recoverable. The three-tier policy classification (safe/unsafe/uncertain) and snapshot-rollback pattern are directly portable to meta-harnesses that orchestrate multi-step agent loops, providing a principled mechanism to isolate side effects between pipeline stages. The identification of the headless-automation gap in commercial tools (the "interactive auth barrier") is a practical constraint any harness builder must navigate when composing third-party agent runtimes. The "sandbox-aware prompting" insight โ that agents must be told they are operating inside a transactional boundary to correctly interpret PolicyViolation signals โ is relevant to any harness that surfaces tool-rejection feedback into the agent's reasoning loop.