pub struct AgentPrompter;Expand description
A Prompter for AI agents — no interactive IO, pure threshold logic.
Decision rules:
- If the command is on the deny list →
Denied - Otherwise →
Passed(severity-based denial is handled inassess_command)
Trait Implementations§
Source§impl Prompter for AgentPrompter
impl Prompter for AgentPrompter
Source§fn run_challenge(&self, display: &DisplayContext) -> ChallengeResult
fn run_challenge(&self, display: &DisplayContext) -> ChallengeResult
Display warnings and run a challenge. Returns the outcome.
Source§fn can_prompt(&self) -> bool
fn can_prompt(&self) -> bool
Whether this prompter can currently ask a human anything (i.e. a
terminal is available). Callers use this to fail closed with a clear
message instead of attempting a prompt. Defaults to
true.Source§fn announce_approved(&self, _command: &str)
fn announce_approved(&self, _command: &str)
Called after a passed challenge (when the
approved_notice setting
is on) to say the command is now running. The terminal prompters
print approved_line; the default does nothing.Auto Trait Implementations§
impl Forget for AgentPrompter
impl Freeze for AgentPrompter
impl Move for AgentPrompter
impl RefUnwindSafe for AgentPrompter
impl Send for AgentPrompter
impl Sync for AgentPrompter
impl Unpin for AgentPrompter
impl UnsafeUnpin for AgentPrompter
impl UnwindSafe for AgentPrompter
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> 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> ⓘ
Converts
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> ⓘ
Converts
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