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 2 of 6
Whatever the agent sees leaves your laptop
builds on: What never to let an agent touch, What the agent can and cannot see
Everything the agent reads, and the output of every command it runs, becomes part of its context. That context is sent to the model provider's servers at every step and is kept in the session transcript. So approving `cat .env` ships your keys off your machine.
Keys leak in three more ways. The agent prints them into logs or command output (`printenv`, debug lines). It writes them straight into code. Or it commits `.env`: git, the project's history tool, saves a snapshot of the file. That history can later be pushed (uploaded) to a site like GitHub, where others can see it.
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.
- pushed
- Sent from your computer's git history to an online copy, such as GitHub, where others may see it.
- GitHub
- A website that hosts online copies of git projects, often publicly visible.
- model provider
- The company running the AI model (e.g. Anthropic, OpenAI). Everything the agent reads is sent to its servers.
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