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>YOLO mode: lanes that auto-approve without confirmation.
When a lane is in this set, tools in that lane skip confirmation
even if PermissionPolicy returns Ask.
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
Check if a tool should skip confirmation (YOLO lane check)
Returns true if the tool’s lane is in YOLO mode, meaning it should
be auto-approved even when PermissionPolicy returns Ask.
Sourcepub fn requires_confirmation(&self, tool_name: &str) -> bool
pub fn requires_confirmation(&self, tool_name: &str) -> bool
Check if a tool requires confirmation
This is the inverse of is_yolo() — returns true when HITL is enabled
and the tool’s lane is NOT in YOLO mode.
Trait Implementations§
Source§impl Clone for ConfirmationPolicy
impl Clone for ConfirmationPolicy
Source§fn clone(&self) -> ConfirmationPolicy
fn clone(&self) -> ConfirmationPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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