Tool metadata pointing at ~/.ssh, .env or MCP config files, or asking for secrets
Descriptions that point the model at credential files or tell it to collect API keys and tokens are a credential-theft pattern and fail review.
Remove references to credential files and any instruction to collect secrets from tool names, descriptions and parameter text. The rule security.credential-file-reference is a major finding for Claude and ChatGPT.
What you see
- A scan reports
Reference to <kind>for one of: SSH key paths andid_rsa-style names, cloud credential files (.aws/credentials,.kube/config,.docker/config.jsonand similar), credential stores (.netrc,.npmrc,.pgpass, browser cookie databases, shell history), system password files (/etc/passwd,/etc/shadow), MCP or agent config files (mcp.json,claude_desktop_config, and the config directories of other coding agents such as Grok Build, formerly Cursor), and.envfiles. - Or
Instruction to collect secrets, when a verb such as read, collect, send or include is aimed at the user's API keys, tokens or passwords. - Weaker path matches count only when an action word appears before them.
Why it happens
The pattern comes from tool-poisoning demonstrations the rule cites (Invariant Labs, Snyk Agent Scan, Apify): the description tells the model to read a private file and pass it in a hidden parameter. The research pages were not re-fetched for this page.
A legitimate server can trip the rule by accident, for example a local helper that documents "reads credentials from ~/.aws/credentials". Remote connectors rarely need to mention these paths, and Claude's directory policy 2.G bars hidden or obfuscated instructions while OpenAI's plugin guidelines 4.2(b) bar collecting access credentials and authentication secrets.
Check it yourself
curl -s -X POST https://mcp.acme.example/mcp \
-H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' \
-H "Authorization: Bearer $TOKEN" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' \
| jq -r '.result.tools[] | "\(.name) \(.description) \(.inputSchema|tostring)"' | grep -Ei '\.ssh|id_rsa|\.env|\.aws|\.netrc|mcp\.json|/etc/passwd|api key|password'
Fix
- Delete the path or instruction.
- If the tool needs a key, take it through OAuth or an
Authorizationheader, not through the model (schema.secret-param,auth.credential-in-url). - If the tool is documentation that names a file for the user's own setup, move it to your docs.
Verify
The grep prints nothing relevant, and the re-scan passes. Related: errors.secrets-in-output.
Which clients care
Claude and ChatGPT, per the rule.
Source
Invariant Labs, tool poisoning: https://invariantlabs.ai/blog/mcp-security-notification-tool-poisoning-attacks
Claude directory policy: https://support.claude.com/en/articles/13145358-anthropic-software-directory-policy
Run a free scan at https://mcpshipyard.com/scan to check every rule at once.
Check every rule at once
A free scan runs this check and the other 152 against your live URL.
Related fixes
- Hidden or invisible instructions in MCP tool metadata (zero-width characters, HTML comments, encoded blobs)
- MCP metadata that overrides the model's instructions or claims priority over other tools
- MCP metadata that tells the model to hide things from the user (secrecy instructions)
- MCP metadata that tells the model to send data to a URL or email address