New prompt results in error 400 "Instructions are not valid"

Resolved 💬 8 comments Opened Aug 13, 2025 by xangma Closed Aug 13, 2025
💡 Likely answer: A maintainer (dylan-hurd-oai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

latest build from main

Which model were you using?

gpt-5

What platform is your computer?

Darwin 24.5.0 arm64 arm

What steps can reproduce the bug?

Building from source and submitting a query.

What is the expected behavior?

The query returns.

What do you see instead?

400 Bad Request: {"detail":"Instructions are not valid"}

Additional information

Reverting the codex-rs/core/prompt.md file to the previous version solved this. I figured that out because of this comment.

View original on GitHub ↗

8 Comments

dylan-hurd-oai contributor · 11 months ago

Can you confirm that (1) you are not modifying the system prompt, e.g. by setting experiment_instructions_file in config.toml, and (2) still able to reproduce?

Mitch528 contributor · 11 months ago
Can you confirm that (1) you are not modifying the system prompt, e.g. by setting experiment_instructions_file in config.toml, and (2) still able to reproduce?

@dylan-hurd-oai

I can also reproduce this when installing latest codex from github:

cargo install --git https://github.com/openai/codex codex-cli
codex exec "hello"

results in:

[2025-08-13T18:34:38] User instructions:
hello
[2025-08-13T18:34:41] stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 1/5 in 199ms…
[2025-08-13T18:34:42] stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 2/5 in 410ms…
[2025-08-13T18:34:43] stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 3/5 in 750ms…
[2025-08-13T18:34:44] stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 4/5 in 1.649s…
[2025-08-13T18:34:46] stream error: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}; retrying 5/5 in 3.37s…
[2025-08-13T18:34:49] ERROR: unexpected status 400 Bad Request: {"detail":"Instructions are not valid"}

The prompt was also updated recently in https://github.com/openai/codex/commit/90d892f4fd5ffaf35b3dacabacdd260d76039581

--

And no, I'm not setting experiment_instructions_file at all in my config.toml.

dylan-hurd-oai contributor · 11 months ago

Latest version of the prompt on main should now be considered valid instructions - please give it another shot and let me know if you're still seeing issues.

Mitch528 contributor · 11 months ago
Latest version of the prompt on main should now be considered valid instructions - please give it another shot and let me know if you're still seeing issues.

@dylan-hurd-oai That worked until https://github.com/openai/codex/commit/30ee24521b79cdebc8bae084385550d86db7142a 😅

dylan-hurd-oai contributor · 11 months ago

okay _now_ both should be considered valid instructions. We'll add better CI for this case.

sluongng contributor · 10 months ago

I got this again today using codex built from HEAD (234c0a0469db222f05df08d00ae5032312f77427).
Switching back to latest release (0.29.0) fixed it.

vuyelwadr · 8 months ago

using OpenAI Codex (v0.59.0-alpha.15) got this too and no dont have experiment_instructions_file

etraut-openai contributor · 8 months ago

@vuyelwadr, this issue is closed. If you are seeing a problem with the latest version of codex, please open a new issue (or add to an open one).