# No HTML comments in metadata

**An HTML comment (<!-- ... -->) is hidden wherever a description is rendered as HTML or Markdown, but the model reads it, so it can carry instructions no reviewer sees; both directories reject hidden instructions.**

Check `sec-html-comment` · Poisoning and hidden text · default severity: blocking · rubric 2.1.0. Last verified against Anthropic connector pre-submission checklist on 2026-11-18.

## What fails

An HTML comment is hidden wherever the description is rendered as HTML or Markdown, but the model reads it.

## The rule

> Contain hidden, obfuscated, or encoded instructions

Source: [Anthropic connector pre-submission checklist](https://claude.com/docs/connectors/building/review-criteria#avoid-prompt-injection-patterns)

## How to fix it

Remove the comment. Anything the model should know belongs in visible text.

1. Remove every <!-- ... --> from names, titles, descriptions and schemas.
2. Put anything the model should know in visible text.
3. Add a CI test.

A CI test that fails when the pattern comes back:

### TypeScript (node:test)

```js
// 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 = /<!--/;

test('no HTML comments', () => {
  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, [], 'HTML comments hide text from reviewers');
});
```

### Python (pytest)

```python
# 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"<!--")


def test_no_html_comments():
    hits = [path for tool in tools for path, text in strings(tool, tool["name"]) if PATTERN.search(text)]
    assert hits == [], "HTML comments hide text from reviewers"
```

## Questions

### Our descriptions are generated from Markdown docs with comments. Is that a problem?

Yes for the tool list: strip comments when you generate the descriptions. The model receives the raw text either way.

### Is any HTML allowed?

Plain text is safest. Tags that look like prompt markup (<IMPORTANT>, <system>) are a separate blocking check.

## Related checks

- [No prompt markup such as <IMPORTANT> or <system>](https://isokron.ai/mcp-check/checks/sec-instruction-markup)
- [No wording that overrides instructions or hides actions from the user](https://isokron.ai/mcp-check/checks/sec-instruction-phrases)
- [No encoded text blocks in metadata](https://isokron.ai/mcp-check/checks/sec-encoded-blob)
- [Tool poisoning and hidden text](https://isokron.ai/mcp-check/checks/security)

Counts toward: Poisoning and hidden text, Anthropic connector directory, OpenAI plugin directory.

Rubric: https://isokron.ai/mcp-check/rubric

Check your tool list: https://isokron.ai/mcp-check
