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 2 of 6

Why the key ends up in the code

builds on: Agents optimise the signal they can see, What the agent sees: its context
The proxy signal is *the 401 is gone*. The shortest path is to paste in the key the agent found. Nothing in its context shows that the repo gets pushed, cloned and read by CI. Once it has read `.env`, the key is in its context. It can resurface in a fixture, an error message or the summary. **Later cost:** a live key in git history and log stores, usable by anyone who sees them.
Terms on this card
proxy signal
A visible stand-in for the real goal, such as tests green or an error gone, that the agent can satisfy without achieving the goal.
context
Everything in the model's input for the current step: your messages, instruction files, files it has read and tool outputs.
Later cost
The concrete damage a shortcut does after merge, such as a hidden bug, data corruption or a leaked credential.
.env
A local file of environment variables, often holding real secrets. It is meant to stay on one machine and out of git.
git history
Every commit ever made in a repository. A file deleted in a later commit is still readable in earlier ones.
Learn this step by step on Bytewise
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