API content filter blocks Contributor Covenant 2.1 verbatim output
Summary
Asking Claude Code (claude -p ... --dangerously-skip-permissions) to write the standard Contributor Covenant 2.1 Code of Conduct verbatim into a file produces an API-level content filter rejection:
API Error: {"type":"error","error":{"details":null,"type":"invalid_request_error","message":"Output blocked by content filtering policy"},"request_id":"req_011CagaoE66SnEFGtNCoi9ta"}
The session terminates with rc=1, mid-task, leaving prior completed work intact but blocking remaining tasks in the same session.
Why this is a problem
The Contributor Covenant 2.1 is the most widely-adopted open-source CoC (used by Linux kernel, GitHub, Kubernetes, GitLab, etc.). The whole point of a CoC document is that it MUST be reproduced verbatim — paraphrasing it defeats its purpose as a community standard. The text necessarily enumerates harassment categories (sexualized language, derogatory comments, etc.) — that enumeration is what makes it a useful CoC.
The output filter appears to be triggered by the enumeration itself, with no allowance for "this is a well-known canonical document being reproduced as text-in-a-file."
Repro
In any working dir, with claude CLI installed and --dangerously-skip-permissions enabled:
claude -p 'Write CODE_OF_CONDUCT.md containing the Contributor Covenant 2.1 verbatim. The canonical URL is https://www.contributor-covenant.org/version/2/1/code_of_conduct/' --dangerously-skip-permissions --max-turns 10
Result: API filter rejection, session exits.
Workaround
Have Claude download the file via shell instead of reproducing it as model output:
curl -fsSL https://www.contributor-covenant.org/version/2/1/code_of_conduct.md -o CODE_OF_CONDUCT.md
This works fine — the filter is on model output, not file content.
Suggested fix
Either:
- Allowlist canonical document reproduction. When the model is being asked to verbatim-reproduce a well-known canonical text (CCv2.1, MIT license, Apache-2.0, GPL, etc.), the output filter should not block. There's no plausible harm in reproducing a document that the user could
curlfrom a public URL. - Surface a clearer error in Claude Code. Today the user just sees
invalid_request_errorandrc=1— Claude Code could detect the content_filter classification and emit a helpful message: "This output was blocked by content filtering. If you're trying to reproduce a canonical document (e.g. a Code of Conduct), download it via curl/wget instead of generating it as model output."
(2) alone would have saved me a debugging cycle. (1) would Just Work.
Context
Hit while bootstrapping a multi-repo project where one repo's KICKOFF.md asked Claude to "Add CODE_OF_CONDUCT.md using the Contributor Covenant 2.1 standard text verbatim." Other tasks in the session (CONTRIBUTING.md generation, GitHub issue closing) all worked correctly before this one bricked the session.
Request ID: req_011CagaoE66SnEFGtNCoi9ta
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗