# Find Leaked API Keys in AI Agent Files

> Finds API keys, tokens and passwords your AI coding agents saved in plain text: MCP configs, "don't ask again" approvals, CLAUDE.md, memory, transcripts, .env. Values are never shown.

Find Leaked API Keys in AI Agent Files is a paid AI agent skill on Agensi by AGI Tools, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $12.99 (one-time purchase)
- Creator: [AGI Tools](https://www.agensi.io/creators/agi-tools)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.1
- Last updated: 2026-11-30
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/find-leaked-api-keys-in-ai-agent-files
- Tags: security, ai-agents, python, secrets, api-keys, claude-code, mcp

## About this skill

Your coding agents keep more secrets than you think. "Yes, and don't ask again" saves the whole command, password included. MCP configs hold API keys in plain text. Transcripts record every token that passed through a tool, and keys end up in CLAUDE.md, memory files and old config backups. This skill checks the files that Claude Code, Codex, Gemini CLI, Cursor, OpenCode, Grok Build, Hermes and OpenClaw keep in your project and home folder. It tells you the kind of secret, the file, the line and the exact setting (for example mcpServers.github.env.GITHUB_TOKEN), whether git tracks the file, which keys were copied between agents or out of an agent's own credential file, and which agents can still read your .env. Reports never contain the values: each one is checked before it is shown. Read-only and local: nothing is sent, run or tested.

## Requires

- Python 3.11+

## Known limitations

It checks the agent files listed in its reference, not all source code: pair it with a code secret scanner.
Not read: the system keychain, shell profiles, process environment, SQLite databases, compressed (.zst) transcripts, and git history beyond the current index.
Short or word-like passwords are missed on purpose to keep false alarms low; unknown key formats are found only through a secret-sounding name.
.gitignore matching is simplified; findings marked "inferred" are interpretations to review.
Values it did not recognise cannot be checked against the report; file and setting names are filtered instead.
Tested on Linux with Python 3.11, 3.12 and 3.13; Windows and macOS are not tested.
A clean report means nothing was found in the files read, not that no secret leaked.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Find Leaked API Keys in AI Agent Files skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Does it show my keys?

No. Reports name the kind of secret, the file, the line and the setting, never the value or any part of it. Each report is compared with every value found before it is shown and withheld if one would appear.

### Does it test or send the keys anywhere?

No. It makes no network requests, runs no command from your files and never tests a credential.

### Does it delete or fix anything?

No, it is read-only. Each finding says where to revoke the credential and how to clean the file.

### Which agents and files does it check?

Claude Code, Codex, Gemini CLI, Cursor, OpenCode, Grok Build, Hermes and OpenClaw: MCP configs, settings and saved approvals, instruction files, memory, transcripts, old config backups, logs and project .env files.

### How is it different from a secret scanner?

It knows where AI agents keep files and what copying between agents leaves behind. Use a code scanner for your application code; use this for the agents' own files.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
