infisical-scan

infisical-scan is a command for Claude Code from smicolon/ai-kit. It costs 16 tokens per session (886 once invoked), scanned A, original, MIT.

A codebase scanner for finding exposed secrets such as API keys, tokens, private keys, and database connection strings. It can check current files, staged files, or Git history.

In plain words
What is it for?
Use it for directory scans, pre-commit checks on staged files, and searches through Git commit history.
Why use it?
It helps catch credentials before they are committed or shipped, including secrets that may remain in older commits.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Good fit Use it for directory scans, pre-commit checks on staged files, and searches through Git commit history.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/smicolon/ai-kit/infisical-scan
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.

Clone the repo
git clone --depth 1 https://github.com/smicolon/ai-kit

Made for: Claude Code.

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 infisical-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/smicolon/ai-kit/infisical-scan/github.svg)](https://agentmods.dev/commands/smicolon/ai-kit/infisical-scan)
Your own site
<a href="https://agentmods.dev/commands/smicolon/ai-kit/infisical-scan"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/infisical-scan/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for infisical-scan

Your own site · 80×15
<a href="https://agentmods.dev/commands/smicolon/ai-kit/infisical-scan"><img src="https://agentmods.dev/badge/commands/smicolon/ai-kit/infisical-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 886 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00016 $0.00886
Opus 5 $0.00008 $0.00443
Sonnet 5 $0.00003 $0.00177
Haiku 4.5 $0.00002 $0.00089

Measured 6d ago against content hash d2a00abc75b3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

infisical-scan 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 6d 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.

packs/infisical/commands/infisical-scan.md · 143 lines

How it starts

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

Infisical Scan Command

Scan the codebase for exposed secrets, API keys, and hardcoded credentials.

Parse Arguments

Extract from user input:

  • mode: directory (default), git-history, or staged

Workflow

Step 1: Check CLI Available

which infisical && infisical --version

Step 2: Choose Scan Mode

Ask the user which scan to run:

  1. Directory Scan - Scan all files in current directory
  2. Git History Scan - Scan git commit history for leaked secrets
  3. Staged Only - Scan only staged files (pre-commit check)

Step 3a: Directory Scan

# Scan current directory
infisical scan

# Scan specific path
infisical scan --path=./src

# Scan with verbose output
infisical scan -v

Step 3b: Git History Scan

# Scan all git history
infisical scan git-changes

# Scan recent changes only
infisical scan git-changes --staged

Step 3c: Staged Files Only

# Scan only staged files (ideal for pre-commit)
infisical scan git-changes --staged

Step 4: Analyze Results

Review scan output and categorize findings by severity:

  • Critical: AWS keys, database connection strings, private keys, tokens with write access
  • High: API keys, OAuth secrets, webhook secrets
  • Medium: Internal URLs, non-production credentials
  • Low: Example/placeholder values that look like secrets

Step 5: Remediate Findings

For each real secret found:

  1. Move to Infisical:

    infisical secrets set LEAKED_KEY=<actual-value> --env=dev
    
  2. Remove from code and replace with environment variable:

    # Before (hardcoded)
    api_key = "sk_live_abc123"
    
    # After (from environment)
    api_key = os.environ["API_KEY"]
    
  3. Rotate the credential - any secret found in git history should be considered compromised:

    • Regenerate the key/token in the provider's dashboard
    • Update the new value in Infisical
    • Revoke the old credential
  4. Verify cleanup:

    infisical scan
    

Read the full file on GitHub · 143 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. 6d ago First seen · 143 lines · 16 tokens per session scan A d2a00abc75b3

Subscribe to this mod's changes

infisical-scan is a command published in the GitHub repository smicolon/ai-kit (6 stars, last pushed 6d ago), licensed MIT. It adds 16 tokens to every session and 886 once invoked, about $0.0001 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-09-03.