Skip to content
IsoKron

Metadata does not seek secrets or local files

Tool metadata must not seek secrets or protected context: text that names SSH keys, .env files, cloud credential files or MCP client configuration, or asks the model to send credentials or conversation content somewhere, is blocked.

Check sec-secret-seeking · Poisoning and hidden text · default severity: blocking · rubric 2.1.0

What fails

The text names SSH keys, .env files, cloud credential files, MCP client configuration, or asks the model to send credentials or conversation content somewhere.

The rule

Plugin and tool metadata must not seek secrets or protected context, direct unauthorized data transfers or actions, override platform instructions or safeguards, conceal behavior, or impersonate another party.

Source: OpenAI plugin guidelines, section 3.3

How to fix it

Remove the wording. A tool should never ask the model for secrets it holds or can reach.

  1. Remove any mention of key files, credential files or client config from metadata.
  2. If a tool legitimately reads files, describe its scope ("files in the workspace folder") without naming secret locations.
  3. Add a CI test for the paths you never want to see.

A CI test that fails when the pattern comes back, run against the saved tools/list answer:

TypeScript (node:test)

TypeScript test
// tools-list.test.mjs: run `node --test` after saving the answer with
// npx @modelcontextprotocol/inspector --cli <server> --method tools/list > tools.json
import assert from 'node:assert/strict';
import { readFileSync } from 'node:fs';
import { test } from 'node:test';

const answer = JSON.parse(readFileSync('tools.json', 'utf8'));
const tools = answer.tools ?? answer.result?.tools ?? answer;

// Every string and every key in a tool, with its path.
function* strings(value, path) {
  if (typeof value === 'string') yield [path, value];
  else if (value && typeof value === 'object')
    for (const [k, v] of Object.entries(value)) {
      yield [`${path}.${k} (key)`, k];
      yield* strings(v, `${path}.${k}`);
    }
}

const PATTERN = /\.ssh\/|id_rsa|id_ed25519|\.env\b|\.aws\/credentials|mcp\.json|claude_desktop_config/i;

test('metadata does not point at secrets', () => {
  const hits = [];
  for (const tool of tools) for (const [path, text] of strings(tool, tool.name)) if (PATTERN.test(text)) hits.push(path);
  assert.deepEqual(hits, [], 'tool metadata names secret files or client configuration');
});

Python (pytest)

Python test
# test_tools_list.py: run `pytest` after saving the answer with
# npx @modelcontextprotocol/inspector --cli <server> --method tools/list > tools.json
import json
import re

with open("tools.json", encoding="utf-8") as f:
    answer = json.load(f)
tools = answer.get("tools") or answer.get("result", {}).get("tools") if isinstance(answer, dict) else answer


def strings(value, path):
    """Every string and every key in a tool, with its path."""
    if isinstance(value, str):
        yield path, value
    elif isinstance(value, dict):
        for k, v in value.items():
            yield f"{path}.{k} (key)", k
            yield from strings(v, f"{path}.{k}")
    elif isinstance(value, list):
        for i, v in enumerate(value):
            yield from strings(v, f"{path}.{i}")


PATTERN = re.compile(r"(?i)\.ssh/|id_rsa|id_ed25519|\.env\b|\.aws/credentials|mcp\.json|claude_desktop_config")


def test_metadata_does_not_point_at_secrets():
    hits = [path for tool in tools for path, text in strings(tool, tool["name"]) if PATTERN.search(text)]
    assert hits == [], "tool metadata names secret files or client configuration"

Questions

Why would a model follow such text?

It reads tool descriptions as trusted context. Published attacks got models to read private keys and pass them as tool arguments.

Our tool manages .env files. Is it flagged?

Possibly. Describe it by purpose and scope; if it really edits environment files, expect reviewers to ask about it.

How this check is graded

It counts toward: Poisoning and hidden text, Anthropic connector directory, OpenAI plugin directory. See the rubric.

Last verified against OpenAI plugin guidelines, section 3.3 on 2026-11-18. The rule above is quoted in the source’s own words. This page as Markdown.

Check your tool list: paste your tools/list, nothing is sent anywhere