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.
Secrets in code, logs and commits
card 6 of 6
Rotate first, then delete
builds on: Agents optimise the signal they can see, What the agent sees: its context
Anything the agent reads can come back out in code, logs, fixtures or its summary. Check for secrets in every diff, and keep real secrets out of its reach when you can. Once a secret has been committed, deleting it is not enough. The old commit still holds it, and once pushed, clones, forks and CI logs keep copies. Rotate it: issue a new one, switch over, revoke the old one.
Terms on this card
- Rotate
- Replace a secret: issue a new one, switch every system to it, then revoke the old one so it stops working.
- CI
- Continuous integration: servers that build and test every push automatically, and keep their logs and checkouts.
- the agent
- The AI coding system doing the work: a chat assistant, IDE agent or terminal agent.
- diff
- The set of line changes between two versions of the code: removed lines start with '-', added lines with '+'.
- commit
- Making database writes permanent. Once committed, a write stays even if later steps fail.
Lesson goal: Catch hardcoded keys added 'to make it work', tokens written to logs or error messages, committed .env files and credentials pasted into test fixtures. Remember that any secret the agent reads enters its context and can resurface. Once a secret has been committed, rotate it: deleting it from the code is not enough. ·
the whole lesson