Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Limiting what the agent can break
card 6 of 6
Bound the worst command in advance
builds on: A coding agent is a model in a loop, Untrusted text can steer the agent
Assume the agent will eventually run the worst command its access allows, and decide beforehand what that command can reach. Isolate it, keep production credentials out, give it its own branch or worktree, and gate destructive commands. Loosen these only as far as the task deserves.
Terms on this card
- worktree
- A second working directory for the same git repository, checked out on its own branch. Changes there don't touch your main checkout's files.
- production credentials
- Passwords, keys or tokens that give access to live systems and real customer data.
- the agent
- The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
Lesson goal: Set up safeguards that bound the damage an agent can do: sandboxes or containers, no production credentials, separate branches or worktrees, and approval gates for destructive commands such as `rm -rf`, `git push --force`, `git reset --hard` and database migrations. Match the agent's permissions to how much you trust the task. ·
the whole lesson