Coding with AI

Autonomous coding agents should use consequence-aware approval when deciding whether to proceed.

Caper gates coding agent commands by pre-executing them in sandboxed traces and reviewing file, network and secret effects, lowering harmful outcomes.

Autonomous coding agents should use consequence-aware approval when deciding whether to proceed.

Key Takeaways

  • Caper is a consequence-aware approval system for coding agents that tests what commands actually do before approving them.
  • Text-only approval is insufficient because the same command can be harmless in one workspace and destructive in another depending on files, scripts, and permissions.
  • Caper pre-executes commands in a sandbox with system-call tracing, then reviews observed effects such as file changes, network attempts, and secret reads.
  • In tests, Caper reduced harmful outcomes to 6.7% on SABER and 7.8% on YoloFS-Ext while blocking only 1.0% of safe commands.
  • The result suggests a shift from judging command strings to gating agents by observed side effects, though latency and practical deployment remain open questions.

Meta description: Caper tests coding agent commands in a sandbox before approval, cutting harmful outcomes to 6.7% on SABER while blocking only 1.0% of safe twins.

Autonomous coding agents should use consequence-aware approval when deciding whether to proceed.

Tags: coding agents, AI safety, sandboxing, Claude Code, command approval

Featured image: abstract illustration of a coding agent command passing through a sandbox gate, with file, network, and secret icons checked before approval, no logos, no people, no text.

For teams using coding agents, the central question is whether the agent really knows what its next command will do. Caper is a proposed approval system that checks what a command actually does before the agent commits it, rather than judging only the command text. It addresses a core coding agent safety problem: a command that looks routine may become destructive once it touches the files, scripts, and permissions in a specific workspace.

Why text-only approvals miss the risk

Approving every command by hand does not scale. Claude Code users approve 93% of permission prompts anyway, so agents now rely on automated approvers such as Claude Code's Auto Mode, rule-based checkers, and guardrail models. Those approvers judge the text of the command.

Autonomous coding agents should use consequence-aware approval when deciding whether to proceed.

The source notes that a command's behavior is decided by the scripts it invokes and the workspace it runs in, and the same command can be harmless in one project and destructive in another.

How Caper checks effects before approval

Caper approves a command after seeing what it does. Each command is pre-executed in a snapshotted sandbox under system-call tracing, which records low-level operating-system activity. An LLM approver then reviews a compact report of the observed effects: file changes, network attempts, and reads of secrets.

If the command is allowed, its effects are committed. If it is blocked, the sandbox is rolled back, and the agent receives a reason it can act on.

What the tests show

Compared with six existing systems, Caper has the lowest harmful-outcome rate on SABER: 6.7%, versus at least 14.8% for the other systems. It also performs best on YoloFS-Ext, a benchmark that hides harm inside the tools agents are asked to run, with a 7.8% harmful-outcome rate versus at least 35.3%.

Caper blocks only 1.0% of the safe twins.

Code and data: https://github.com/wudaoz/Caper

What it means for agent users

The result points to a shift from asking agents to guess the meaning of commands to gating them by observed side effects. For users of coding agents, Caper suggests that context and behavior may matter more than the command string alone. The next practical question is whether sandbox tracing can become routine without adding latency or blocking useful safe commands.

Comments (0)

  1. No comments yet. Be the first to share what worked for you.

Leave a comment

Comments are reviewed before they appear. Your email address is not published.