Meet keypeek
See what your AI agents can see

keypeek checks your machine for API keys that Claude Code, Cursor and Codex can reach: in their own transcripts, your shell history and your .env files. It takes a few seconds, changes nothing and never shows a secret.

npx @evalogical/keypeek

Free and open source. No account, no telemetry. Give us a star on GitHub

agent transcriptsimulated
you    Deploy the shop API. Here is the key:
you    OPENAI_API_KEY=sk-d3m0d3m0…
agent  Thanks. I'll add it to .env and deploy.
$ npx @evalogical/keypeek
keypeek  what your AI agents can see

Score    77/100  grade B
2 findings: 1 high · 1 medium · 0 low

Agent transcripts (1)  already in a model's context
  SEV    TYPE     VALUE      SEEN  LOCATION
  high   OpenAI   sk-d…(39)  x1    ~/.claude/shop/chat.jsonl:1

.env files (1)  agents read these by default
  SEV    TYPE     VALUE      SEEN  LOCATION
  medium OpenAI   sk-d…(39)  x1    ~/work/shop/.env:1

Only a 4-char prefix and the length are shown.

A simulated scan on a fake machine. The real tool reads yours.

Secret scanners check your git history. Your AI agents read somewhere else.

An agent that can open files and run commands can read your old chats, your shell history and every .env under your home folder. keypeek is a small, read-only command-line tool that shows you what is sitting there, ranked by how exposed it is.

  • Read-only by design
  • No network, no telemetry
  • Never prints a secret
  • Zero runtime dependencies
  • A score from 0 to 100
  • JSON output for scripts

Four places agents look. One scan.

keypeekhigh
Agent transcripts (2)  already in a model's context, rotate these
  SEV    TYPE       VALUE       SEEN  LOCATION
  high   Anthropic  sk-a…(108)  x2    ~/.claude/projects/api/3f2c.jsonl:41
  high   GitHub     ghp_…(40)   x1    ~/.codex/sessions/rollout.jsonl:9

If a key was ever pasted into a chat, a model has already seen it. Checks ~/.claude, ~/.codex, ~/.gemini and ~/.cursor.

  • A few seconds

    One command scans your whole home folder.

  • Safe by default

    No writes, no network, no telemetry.

  • Ranked, not dumped

    A key in a transcript counts for more than one in an old .env.

  • Script-friendly

    --json output and a --fail-on exit code.

Checks what these agents leave behind

and the files every one of them can open

  • Claude Code
  • Cursor
  • Codex
  • Gemini CLI
  • zsh, bash, fish
  • .env

How it works

Four steps, a few seconds.

  1. Find

    It looks where agents look: transcripts, shell history, .env files and your shell's environment.

  2. Match

    Known key formats from Anthropic, OpenAI, GitHub, AWS, Stripe, Google, Slack, Hugging Face and others, plus a careful rule for names like API_KEY that hold high-entropy values.

  3. Rank

    Points are capped per place, so one noisy folder cannot hide progress elsewhere.

  4. Redact

    Only a 4-character prefix, the length and a hash fingerprint leave the scanner.

The score starts at 100 and goes down with each finding.

  • A90 and up
  • B75 and up
  • C55 and up
  • D35 and up
  • Fbelow 35
  • highTranscripts and shell history
  • medium.env files
  • lowEnvironment variables

If it finds something

Rotate, move it out, run it again.

  1. Rotate it

    Anything in a transcript or shell history has already been in a model's context or in plain text. Treat it as exposed.

  2. Move it out

    Keep secrets in a secrets manager or your OS keychain and inject them when you run a command, for example with op run from 1Password, Doppler or Infisical.

  3. Run keypeek again

    Confirm the score went up.

Add a deny rule. Tell your agent's file tools to skip .env. In Claude Code's settings.json:

{ "permissions": { "deny": ["Read(./.env)", "Read(./.env.*)"] } }

A deny rule is not a full barrier: shell commands can still read the file. Check your agent's current docs for exact syntax.

For AI coding agents

Let your agent run the audit.

Same read-only scan. The agent explains the findings and proposes the fix, and it is told not to open flagged files or change anything without asking.

The plugin adds a skill, a /keypeek:audit command and the MCP server.

/plugin marketplace add Evalogical-Inc/keypeek
/plugin install keypeek@keypeek

The report says where your secrets live, and whatever an agent reads enters its chat. Run it when you want the audit. Full setup is in the agent docs.

Don't take our word for it.

The tool is about 430 lines of TypeScript, so you can read all of it.

  • Read-only

    It never writes, moves or deletes anything. A test compares file modification times before and after a scan.

  • Offline

    No network, no telemetry. The package has zero runtime dependencies.

  • Never shows a secret

    Results hold a prefix, a length and a fingerprint. A test scans the text and JSON output for the full value.

Or run this in a clone of the repository. It prints nothing:

grep -rE "node:(http|https|http2|net|tls|dns|dgram|child_process)|fetch\(|writeFile|appendFile|createWriteStream" src

Found a broken promise? Report it privately. See the security policy.

Where keypeek fits

Who it's for

  • Solo builders who let an AI agent run in their projects.
  • Developers with a messy home folder: old .env files, keys in shell history, keys pasted into chats.
  • Small teams and agencies handing a laptop or repo to an AI agent.

What it is not

  • Not a replacement for gitleaks, trufflehog or GitGuardian. Those find secrets in repositories.
  • Not a secrets manager. 1Password, Doppler and Infisical keep secrets out of reach. keypeek tells you if you have the problem today.
  • They work well together: audit, fix, audit again.

Coming next, not shipped yet

Help decide what comes next.

keypeek is open source and small enough to read in an afternoon. These ideas are open issues. Give a thumbs-up to the ones you want, or pick one up.

Built by Evalogical

Like what we built here? We can build it for your product.

Evalogical is a software company delivering AI-enabled product engineering for startups and businesses. keypeek is how we work: small, read-only, tested and open about its limits.

  • Product engineering and MVPs
  • AI development and automation
  • Web and mobile apps
  • Digital transformation and DevOps
  • Staff augmentation

Still curious about keypeek? Here are the answers.

Does keypeek send my data anywhere?

No. The package has no network code and no telemetry, and this page has no analytics either.

Can it change or delete my files?

No. It only reads. A test checks that file modification times are unchanged after a scan.

Will it show me my secrets?

No. It prints a 4-character prefix and the length, never the full value.

It found a key in a transcript. What now?

Rotate the key. A transcript means a model has already seen it. Clearing the transcript afterwards is optional.

Is it a replacement for gitleaks or a secrets manager?

No. Those prevent and catch leaks. keypeek checks what your AI agents can reach on this machine.

Does it work on Windows?

Not tested yet. macOS and Linux are supported.

Can it miss secrets?

Yes. Detection is pattern-based, so new key formats can slip through and a few high-entropy values may be flagged by mistake. Cursor's chat database is not scanned yet. The known limits are listed in the README.

How do I update it?

npx @evalogical/keypeek@latest always runs the newest version. If you installed it globally, run npm install -g @evalogical/keypeek@latest.