pub struct RunPolicy { /* private fields */ }Expand description
Per-run policy for constraining tool execution.
This policy is intentionally narrower than crate::config::AgentMode:
AgentMode establishes a coarse baseline role, while RunPolicy lets
automation further constrain a single non-interactive worker run.
Implementations§
Source§impl RunPolicy
impl RunPolicy
pub fn new() -> Self
pub fn allow_tool(self, name: impl AsRef<str>) -> Self
pub fn deny_tool(self, name: impl AsRef<str>) -> Self
pub fn allowed_tools(&self) -> &BTreeSet<String>
pub fn denied_tools(&self) -> &BTreeSet<String>
pub fn allow_write(self, pattern: impl Into<String>) -> Self
pub fn deny_write(self, pattern: impl Into<String>) -> Self
pub fn allowed_write_patterns(&self) -> &[String]
pub fn denied_write_patterns(&self) -> &[String]
pub fn is_empty(&self) -> bool
pub fn check_tool(&self, tool_name: &str) -> ToolPolicyDecision
pub fn check_write_path(&self, cwd: &Path, path: &Path) -> WritePolicyDecision
Trait Implementations§
impl Eq for RunPolicy
impl StructuralPartialEq for RunPolicy
Auto Trait Implementations§
impl Freeze for RunPolicy
impl RefUnwindSafe for RunPolicy
impl Send for RunPolicy
impl Sync for RunPolicy
impl Unpin for RunPolicy
impl UnsafeUnpin for RunPolicy
impl UnwindSafe for RunPolicy
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,
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.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