pub enum AskForApproval {
Never,
OnRequest,
UnlessTrusted,
OnFailure,
Reject(RejectConfig),
}Expand description
Policy for when to ask for approval before executing commands.
Variants§
Never
Never ask for approval during autonomous execution.
OnRequest
Ask only when explicitly requested by policy.
UnlessTrusted
Ask unless the command is in the trusted list.
OnFailure
Ask only on failure (retry with approval).
Reject(RejectConfig)
Fine-grained rejection controls for approval prompts.
Implementations§
Source§impl AskForApproval
impl AskForApproval
Sourcepub fn requires_approval_for_unknown(&self) -> bool
pub fn requires_approval_for_unknown(&self) -> bool
Check if this policy requires asking for unknown commands.
Sourcepub const fn rejects_rule_prompt(self) -> bool
pub const fn rejects_rule_prompt(self) -> bool
Check whether rule-triggered approval prompts are rejected.
Sourcepub const fn rejects_sandbox_prompt(self) -> bool
pub const fn rejects_sandbox_prompt(self) -> bool
Check whether sandbox-related approval prompts are rejected.
Sourcepub const fn rejects_request_permission_prompt(self) -> bool
pub const fn rejects_request_permission_prompt(self) -> bool
Check whether built-in permission request prompts are rejected.
Sourcepub const fn rejects_mcp_elicitation(self) -> bool
pub const fn rejects_mcp_elicitation(self) -> bool
Check whether MCP elicitation prompts are rejected.
Trait Implementations§
Source§impl Clone for AskForApproval
impl Clone for AskForApproval
Source§fn clone(&self) -> AskForApproval
fn clone(&self) -> AskForApproval
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AskForApproval
Source§impl Debug for AskForApproval
impl Debug for AskForApproval
Source§impl Default for AskForApproval
impl Default for AskForApproval
Source§fn default() -> AskForApproval
fn default() -> AskForApproval
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AskForApproval
impl<'de> Deserialize<'de> for AskForApproval
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AskForApproval
Source§impl PartialEq for AskForApproval
impl PartialEq for AskForApproval
Source§impl Serialize for AskForApproval
impl Serialize for AskForApproval
impl StructuralPartialEq for AskForApproval
Auto Trait Implementations§
impl Freeze for AskForApproval
impl RefUnwindSafe for AskForApproval
impl Send for AskForApproval
impl Sync for AskForApproval
impl Unpin for AskForApproval
impl UnsafeUnpin for AskForApproval
impl UnwindSafe for AskForApproval
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.