Invalid prompt: your prompt was flagged as potentially violating our usage policy.
What version of Codex is running?
v0.63.0
What subscription do you have?
■ Error running remote compact task: unexpected status 400 Bad Request: { "error": { "message": "Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-prompting", "type": "invalid_request_error", "param": null, "code": "invalid_prompt" } }
Which model were you using?
gpt-5.1-codex-max
What platform is your computer?
WSL2
What issue are you seeing?
Got "■ Error running remote compact task: unexpected status 400 Bad Request: { "error": { "message": "Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-prompting", "type": "invalid_request_error", "param": null, "code": "invalid_prompt" } }"
btw my prompt: "Let's fix the bugs now, then we'll run the test. See how they work."
:/
What steps can reproduce the bug?
Uploaded thread: 019ab510-eee9-7f13-b25d-d88b3b162344
What is the expected behavior?
No response
Additional information
No response
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #6946
- #6935
Powered by Codex Action
Got the same error.
Prompt:
`CLAUDE.md PLAN.md
continue with the phase 3, encoder implementation, focusing on correctness and any obvious performance bottlenecks. but mostly just getting it working properly`
Got the same error.
Prompt:
`CLAUDE.md PLAN.md
continue with the phase 3, encoder implementation, focusing on correctness and any obvious performance bottlenecks. but mostly just getting it working properly`
same, it seems to happen only in extremely long thinking threads.
When asking codex for a review, a fresh subagent thread with only the following message:
› Review the git range 84a89b32c241af0e4143c1fb77d8474de2a45958..12b8c3f7f8925b231cda930024e17ac93b6f3f1c for server integration/ops surfaces. Focus files:
- server/src/routes/options.routes.ts
- server/src/routes/journal.routes.ts
- server/src/middleware/validation.ts
- server/src/config/index.ts
- server/src/jobs/pinPredictorReporter.ts
- server/src/jobs/topOiReporter.ts
- server/src/services/journal.service.ts
- server/.env.example
Task: produce findings-only code review, severity ordered, with exact file:line refs and risk explanation. Include test coverage gaps that are high impact.
• Ran pwd
└ [redacted]
• Searched
■ Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-
prompting
Was flagged as "potentially violating usage policy". Thread ID was 019c4f21-6f56-71e0-8d6a-1ca2a8c6441a.
To the best of my understanding nothing in the project it is working on related to cyber security in any way. The prompt was also written not by me but by codex itself, for a subagent.
"Your honor, you see, it wasn't me... it was my sub-agent.."
I'm seeing this error randomly in the middle of Codex working on its own, with no human input.
This basically trashes the entire turn, and moreover there is no way to report the mistaken flag.
Snippet:
[...]
I’ve now covered the main codecs and traversal paths. I’m doing a final pass on the wire primitives (fixed, varint, sink) and then I’ll validate any suspected edge case with a small repro test.
Explored 6 files
Background terminal finished with git diff --unified=80 master...claude/eloquent-moser -- lambda/buffer/mutable.hpp lambda/nullary/abi.hpp | sed -n '1,260p'
Explored 4 files, 1 search
Read test_io_envelope.cpp
Searched for TrailingBytes|trailing in io
Read fuzz.hpp
Read fuzz.cpp
Read test_io_fuzz.cpp
Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-prompting
I'm also seeing this error in the middle of Codex working independently against a goal. It's not doing anything marginal or interesting, just completing some basic coding and testing stories against my own codebase (which is has mainly created). I've now had this error 4 times out of nowhere. This is in the Windows App version 26.715.52143 Each time I type "resume" and it restarts.
Edit: Make that 5 times Edit: Make that 6 times... Edit: 7... 8... this is getting ridiculous. It's trying to run some tests and just keeps tripping itself up.
This latest version of the app 20/07/26 seems unstable - or maybe it's server-side. I'm not sure.
Happened to me as well in the middle of some random work that could in no way be related to anything forbidden whatsoever.
For today's (2026-08-20, ~16:11–17:05 UTC) wave of these errors on compacted threads: root cause was isolated and written up in https://github.com/openai/codex/issues/39687#issuecomment-5359231806 — the server-side input classifier was briefly flagging Codex's own compaction summary prefix (codex-rs/prompts/templates/compact/summary_prefix.md), so any thread that had auto-compacted failed until the classifier change was rolled back (~17:05 UTC). Minimal repro and bisect details in the linked comment.
Fresh minimal reproduction on GPT-6 Astra:
- Observed: 2026-09-05, Asia/Shanghai
- Codex CLI:
0.153.4 - Platform:
Darwin 25.3.0 arm64 arm - Model:
gpt-6-astra, reasoning effortxhigh - Previous model in the same session:
gpt-5.6-sol, reasoning effortxhigh - User prompt:
hi - Thread ID:
01a071f7-1cf3-7771-a8bf-6064a9bfe294
Immediately after switching to GPT-6 Astra, the harmless one-word prompt was rejected with:
Invalid prompt: your prompt was flagged as potentially violating our usage policy. Please try again with a different prompt: https://platform.openai.com/docs/guides/reasoning#advice-on-prompting
There was no cybersecurity or other safety-sensitive content in the user prompt. The session contained ordinary repository instructions for a Go logistics backend. This looks like a false positive involving the effective session context rather than the literal user message.
I also tried the built-in feedback/upload path twice, without sharing session logs. Both attempts failed because the connection to the Sentry feedback endpoint was closed, so I am adding the reproduction here.