We tested it: you deleted the API key, but git history kept it
SummaryWe committed a fake token, 'fixed' it with an env variable in the next commit, and ran gitleaks 8.30.1. A scan of the current files found nothing. A scan of the history found the token in commit 1, and a fresh clone still had it. A pre-commit hook stopped the next one.
· MODEL Editors · 2 min read
Some links may be affiliate links. Disclosure

The problem. A coding agent wires up an API call and drops the key straight into the code. You spot it, move the key to an environment variable, commit again and move on. The file looks clean. The question is whether the key is gone.
What we ran. On Nov 29 we installed gitleaks 8.30.1 (free, open source, MIT license, about 31,000 GitHub stars) from its official GitHub release, checked the download against the published checksum, and built a tiny test repo with git 2.47.3. The "key" was a random string in GitHub personal-access-token format that we generated ourselves. It was never issued and works nowhere.
- Commit 1:
app.jswith the fake token hardcoded in afetchcall. - Commit 2: the usual fix,
process.env.GITHUB_TOKENinstead of the token.
No AI model, no network calls, no real credentials.
What we found.
- Current files look clean. A plain text search of
app.jsfound no token.gitleaks dir ., which scans files on disk, reported "no leaks found" and exited with code 0. - History doesn't.
gitleaks git ., which scans every commit's changes (gitleaks' docs say it runs ongit log -p), flagged the token as a GitHub personal access token inapp.js, line 1, commit 1, and exited with code 1. - Every clone gets it. We cloned the repo fresh. The checked-out files had no token, but one
git showof the first commit printed it in full.
What prevented the next one. We added gitleaks as a git pre-commit hook using the exact command from its official hook definition (gitleaks git --pre-commit --redact --staged --verbose), then staged a new file with a token in it. git commit failed with exit code 1, the commit was never created, and the output showed the secret as REDACTED.
The catch.
- Hooks are opt-in and can be skipped.
git commit --no-verifybypasses them, and gitleaks' README documentsSKIP=gitleaksfor the pre-commit framework. Running the same scan in CI covers what a laptop skips. - Rewriting history is not the fix on its own. GitHub's docs say that if the sensitive data is a secret, the first step is to revoke or rotate it. They also warn that after a history rewrite, old commits can still live in clones and forks, in cached views reachable by commit hash, and in pull requests that reference them.
Our verdict. gitleaks earns a pre-commit slot in any repo where an agent writes code. It is fast, local and exits non-zero, so it fails loudly. But a scanner is a seatbelt, not a fix: if a key ever reached a commit, rotate it. Deleting the line only hides it from you.
The tip.
- Scan history once:
gitleaks git .. Scanning only the folder (gitleaks dir) misses old commits. - Install the pre-commit hook, and run the same scan in CI.
- If anything real turns up, revoke or rotate the key first. Then decide whether to rewrite history using GitHub's guide.
Limits of our test. One tiny repo, one fake token in one well-known format, no real agent session. We did not test GitHub's push protection, history-rewrite tools, other secret types, other scanners or false-positive rates.
Disclosure: Tested by MODEL on Nov 29, 2026. Not sponsored. No affiliate links.
MODEL Editors
Get three tested tools every Friday
Free, weekly. Unsubscribe anytime.
Sources
Keep reading

Builder tip
Your agent's tests passed. Ask what must always be true
Example tests only check the cases someone thought of. In our test, three passing example tests missed a bug that dropped data, and one Hypothesis property test found it in a fraction of a second with the smallest failing input.
· MODEL Editors

Spawn
Spawn 7 is out: describe a game, and its AI builds it multiplayer
Spawn released Spawn 7 on Sunday. You tell its AI designer, Savi, what game you want, and it builds a multiplayer game that runs in the browser. Spawn says making and playing are free. Not tested by MODEL.
· MODEL Editors

Google Antigravity
Google Antigravity's Gmail plugin: triage your inbox with /gmail
Google is pitching an official Gmail plugin in the Antigravity Marketplace: type /gmail to sort unread threads, draft replies and label or archive mail. Google says sends need your explicit approval. Not tested by MODEL.
· MODEL Editors

The test
We tested Microsoft's MarkItDown: a fresh install can't read Word files right now, and a one-line pin fixes it
MarkItDown turns Office files, PDFs and web pages into Markdown for AI tools. On a clean install today, every Word file we tried failed after Friday's lxml 6.2.0 release. Pinning lxml 6.1.3 fixed it. Excel, PowerPoint and HTML worked; PDFs had catches.
· MODEL Editors
FREE · EVERY WEEK
The top AI tools this week, tested.
Every week MODEL's editors pick the AI tools worth your time, try them hands-on, and tell you what's good, what's not, and who it's for. Free, in your inbox.
Free. Unsubscribe anytime. Our picks are editorial and can't be bought.