C.W.K.
Stream
Lesson 04 of 05 · published

Living With Coding Agents — Practical Hygiene

~15 min · hygiene, gitleaks, pre-commit

Level 0Greenhorn
0 XP0/53 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

You're not going to stop using AI coding tools — they're too productive. The realistic posture is hygiene, not abstinence.

The pre-flight checklist (once per repo)

  1. Add ignore-files for every agent you use. One per tool: .cursorignore, .claudeignore, .aiderignore, etc. List secrets and DB files.
  2. Verify by asking the agent to list the repo's files. The blocked files should not appear. Test this; don't assume.
  3. Move all real secrets to keychain or runtime env. Replace .env values with <FROM_KEYCHAIN> placeholders.
  4. Add a pre-commit hook that scans for secrets. gitleaks, trufflehog, or even a simple regex set. The hook fires before the commit lands.
  5. Tell the agent your conventions. A short rules file that says "never embed secrets in code; always use the get_secret() helper" reduces (not eliminates) the suggestion-pattern leak.

The per-session habits

HabitWhy
Don't paste real stack traces with credentialsRedact connection strings before pasting
Don't paste production logs verbatimLogs leak request IDs, internal IPs, sometimes tokens in URLs
Treat the chat transcript as publicDon't share screenshots without scanning for secrets first
Disable memory features for repos with sensitive contextCross-session bleed is hardest to audit
Periodically purge agent chat historyReduces the attack surface if the provider is breached

The worst things you can tell the agent

  • "Read my .env and verify these keys look right." — You just put every secret in the request.
  • "Why isn't this connection working?" + paste of full connection string — Now the password is in the transcript.
  • "Set up a deploy script that uses my AWS credentials." — Suggestion will hardcode them.
  • "Generate a config file with all my real values filled in." — You asked for the leak.

The best habit

Speak in placeholders. "Why isn't $DB_URL connecting? Here's the format: postgres://USER:PASS@HOST:PORT/DB." The agent reasons about the shape, not the secret. Your transcript stays clean.

External links

Exercise

Install gitleaks (brew install gitleaks) and run it against your repo (gitleaks detect). Anything found = rotate immediately. Add gitleaks as a pre-commit hook (via the pre-commit framework) so future commits get scanned automatically. The agent's leak vectors get caught at the git boundary too.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.