Struct ApprovalManager
pub struct ApprovalManager { /* private fields */ }Implementations§
Source§impl ApprovalManager
impl ApprovalManager
Sourcepub fn from_risk_profile(risk_profile: &RiskProfileConfig) -> Self
pub fn from_risk_profile(risk_profile: &RiskProfileConfig) -> Self
Create an interactive (CLI) approval manager from a risk profile.
pub fn for_non_interactive(risk_profile: &RiskProfileConfig) -> Self
pub fn for_non_interactive_backchannel(risk_profile: &RiskProfileConfig) -> Self
Sourcepub fn derive_for_risk_profile(&self, risk_profile: &RiskProfileConfig) -> Self
pub fn derive_for_risk_profile(&self, risk_profile: &RiskProfileConfig) -> Self
Derive a manager for a different agent’s risk profile while preserving
THIS manager’s interactivity mode. Used when a delegated execution (an
SOP step naming a different agent) must run under the delegate agent’s
own approval policy without losing an operator approval route the
current surface provides: an interactive parent stays interactive, a
back-channel parent keeps routing shell approvals through the client
channel, and a plain non-interactive parent stays auto-deny. Policy
sets (auto_approve / always_ask / autonomy level) come entirely
from risk_profile; the session allowlist and audit trail start
fresh — “Always” grants to one agent never transfer to another.
Sourcepub fn is_non_interactive(&self) -> bool
pub fn is_non_interactive(&self) -> bool
Returns true when this manager operates in non-interactive mode
(i.e. for channel-driven runs where no operator can approve).
Sourcepub fn needs_approval(&self, tool_name: &str) -> bool
pub fn needs_approval(&self, tool_name: &str) -> bool
Check whether a tool call requires interactive approval.
Returns true if the call needs a prompt, false if it can proceed.
pub fn approval_requirement(&self, tool_name: &str) -> ApprovalRequirement
Sourcepub fn record_decision(
&self,
tool_name: &str,
args: &Value,
decision: &ApprovalResponse,
channel: &str,
)
pub fn record_decision( &self, tool_name: &str, args: &Value, decision: &ApprovalResponse, channel: &str, )
Record an approval decision and update session state.
Sourcepub fn audit_log(&self) -> Vec<ApprovalLogEntry>
pub fn audit_log(&self) -> Vec<ApprovalLogEntry>
Get a snapshot of the audit log.
Sourcepub fn session_allowlist(&self) -> HashSet<String>
pub fn session_allowlist(&self) -> HashSet<String>
Get the current session allowlist.
Sourcepub fn prompt_cli(&self, request: &ApprovalRequest) -> ApprovalResponse
pub fn prompt_cli(&self, request: &ApprovalRequest) -> ApprovalResponse
Prompt the user on the CLI and return their decision. Only called for interactive (CLI) managers. Non-interactive managers auto-deny in the tool-call loop before reaching this point.
Auto Trait Implementations§
impl !Freeze for ApprovalManager
impl !RefUnwindSafe for ApprovalManager
impl Send for ApprovalManager
impl Sync for ApprovalManager
impl Unpin for ApprovalManager
impl UnsafeUnpin for ApprovalManager
impl UnwindSafe for ApprovalManager
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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