pub enum ApprovalPolicy {
Never,
OnRequest,
Untrusted,
ModelRequested,
}Expand description
When the agent must seek approval before running a tool — the analog of
Codex’s -a untrusted|on-request|never and Claude’s permission modes.
Variants§
Never
Never ask — every tool call runs automatically (default).
OnRequest
Ask for tools not on the auto-approve allowlist.
Untrusted
Ask for every tool call.
ModelRequested
P5-1 (COMPOSABLE-HARNESS-DESIGN.md §3.2 S8, §4.3 cx-parity): Codex’s
-a on-request default — escalation is INITIATED BY THE MODEL, not
decided by a client-side allowlist check the way Self::OnRequest
is (Config::needs_approval’s OnRequest arm consults
Config::auto_approved_tools/tool_allow_patterns; Codex’s
on-request instead runs sandboxed writes/reads silently and only
asks when the MODEL itself requests to leave the sandbox —
protocol.rs:921-924). Using Self::OnRequest for cx-parity would
prompt on every non-allowlisted call, where stock Codex prompts
almost never — a materially different (over-prompting, but not
unsafe) posture, which is why configfile::parse_approval_str
previously fell back to Self::Untrusted rather than silently
picking the wrong existing variant (S8’s original fail-safe). This
variant now exists so cx-parity resolves to its INTENDED posture
instead of that fail-safe. Config::needs_approval (the coarse,
tool-name-only legacy gate — no model-escalation signal reaches it)
treats this conservatively, the same as Self::OnRequest; the P5-1
permissions engine (crate::permissions, the richer canonicalized-
command-aware gate crate::agent::Agent consults when
Config::permissions_enabled is on) treats it per Codex’s real
posture — see that gate’s doc comment.
Trait Implementations§
Source§impl Clone for ApprovalPolicy
impl Clone for ApprovalPolicy
Source§fn clone(&self) -> ApprovalPolicy
fn clone(&self) -> ApprovalPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ApprovalPolicy
Source§impl Debug for ApprovalPolicy
impl Debug for ApprovalPolicy
Source§impl Default for ApprovalPolicy
impl Default for ApprovalPolicy
Source§fn default() -> ApprovalPolicy
fn default() -> ApprovalPolicy
impl Eq for ApprovalPolicy
Source§impl PartialEq for ApprovalPolicy
impl PartialEq for ApprovalPolicy
impl StructuralPartialEq for ApprovalPolicy
Auto Trait Implementations§
impl Freeze for ApprovalPolicy
impl RefUnwindSafe for ApprovalPolicy
impl Send for ApprovalPolicy
impl Sync for ApprovalPolicy
impl Unpin for ApprovalPolicy
impl UnsafeUnpin for ApprovalPolicy
impl UnwindSafe for ApprovalPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.