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 2 of 6
It can do anything you can do
builds on: A coding agent is a model in a loop, Untrusted text can steer the agent
Every command the agent runs, runs as you. It has your files, environment variables, SSH keys, git rights and cloud logins. Its intent does not limit it. Only its access does. A wandering loop or an injected instruction can produce `git reset --hard`, which throws away your uncommitted edits to tracked files. It can run a migration against production, dropping columns and losing rows. It can run `git push --force`, overwriting teammates' commits. You can't stop the model from erring, so limit what an error can reach.
Terms on this card
- SSH keys
- Private key files (usually in `~/.ssh`) that log you into servers and git hosts without a password.
- git reset --hard
- Moves the branch to another commit and overwrites tracked files in the working directory. Staged changes and edits to tracked files are discarded with no undo. Untracked files are left alone.
- git push --force
- Overwrites the remote branch with your local one, deleting commits on the remote that you don't have.
- migration
- A script that changes a database's schema or data, such as adding or dropping columns. It is often irreversible for data.
- environment variables
- Named values a process inherits from the shell that started it, such as DATABASE_URL. Child processes see them too.
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