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.
Keeping secrets out of the agent's reach
card 3 of 6
Make real keys unreachable
builds on: What never to let an agent touch, What the agent can and cannot see
1. **Separate credentials**: create a test-mode or dev-only key just for this project, with low limits and easy to revoke. Your real keys (the ones your live app or payments use) stay in your password manager.
2. Put only that test key in `.env`. List `.env` in `.gitignore`, the file that tells git never to save certain files.
3. Add **deny rules** in the agent's settings for `.env` and secret folders.
4. Launch the agent from a terminal with no real keys exported.
5. Answer no to `cat .env`, `env` and `printenv`.
6. Leaked anyway? Revoke the key and create a new one.
Terms on this card
- .env
- A file in a project that holds environment variables, often secrets like API keys, loaded when the app starts.
- git
- A tool that keeps a project's history by saving snapshots of its files.
- .gitignore
- A file listing files git should never track, so they can't be accidentally committed or pushed.
- deny rules
- Settings in an agent tool that forbid certain actions, such as reading specific files, no matter what the agent decides.
- credentials
- Secrets that prove who you are to a service, such as API keys and passwords.
Lesson goal: Explain how secrets leak: the agent reads `.env`, prints keys in logs, commits them, or sends them to the model provider. Use ignore and deny rules, test keys and separate credentials so the agent never needs the real ones. ·
the whole lesson