pub struct ConfirmationPolicy {
pub enabled: bool,
pub default_timeout_ms: u64,
pub timeout_action: TimeoutAction,
pub yolo_lanes: HashSet<SessionLane>,
}Expand description
Confirmation policy configuration
Controls the runtime behavior of HITL confirmation flow.
The decision of whether to ask is made by PermissionPolicy (permissions.rs).
This policy controls how the confirmation works: timeouts, YOLO lanes.
Fields§
§enabled: boolWhether HITL is enabled (default: false, all tools auto-approved)
default_timeout_ms: u64Default timeout in milliseconds (default: 30000 = 30s)
timeout_action: TimeoutActionAction to take on timeout (default: Reject)
yolo_lanes: HashSet<SessionLane>Lanes the host records as Allow on PermissionPolicy.
This set does not itself skip an Ask decision.
Implementations§
Source§impl ConfirmationPolicy
impl ConfirmationPolicy
Sourcepub fn with_yolo_lanes(
self,
lanes: impl IntoIterator<Item = SessionLane>,
) -> Self
pub fn with_yolo_lanes( self, lanes: impl IntoIterator<Item = SessionLane>, ) -> Self
Enable YOLO mode for specific lanes
Sourcepub fn with_timeout(self, timeout_ms: u64, action: TimeoutAction) -> Self
pub fn with_timeout(self, timeout_ms: u64, action: TimeoutAction) -> Self
Set timeout
Sourcepub fn is_yolo(&self, _tool_name: &str) -> bool
pub fn is_yolo(&self, _tool_name: &str) -> bool
YOLO lanes are Allow rules on PermissionPolicy. This does not skip Ask.
Sourcepub fn requires_confirmation(&self, _tool_name: &str) -> bool
pub fn requires_confirmation(&self, _tool_name: &str) -> bool
Whether the confirmation manager is enabled.
Lane auto-approval is not decided here. PermissionPolicy::check is the
only Allow, Deny, or Ask decision.
Trait Implementations§
Source§impl Clone for ConfirmationPolicy
impl Clone for ConfirmationPolicy
Source§impl Debug for ConfirmationPolicy
impl Debug for ConfirmationPolicy
Source§impl Default for ConfirmationPolicy
impl Default for ConfirmationPolicy
Source§impl<'de> Deserialize<'de> for ConfirmationPolicy
impl<'de> Deserialize<'de> for ConfirmationPolicy
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>,
Auto Trait Implementations§
impl Freeze for ConfirmationPolicy
impl RefUnwindSafe for ConfirmationPolicy
impl Send for ConfirmationPolicy
impl Sync for ConfirmationPolicy
impl Unpin for ConfirmationPolicy
impl UnsafeUnpin for ConfirmationPolicy
impl UnwindSafe for ConfirmationPolicy
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more