Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Secret Leak Guard: Stop Claude Code Printing Your API Keys

    1

    A secret does not leak because an agent is careless.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Secret Leak Guard: Stop Claude Code Printing Your API Keys

    Secret Leak Guard: Stop Claude Code Printing Your API Keys

    Example session with this skill installed

    Install the Secret Leak Guard hook for this machine, then check whether bash -x deploy.sh and grep -l KEY .env would be allowed.

    • Read your context and instructions
    • Compiled the secret leak guard

    selftest: 94 of 94 passed. Hook added to ~/.claude/settings.json (matcher Bash|PowerShell|Read|Grep). bash -x deploy.sh -> DENY: shell tracing (sh -x / -v prints every line, sourced secrets included). grep -l KEY .env -> ALLOW.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    A secret does not leak because an agent is careless. It leaks because the agent is doing its job: debugging. It runs bash -x deploy.sh to see where the script fails, the script sources .env, and the trace prints every assignment. Four live keys in one command, now sitting in a transcript that is stored, synced and sometimes shared.

    A rule in CLAUDE.md saying "never trace scripts that load secrets" does not stop this. The agent is not reading the rule at the moment it decides to trace. A rule that lives in front of the tool cannot be skipped.

    This skill installs that rule as a Claude Code PreToolUse hook.

    An agent was asked why a scheduled job failed silently. It ran the job with bash -x. The job sourced an env file holding a payment provider's live secret key, a telephony auth token, an email API key and a chat bot token. All four were printed into the session in plain text, and all four had to be rotated the same day. The note warning against exactly this already existed. After the hook went in, the same mistake was refused before it ran, with a reason the agent could act on.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    A pattern guard, not a sandbox: a determined process can still read a file. It stops the common honest accident, an agent printing a secret while debugging. It cannot undo a leak that already happened (rotate the key). On real work it refused 6 of 7,454 safe commands (0.08%); each refusal names the safe alternative.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 9 days ago

    Software
    Python 3 (standard library only)Claude Code (PreToolUse hook)Git

    Permissions

    File Scopes

    ~/.claude/settings.json
    (you
    add
    the
    hook
    yourself)
    ~/.claude/secret-leak-guard.log
    (override
    log
    append
    only)

    No network calls. Reads the hook JSON on stdin and prints a deny decision. Writes only one log line when a human-approved override is used.

    Listed9 days ago

    What's inside

    Frequently Asked Questions

    A PreToolUse hook that refuses, before it runs, any command that would print a secret into the transcript (shell tracing, env dumps, reading .env files, docker inspect, echoing key variables), while the safe patterns still pass. 94-case selftest; 6 of 7,454 real commands refused.

    This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

    Connect your AI agent to Agensi through MCP, then ask it to use Secret Leak Guard: Stop Claude Code Printing Your API Keys on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

    New in Security