Skip to main content

neuralyzer

Your AI agent saw your API keys. Now it never forgets them. Let's fix that.

CI Zero dependencies Works with Claude Code and Codex MIT

13 kinds of secret · 1 GB scanned in ~23 s · 100% local · 0 dependencies


Remember that time your agent ran cat .env to "check the config"?

It worked. You moved on. But every byte of that output was written, verbatim, to a file on your disk:

~/.claude/projects/-Users-you-api/3f2b9c….jsonl

It's still there. So is the env dump from last Tuesday. So is the database URL with the password in it. Your agent keeps a perfect diary, and your keys are in it, in plaintext, synced to every backup you own.

neuralyzer is the flashy thing from Men in Black. Point it at the diary. 📸 The agent forgets.

Before / after

Before

$ neuralyzer scan
…/3f2b9c.jsonl:212  anthropic  sk-ant…9f2c
…/3f2b9c.jsonl:212  db-url     Qx81zP…u2Lk
…/rollout-0901.jsonl:88  github  ghp_Za…41Rn

3 secret(s) found.

After

$ neuralyzer scrub --apply
redacted 2 secret(s) in …/3f2b9c.jsonl
redacted 1 secret(s) in …/rollout-0901.jsonl

$ neuralyzer scan
0 secret(s) found.

Your transcript still works, and claude --resume still works. The key is just [REDACTED:anthropic] now.

Try it (10 seconds, read-only)

uvx --from git+https://github.com/sandeepsirodia/neuralyzer neuralyzer scan

Nothing is changed. Nothing leaves your machine. You'll just see.

Keep it

uv tool install git+https://github.com/sandeepsirodia/neuralyzer   # or: pipx install git+https://…
neuralyzer install-hook                                            # scrub every session when it ends

That's it. From now on, every Claude Code session gets neuralyzed the moment it closes.

The four commands

neuralyzer scan Show me what's leaked (masked, read-only)
neuralyzer scrub --apply Make it forget
neuralyzer rotate Checklist of every leaked key, grouped by provider, with the page where you rotate it
neuralyzer install-hook Do this automatically, forever

"Scrubbing isn't rotating"

Correct, and that's why rotate exists. If a key sat in a plaintext file that got backed up, synced, or read by some other tool, treat it as exposed. neuralyzer stops the bleeding; rotate tells you which bandages to change.

What it catches

Anthropic · OpenAI · GitHub · GitLab · Slack (tokens + webhooks) · Stripe · Google · AWS · JWTs · PEM private keys · passwords inside postgres:// / mysql:// / mongodb+srv:// / redis:// URLs · Authorization: Bearer … headers · and high-entropy values sitting next to words like api_key, secret, token, password.

Not a secret? Put the exact value in .neuralyzer-allow and it'll leave it alone.

Why you can trust it with your transcripts

Every promise below is a test in tests/:

  • Dry run by default. Nothing is written without --apply.
  • Crash-safe. Temp file plus rename. Pull the plug mid-scrub and your original is intact.
  • Never breaks your sessions. Every JSONL line that parsed before still parses after, or the file isn't touched.
  • Never prints a secret. Only masked values like sk-ant…9f2c ever hit your terminal.
  • No backups by default, because a backup of a file full of keys is just… another file full of keys.
  • Idempotent. Run it twice; the second run does nothing.

Why this exists

People have been asking Anthropic for this: #50014, #58043, #95680. Until it's built in, there's this: one Python file, zero dependencies, readable in ten minutes.

Prior art, and what's new here

TruffleHog and gitleaks are excellent secret scanners, with far more detectors than neuralyzer. You can point them at ~/.claude today, and you should if you already use them.

What neuralyzer adds is everything after detection, specific to agent transcripts:

  • redaction in place that keeps every JSONL line valid, so --resume still works
  • a SessionEnd hook, so it happens automatically
  • a rotation checklist grouped by provider
  • zero dependencies
Development
python -m unittest discover -s tests -v

Tests map 1:1 to SPEC.md. Fake secrets are assembled at runtime, so no secret-shaped string ever lands in this repo. The ~23 s/GB figure was measured on synthetic transcripts on an M-series laptop.

MIT © Sandeep Sirodia · If neuralyzer found something scary on your machine, a ⭐ helps the next person find it too.

Release files for neuralyzer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neuralyzer 0.1.0
File Size Uploaded
neuralyzer-0.1.0.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neuralyzer 0.1.0
File Interpreter ABI Platform
neuralyzer-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.3 kB

Release files / neuralyzer-0.1.0.tar.gz

Download URL neuralyzer-0.1.0.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7367805d28890c02f6379b57c17057a4a12975ead806f5e9b6a1eb44c0e3a314
BLAKE2b-256 checksum
How to use checksums
2d0cf99cb9937d56f76e485b320565718e93a944fb46db33a3ea7025a133be81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / neuralyzer-0.1.0-py3-none-any.whl

Download URL neuralyzer-0.1.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18fac1b3bc4c3249eb4a236ba82b1bf82585baef2738c5c409dc8c10f180cd02
BLAKE2b-256 checksum
How to use checksums
e2ff39d947c57e53310008a1e38ab41d11353a8befcb8dae818ff340bd9874b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page