9 Commits

Author SHA1 Message Date
jif
942af8447b Retire the untrusted approval policy (#39630)
## What changed

- Remove `untrusted` from the CLI, configuration schema, and MCP tool interface. Explicit `approval_policy = "untrusted"` settings now fail with an actionable error.
- Remove the known-safe command allowlist. Projects marked untrusted now request approval for every command unless an explicit exec policy rule allows it.
- Keep command parsing conservative by treating in-place `sed` forms as mutating and ignoring unrecognized commands when recording memory usage.

## Testing

- Cover rejection of the retired configuration value and approval requests for commands in untrusted projects.

GitOrigin-RevId: d6bf425edddfffbb325eee6acf383434af5fd33b
2026-08-20 07:03:02 +00:00
rhan-oai
8d637ae398 Remove unused apply_patch prompt fallback (#38291)
## What changed

- Delete the unused standalone `apply_patch` instruction template and its
  `codex-prompts` export.
- Simplify prompt-caching coverage to assert that requests use the model's base
  instructions.

GitOrigin-RevId: 8c0dc9426d9ac0184d587272622db608a75e8436
2026-08-13 01:52:02 +00:00
rhan-oai
06782eded7 Fix network access rendering in sandbox prompts (#34811)
## What changed

Use the supported `{{ network_access }}` placeholder syntax in the built-in
`danger-full-access`, `read-only`, and `workspace-write` sandbox templates so
permission instructions render the active network access state.

GitOrigin-RevId: 9f8d851016bd7fbedcfc4a9479236b46aca470e8
2026-07-22 19:14:11 +00:00
harinsrikanth-openai
81de4f251c Attribute review findings to repository rules (#34637)
## What changed

- Apply root and scoped project instructions using the established precedence for `AGENTS.override.md`, `AGENTS.md`, and configured fallback files.
- Treat findings as rule-supported only when repository guidance adds material, repository-specific context beyond generic correctness advice.
- Deduplicate findings without losing their supporting rules, and cite the applicable instruction file and smallest relevant line range in each rule-supported finding.
- Continue reporting ordinary findings independently of whether repository rules apply.

GitOrigin-RevId: 64b26555d92c0baa7e8e005130a7fb032b91d170
2026-07-21 23:17:20 +00:00
Dylan Hurd
ccdfb4f342 Revert "Make auto-review on-request prompt more proactive" (#30508)
Reverts openai/codex#26496
2026-06-28 20:40:55 -07:00
Dylan Hurd
2cf2a6a844 chore(core) rm AskForApproval::OnFailure (#28418)
## Summary
Deletes the OnFailure variant of the `AskForApproval` enum. This option
has been deprecated since #11631.

## Testing
- [x] Tests pass
2026-06-23 12:13:54 -07:00
pakrym-oai
bb72e151e5 [codex] Remove child AGENTS.md prompt experiment (#28993)
## Why

`child_agents_md` is a disabled, under-development experiment that adds
a second model-visible explanation of hierarchical `AGENTS.md` behavior.
Keeping it leaves unused prompt, configuration, documentation, and test
surface.

## What changed

- remove the `ChildAgentsMd` feature and `child_agents_md` config schema
entry
- remove the hierarchical prompt asset, export, and instruction
injection
- remove feature-specific tests and documentation
- keep the generic unstable-feature warning coverage using
`apply_patch_streaming_events`

Normal project `AGENTS.md` discovery and composition are unchanged.

## Testing

- `just test -p codex-features`
- `just test -p codex-prompts`
- `just test -p codex-core agents_md`
- `just test -p codex-core unstable_features_warning`
2026-06-18 16:13:07 -07:00
maja-openai
d9dace8a59 Make auto-review on-request prompt more proactive (#26496)
## Why

`on-request` approval policy text is currently tuned for user-reviewed
approvals. For auto-reviewed productivity runs, likely sandbox blocks
should be escalated earlier so commands that need remote services,
authentication, or other out-of-sandbox access do not first fail or hang
inside the sandbox.

## What changed

- Adds a separate `on_request_auto_review.md` permissions prompt
selected for `AskForApproval::OnRequest` with
`ApprovalsReviewer::AutoReview`.
- Keeps the normal user-reviewed `on-request` wording unchanged.
- Makes the `When to request escalation` bullets more explicit about
likely sandbox blocks, network access, remote
auth/cluster/cloud/database access, out-of-sandbox environment access,
git operations that may write lock files, and short-timeout reruns after
likely sandbox-blocked attempts.
- Omits approved command prefix and `prefix_rule` guidance for the
auto-review on-request prompt.
- Adds prompt tests covering the auto-review path, normal on-request
wording, and inline permission request behavior.
2026-06-18 13:16:14 -07:00
Adam Perry @ OpenAI
ba2b67f9cd [codex] Consolidate shared prompts in codex-prompts (#25151)
## Why

`codex_core` is consistently a bottleneck for incremental builds during
iteration. The simplest fix is to make the crate smaller.

## Summary

`codex-core` owns several reusable prompt renderers and static prompt
assets, which makes the crate harder to split apart.

Rename `codex-review-prompts` to `codex-prompts` and move shared review,
goal, permissions, compaction, realtime, hierarchical AGENTS.md, and
`apply_patch` prompts into it. Move prompt-only tests and update
consumers and `CODEOWNERS`.

## Validation

- `just test -p codex-prompts -p codex-apply-patch`
- `just test -p codex-core prompt_caching`
- Bazel builds for the affected crates
2026-06-01 18:45:07 +00:00