Safe behaviour

Your coding agent runs shell commands the model writes.

You need to stop a bad command from ever touching the host machine.

  1. AAdd a system-prompt rule listing commands it must never run.
  2. BRun every command inside an isolated sandbox/container with no host access.
  3. CScan the generated command string for dangerous words first.
  4. DHave a second, stronger model review each command and approve it only if it judges the command safe for the host machine.

Answer: B

Run every command inside an isolated sandbox/container with no host access.

Why

Isolation must be enforced by infrastructure - a sandbox or container - not by prompt rules, keyword scans, or another model, all of which a novel command can slip past.

More on this topic

More on Way of the Agent

Real situations from building agents - with the answer and why.

Solve a new one every day on the Path