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
This commit is contained in:
jif authored and copyberry committed 2026-08-20 07:03:02 +00:00
1 parent 9ca99b5171
commit 942af8447b
43 files changed
+218 -1380

No files matched your search

+11 -2
View File
@@ -8,6 +8,7 @@ use codex_code_mode::WebSocketCodeModeSessionProvider;
use codex_config::LoaderOverrides;
use codex_config::NoopThreadConfigLoader;
use codex_core::config::Config;
use codex_core::config::UnsupportedUntrustedApprovalPolicyError;
use codex_core::resolve_installation_id;
use codex_login::AuthManager;
#[cfg(debug_assertions)]
@@ -504,11 +505,19 @@ pub async fn run_main_with_transport_options(
config.http_client_factory(),
);
}
Err(err)
if err.get_ref().is_some_and(
<dyn std::error::Error + Send + Sync + 'static>::is::<
UnsupportedUntrustedApprovalPolicyError,
>,
) =>
{
return Err(err);
}
Err(err) => {
warn!(error = %err, "Failed to preload config for cloud config bundle");
// TODO: Decide whether bootstrap config preload failures should block startup.
// If this fails, we cannot install cloud/thread config loaders, so non-strict
// startup may continue without managed cloud config.
// startup continues without managed cloud config.
}
};
let mut config_warnings = Vec::new();