spec-secrets

spec-secrets is a command for coding agents from Connorrmcd6/vibe-spec. It costs 57 tokens per session (889 once invoked), scanned A, original, MIT.

A local security check that looks for secret values exposed in environment files or a browser build, while showing the agent only variable names and redacted results.

In plain words
What is it for?
Use it to scan an existing build or run a broader audit before shipping a web app to a browser.
Why use it?
It helps find leaked API keys and other private configuration without putting their actual values into the agent's context.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the vibe-spec plugin — 1 skill, 9 commands shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/connorrmcd6/vibe-spec/spec-secrets
Clone the repo
git clone --depth 1 https://github.com/Connorrmcd6/vibe-spec

Or install vibe-spec, the plugin that ships this one along with the rest of its 1 skill, 9 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for spec-secrets

README.md
[![agentmods](https://agentmods.dev/badge/commands/connorrmcd6/vibe-spec/spec-secrets.svg)](https://agentmods.dev/commands/connorrmcd6/vibe-spec/spec-secrets)
Your own site
<a href="https://agentmods.dev/commands/connorrmcd6/vibe-spec/spec-secrets"><img src="https://agentmods.dev/badge/commands/connorrmcd6/vibe-spec/spec-secrets.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 889 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00057 $0.00889
Opus 5 $0.00028 $0.00445
Sonnet 5 $0.00011 $0.00178
Haiku 4.5 $0.00006 $0.00089

Measured 4d ago against content hash c164734ee611, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

spec-secrets scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/spec-secrets.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are running /spec-secrets: a secret-leak audit for the user's app.

The trust boundary (do not break it)

A local, auditable script — ${CLAUDE_PLUGIN_ROOT}/scripts/secret-audit.sh — is the only thing that ever touches secret values. It reads .env files and the built bundle, does deterministic exact-match string work locally, and prints a redacted report: variable names, verdicts, and file:line locations only. You see that report and nothing else.

Your tools are locked to that one script for a reason. You must never attempt to read a .env file, cat/grep env values, or otherwise pull secret values into your context — and you can't, because no Read or general Bash is permitted here. Secret-matching is deterministic string work; the script does it better than an LLM and without exposing anything. Your job is to run it and explain the findings.

What to do

  1. Run the audit script. Pick the invocation from the user's argument ($ARGUMENTS):
    • default (no arg): static checks + a bundle scan if a build already exists: ${CLAUDE_PLUGIN_ROOT}/scripts/secret-audit.sh
    • build: run pnpm build first, then the definitive browser-exposure scan: ${CLAUDE_PLUGIN_ROOT}/scripts/secret-audit.sh --build
    • To audit a subdirectory, pass --dir <path>.
  2. Read the redacted report from stdout. Each finding is a variable name + verdict (+ file:line on a confirmed leak). Never ask the user to paste a secret value.
  3. Explain and fix. This is where you add value — turn each finding into a cause and a concrete fix:
    • 🚨 mis-prefixed (NEXT_PUBLIC_* that's secret-shaped): the NEXT_PUBLIC_ prefix ships it to every browser. Rename to drop the prefix and read it only in server code; if it's genuinely public, add the name to .spec-secrets-allow.
    • 🚨 client-code reference: a server-only var read inside a "use client" component is inlined into the bundle. Move the read to a Server Component, route handler, or server action and pass down only non-sensitive data.
    • 🚨 hardcoded literal: a secret-shaped string sits in source — move it to .env (server-only) and rotate it, since it's in git history.
    • 🚨 bundle leak: the value is confirmed in .next/static. Point at the file:line, trace why it's reachable from client code, and fix the import path.
    • ⚠ hygiene: .env not gitignored, or present in git history — fix .gitignore and, if it was ever committed, rotate the secrets.
  4. If everything is clean, say so plainly and note whether the definitive bundle scan ran (it only runs with a build) — suggest /spec-secrets build if it didn't.

Read the full file on GitHub · 58 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 58 lines · 57 tokens per session scan A c164734ee611

Subscribe to this mod's changes

spec-secrets is a command published in the GitHub repository Connorrmcd6/vibe-spec (9 stars, last pushed 1mo ago), licensed MIT. It adds 57 tokens to every session and 889 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.