[codex] allow disabling prompt instruction blocks (#16735)

This PR adds root and profile config switches to omit the generated
`<permissions instructions>` and `<apps_instructions>` prompt blocks
while keeping both enabled by default, and it gates both the initial
developer-context injection and later permissions diff injection so
turning the permissions block off stays effective across turn-context
overrides.

Also added a prompt debug tool that can be used as `codex debug
prompt-input "hello"` and dumps the constructed items list.
This commit is contained in:
Thibault Sottiaux
2026-04-03 13:47:56 -10:00
committed by GitHub
Unverified
parent f263607c60
commit 8d19646861
11 changed files with 531 additions and 120 deletions
@@ -33,6 +33,10 @@ fn build_permissions_update_item(
next: &TurnContext,
exec_policy: &Policy,
) -> Option<DeveloperInstructions> {
if !next.config.include_permissions_instructions {
return None;
}
let prev = previous?;
if prev.sandbox_policy == *next.sandbox_policy.get()
&& prev.approval_policy == next.approval_policy.value()