Skip to content
Back to search

keypeek

MarketplaceWorks with Claude CodeGitHub

See which secrets your AI coding agents can read. Read-only, local, no network.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/evalogical-inc--keypeek/badge.svg)](/listings/evalogical-inc--keypeek)

HTML

<a href="/listings/evalogical-inc--keypeek"><img src="/api/listings/evalogical-inc--keypeek/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

npx @evalogical/keypeek

Or install it once and run `keypeek`:

npm install -g @evalogical/keypeek
keypeek

Needs Node 20 or newer. macOS and Linux. A Homebrew install is [planned](https://github.com/Evalogical-Inc/keypeek/issues/8).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 11 lines
  1. {
  2. "name": "keypeek",
  3. "owner": { "name": "Evalogical" },
  4. "plugins": [
  5. {
  6. "name": "keypeek",
  7. "source": "./",
  8. "description": "Read-only audit of which secrets your AI coding agents can read."
  9. }
  10. ]
  11. }
README.md · README · 249 lines
  1. <p align="center"><img src="https://raw.githubusercontent.com/Evalogical-Inc/keypeek/main/docs/keypeek-banner.svg?v=4" alt="keypeek: see which secrets your AI coding agents can read" width="900"></p>
  2. <!-- mcp-name: io.github.Evalogical-Inc/keypeek -->
  3. # keypeek
  4. **See which secrets your AI coding agents can read.** One command, a few seconds, nothing changed, nothing shown.
  5. **Website:** [keypeek.vercel.app](https://keypeek.vercel.app)
  6. [![website](https://img.shields.io/badge/website-keypeek.vercel.app-f4ac24)](https://keypeek.vercel.app)
  7. [![ci](https://github.com/Evalogical-Inc/keypeek/actions/workflows/ci.yml/badge.svg)](https://github.com/Evalogical-Inc/keypeek/actions/workflows/ci.yml)
  8. [![npm](https://img.shields.io/npm/v/@evalogical/keypeek)](https://www.npmjs.com/package/@evalogical/keypeek)
  9. [![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
  10. ![node >=20](https://img.shields.io/badge/node-%3E%3D20-brightgreen)
  11. ![runtime dependencies: 0](https://img.shields.io/badge/runtime%20dependencies-0-brightgreen)
  12. ```
  13. npx @evalogical/keypeek
  14. ```
  15. <p align="center"><img src="https://raw.githubusercontent.com/Evalogical-Inc/keypeek/main/docs/keypeek-demo.gif" alt="keypeek scanning a demo home folder with fake keys: score 40 out of 100, grade D" width="800"></p>
  16. ## Why keypeek exists
  17. You hand an AI coding agent your project. It reads your files, runs your commands, and keeps a full transcript of everything it saw. Most developers never check what that adds up to.
  18. Keys end up in places you do not think about: old `.env` files, shell history, and pasted into agent chats. Nobody did anything wrong. It is what a normal week of building with AI looks like.
  19. Secret scanners look at git history. Secrets managers keep new secrets out of reach. Neither answers the question you actually have today: *what can my AI agents see on this machine right now?*
  20. keypeek answers that in a few seconds, without changing anything, and without ever showing you a secret.
  21. - **Read-only.** It never writes, moves or deletes anything.
  22. - **Local.** No network, no telemetry, zero runtime dependencies.
  23. - **Safe to run.** It never prints a secret: only a 4-character prefix, the length, and a hash fingerprint.
  24. ## Quick start
  25. ```
  26. npx @evalogical/keypeek
  27. ```
  28. Or install it once and run `keypeek`:
  29. ```
  30. npm install -g @evalogical/keypeek
  31. keypeek
  32. ```
  33. Needs Node 20 or newer. macOS and Linux. A Homebrew install is [planned](https://github.com/Evalogical-Inc/keypeek/issues/8).
  34. ## Example
  35. Output from a throwaway demo home folder with fake keys (in a real terminal it is colored):
  36. ```
  37. keypeek what your AI agents can see. Read-only, nothing leaves this machine.
  38. Score ██████████░░░░░░░░░░ 50/100 grade D
  39. 5 findings: 2 high · 3 medium · 0 low
  40. Agent transcripts (1) already in a model's context, rotate these
  41. SEV TYPE VALUE SEEN LOCATION
  42. high Anthropic sk-a…(39) x3 ~/.claude/projects/app/session.jsonl:1
  43. Shell history (1) any agent with shell access can read it
  44. SEV TYPE VALUE SEEN LOCATION
  45. high AWS AKIA…(20) x1 ~/.zsh_history:1
  46. .env files (3) agents read these by default
  47. SEV TYPE VALUE SEEN LOCATION
  48. medium JWT_SECRET Xk9m…(20) x1 ~/work/blog/.env:1
  49. medium OpenAI sk-a…(37) x1 ~/work/shop-api/.env:1
  50. medium Stripe sk_l…(40) x1 ~/work/shop-api/.env:2
  51. Agent config
  52. ? Claude Code settings: No settings.json found; Claude Code defaults apply.
  53. Next steps
  54. 1. Rotate anything under transcripts or shell history first. It has already been exposed.
  55. 2. Move secrets out of project .env files into a secrets manager or the OS keychain.
  56. 3. Add a deny rule for .env in your agent's settings, then run keypeek again.
  57. Values are never printed: only a 4-char prefix, the length and a hash fingerprint (#hash in --json).
  58. ```
  59. Each row reads: severity, type (provider or rule), redacted value `prefix…(length)`, how many times it appeared (`x3`), and where. Long lists show the top rows per section; use `--all` for everything. `--json` also includes a hash fingerprint per finding so you can track a key without seeing it.
  60. ## How it works
  61. 1. **Find.** It looks in the places agents look: transcripts, shell history, `.env` files and the environment of your shell.
  62. 2. **Match.** Known key formats plus a conservative rule for `NAME=value` pairs with high-entropy values.
  63. 3. **Rank.** A key already in a transcript counts for more than a key in an unused `.env`. The score is capped per surface so one noisy folder cannot hide progress elsewhere.
  64. 4. **Redact.** Only a 4-character prefix, the length and a hash fingerprint leave the scanner. The full value is never stored in a result.
  65. ## What it checks
  66. | Surface | Where | Severity | Why it matters |
  67. |---|---|---|---|
  68. | transcript | `~/.claude`, `~/.codex`, `~/.gemini`, `~/.cursor` | high | The key was already in a model's context. Rotate it. |
  69. | history | `~/.zsh_history`, `~/.bash_history`, fish history | high | Any agent with shell access can read these files. |
  70. | envfile | `.env*` files under your home (or `--path`) | medium | Agents read these by default. Templates (`.env.example`) are skipped. |
  71. | procenv | environment variables of the shell that runs keypeek | low | Inherited by every subprocess an agent starts. |
  72. | config | Claude Code `settings.json` | | Is `.env` denied? Is subprocess env scrubbing set? |
  73. Detected formats: Anthropic, OpenAI, GitHub, AWS access keys, Stripe, Google API keys, Slack, Hugging Face, JWTs, private-key headers, plus the generic rule for names containing KEY, TOKEN, SECRET or PASSWORD.
  74. The score starts at 100 and loses points per finding. Grades: A 90+, B 75+, C 55+, D 35+, F below.
  75. ## Usage
  76. ```
  77. keypeek [options]
  78. --path <dir> directory to scan for .env files (repeatable, default: home)
  79. --no-history skip shell history files
  80. --all show every finding (default: top rows per section)
  81. --json machine-readable output
  82. --fail-on <level> exit 1 if a finding at this severity or above exists (low|medium|high)
  83. -v, --version
  84. -h, --help
  85. ```
  86. Exit codes: `0` ok, `1` a finding met `--fail-on`, `2` usage error or crash.
  87. ```
  88. keypeek --path ~/work --no-history # just your projects
  89. keypeek --json | jq '.findings[] | select(.severity=="high")'
  90. keypeek --fail-on high # use as a pre-flight check or in CI
  91. ```
  92. `--json` returns `{ findings, checks, skipped, score, grade }`. Each finding has `provider`, `surface`, `severity`, `file`, `line`, `preview`, `fp` and `count`. There is no field that holds a full secret.
  93. ## Use it from Claude Code
  94. keypeek ships a Claude Code plugin: a skill that runs the audit when you ask whether your keys are exposed, and a `/keypeek:audit` command.
  95. ```
  96. /plugin marketplace add Evalogical-Inc/keypeek
  97. /plugin install keypeek@keypeek
  98. ```
  99. It runs the same read-only CLI through `npx`, tells Claude not to open flagged files, and never changes anything without asking. Note that the report lists where your secrets live (paths and 4-character previews, never values), so it enters the chat; run it when you want the audit, not on every session.
  100. ## Use it from other AI agents
  101. For Codex, Cursor, Gemini CLI and any MCP client, `keypeek mcp` runs a read-only MCP server with one tool. By default it returns only the score and counts per surface; file paths only when asked, and never values or previews (needs keypeek 0.2.0 or later). For Codex, add this to `~/.codex/config.toml`:
  102. ```toml
  103. [mcp_servers.keypeek]
  104. command = "npx"
  105. args = ["-y", "@evalogical/keypeek", "mcp"]
  106. ```
  107. Agents without MCP can use an `AGENTS.md` snippet. Copy-paste setup for each is in [docs/agents.md](docs/agents.md).
  108. ## Use it in CI
  109. A GitHub Action fails the job when a checkout contains a `.env` file with a real key. A CI runner has no agent transcripts or shell history, so it checks files only, and it ignores the job's own environment so it never flags the runner's secrets.
  110. ```yaml
  111. - uses: actions/checkout@v4
  112. - uses: Evalogical-Inc/keypeek@v1
  113. with:
  114. path: . # directory to scan (default: .)
  115. fail-on: medium # low, medium or high (default: medium; a key in a .env file is medium)
  116. ```
  117. Use a Linux or macOS runner with Node 20 or later (GitHub's hosted runners have it). The report prints the 4-character preview and the file path into the job log, so keep that in mind for public repositories. Pin `version:` if you want a specific keypeek release.
  118. ## If keypeek finds something
  119. 1. **Rotate it first.** Anything in a transcript or history has already been in a model's context or on disk in plaintext. Treat it as exposed.
  120. 2. Move secrets out of project `.env` files and out of shell history: use a secrets manager or your OS keychain, and inject them at run time (for example `op run -- <command>` with 1Password, or the Doppler and Infisical CLIs).
  121. 3. Add a deny rule so your agent's file tools skip `.env`. In Claude Code `settings.json`:
  122. ```json
  123. { "permissions": { "deny": ["Read(./.env)", "Read(./.env.*)"] } }
  124. ```
  125. A deny rule is not a full barrier: shell commands can still read the file. Keep real secrets out of the project folder where you can.
  126. 4. Clear old transcripts you no longer need, and run keypeek again to confirm.
  127. Check your agent's current docs for exact permission syntax, and for subprocess environment scrubbing options (third-party posts mention a `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` setting; keypeek reports whether it is set but has not verified its behavior).
  128. ## Trust: verify it yourself
  129. The tool is small on purpose (about 430 lines of TypeScript, zero runtime dependencies), so you can check the promises instead of taking our word for it.
  130. - **Read-only:** a test compares file modification times before and after a scan.
  131. - **No full secrets in output:** a test scans both the text and JSON output for the full value.
  132. - **No network, no writes, no spawned processes:** run this in a clone. It should print nothing.
  133. ```
  134. grep -rE "node:(http|https|http2|net|tls|dns|dgram|child_process)|fetch\(|writeFile|appendFile|createWriteStream" src
  135. ```
  136. - Symlinks are not followed, so a scan cannot wander outside the folders it was given.
  137. - Unreadable files are skipped silently; files over 50MB are skipped and listed.
  138. Found a way it breaks these promises? See the [security policy](SECURITY.md).
  139. ## Who it's for
  140. - **Vibe coders and solo builders** who let Claude Code, Cursor or Codex run in their projects and want to know what those tools can reach.
  141. - **Developers with a messy home folder:** old `.env` files, keys pasted into shell history, keys pasted into chats.
  142. - **Small teams and agencies** that want a quick check before handing a laptop or repo to an AI agent.
  143. ## How it differs from other tools
  144. - **gitleaks, trufflehog, GitGuardian** find secrets in repositories and can be pointed at any folder. They do not know where AI agents keep transcripts, do not rank by how exposed a secret is to an agent, and do not check agent settings. keypeek is narrower on purpose.
  145. - **Secrets managers and proxies** (1Password CLI, Doppler, Infisical, OneCLI) prevent the problem by keeping secrets out of the agent's reach. keypeek tells you whether you have the problem today. They work well together: audit, fix, audit again.
  146. ## FAQ
  147. **Does it send my data anywhere?** No. There is no network code in the package, and no telemetry.
  148. **Can it change or delete my files?** No. It only reads. A test checks that file modification times are unchanged after a scan.
  149. **Will it show me my secrets?** No. It prints a 4-character prefix and the length, never the full value.
  150. **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.
  151. **Is it a replacement for gitleaks or a secrets manager?** No. Use those to prevent and catch leaks. keypeek checks what your AI agents can reach on this machine.
  152. **Does it work on Windows?** Not tested yet. See the [roadmap](ROADMAP.md).
  153. ## Known limits
  154. - Pattern-based. Expect some misses (new key formats) and a few false positives (high-entropy values that are not secrets). Help us with [more key formats](https://github.com/Evalogical-Inc/keypeek/issues/14).
  155. - Transcripts are scanned as plain text lines because agent file formats change between versions. Cursor's SQLite chat store is not scanned.
  156. - `.env` files inside dot-directories are not scanned.
  157. - The config checks report whether a setting exists, not whether it fully protects you.
  158. - macOS and Linux. Windows is untested.
  159. ## Roadmap
  160. Ideas live as [GitHub issues](https://github.com/Evalogical-Inc/keypeek/issues?q=is%3Aissue+label%3Aroadmap), summarized in [ROADMAP.md](ROADMAP.md): a landing page, a Claude Code plugin, a shareable grade badge, a GitHub Action, an opt-in fix mode, Windows support. Questions and ideas are welcome in [Discussions](https://github.com/Evalogical-Inc/keypeek/discussions).
  161. ## Contributing and docs
  162. - [Contributing](CONTRIBUTING.md) · [Runbook](docs/RUNBOOK.md) (add patterns, triage, release) · [Changelog](CHANGELOG.md) · [Security policy](SECURITY.md) · [Code of conduct](CODE_OF_CONDUCT.md)
  163. ```
  164. npm install
  165. npm test # compiles, then runs node:test
  166. node dist/src/cli.js
  167. ```
  168. ## License
  169. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.