AAK-SECRET-001: Anthropic API key exposed
- Severity
- CRITICAL
- Category
- Secret Exposure (
secret-exposure) - Scanner
agent_audit_kit/scanners/secret_exposure.py- Auto-fixable
- No.
- SARIF name
AnthropicApiKeyExposed
What it detects
An Anthropic API key (sk-ant-*) was found in a project file. This allows full API access and billing abuse.
How to fix
Remove key, rotate immediately, use environment variables.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-SECRET-001
Limitations
Looks for sk-ant- followed by 20 or more key characters in files whose extension is on a fixed list (.json, .yml, .toml, .py, .ts, .sh and similar, plus .env files, Dockerfiles and Markdown). In Markdown, a key shaped like a documentation stand-in (one repeated character after the prefix, a run of x, or REPLACE, YOUR, EXAMPLE, PLACEHOLDER or CHANGEME in it) is skipped. A key in any other kind of file is not reported: one pasted into a Jupyter notebook (.ipynb) is missed, although the same content in a .json file is found. A file over 1,000,000 bytes is not read.
References
- OWASP MCP Top 10: MCP01:2025 (Token Mismanagement & Secret Exposure)
- OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-TOKEN-03 (Anthropic Key Exposure)
- CSA AI Controls Matrix (AICM): DSP-17
All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-SECRET-001.md: the page then shows that text, with the registry reference appended under it.