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

Secret tells to scan for in every diff

builds on: Agents optimise the signal they can see, What the agent sees: its context
- String literals shaped like keys: `sk_live_`, `AKIA`, `ghp_`, `eyJ…` (JWTs), long hex or base64 - A real key used as the **default** in an env lookup - Logs or error messages that include headers, a whole config or request, or a connection URL with a password - `.env`, `*.pem` or credential JSON files added, or removed from `.gitignore` - Test fixtures or recorded HTTP responses that hold real tokens **Later cost** of each: a working secret sits in history, logs or fixtures that many people and systems can read. It stays valid until rotated.
Terms on this card
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.
.gitignore
A file listing paths git should not track, so files like .env are not committed by accident. It does not affect files already committed.
base64
An encoding that writes bytes as letters, digits, '+' and '/'. Long base64 strings in code are often keys or tokens.
sk_live_
A prefix used by payment providers for live (production) secret API keys.
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