Go from never having used a coding agent to working productively and safely with one. The learner should understand what an agent is and how it differs from a chat assistant. They should choose a tool, set up a protected first project, describe tasks the agent can do well, and follow and verify its work. They should recover from bad changes, manage context, and plan bigger changes. They should also use tests as the definition of done and run everyday workflows (bug fixes, features, writing tests, codebase exploration, scripts, small tools, refactors). Throughout, they should keep secrets and systems safe and keep their own understanding growing instead of outsourcing it.
Catching destructive commands
card 5 of 6
Catching a delete that goes too far
builds on: Approvals and permission modes, Undoing with git: discard, reset, revert
You asked the agent to clear out `build/`, a folder of generated output that can simply be recreated. It tucked a folder of real data into the same delete. Reading every path before approving catches it.
▸ You: the build/ folder has old output, clear it
◂ Agent: I'll clear old output and rebuild.
⚙ Run: rm -rf build/ data/
[Approve? yes / no / always]
▸ You: no. Why data/? It holds my only
copy of the survey results.
◂ Agent: You're right. Only build/ is
generated output. Revised:
⚙ Run: rm -rf build/
[Approve? yes / no / always]
▸ You: yes
Terms on this card
- generated output
- Files a tool creates automatically from your code, such as the contents of a `build/` folder. Running the tool again recreates them, so deleting them loses nothing.
- DELETE
- Database command that removes rows from a table. Which rows depends on its `WHERE` part.
- output
- The text a command or program prints when it runs, including results and error messages.
- agent
- An AI tool that doesn't just chat. It reads your project's files, edits them and runs commands to carry out a task you give it.
- path
- A file or folder's location written as folder names joined by `/`, e.g. `Projects/todo/app.py`.
Lesson goal: Recognise risky commands before approving them: recursive deletes, force-push, history rewrites, database drops, and installs with system-wide effects. Explain why 'always allow' must never cover them. ·
the whole lesson