pub struct AutonomyPolicy {
pub level: AutonomyLevel,
pub workspace_only: bool,
pub forbidden_paths: Vec<String>,
pub allowed_roots: Vec<String>,
pub auto_approve: HashSet<String>,
pub always_ask: HashSet<String>,
pub allow_sensitive_file_reads: bool,
pub allow_sensitive_file_writes: bool,
}Expand description
Runtime autonomy policy built from config values.
Fields§
§level: AutonomyLevel§workspace_only: bool§forbidden_paths: Vec<String>§allowed_roots: Vec<String>§auto_approve: HashSet<String>§always_ask: HashSet<String>§allow_sensitive_file_reads: bool§allow_sensitive_file_writes: boolImplementations§
Source§impl AutonomyPolicy
impl AutonomyPolicy
Sourcepub fn check_tool(&self, tool_name: &str) -> ApprovalDecision
pub fn check_tool(&self, tool_name: &str) -> ApprovalDecision
Evaluate whether a tool invocation should proceed.
Sourcepub fn check_file_read(&self, path: &str) -> ApprovalDecision
pub fn check_file_read(&self, path: &str) -> ApprovalDecision
Check whether a file path is allowed for reading.
Sourcepub fn check_file_write(&self, path: &str) -> ApprovalDecision
pub fn check_file_write(&self, path: &str) -> ApprovalDecision
Check whether a file path is allowed for writing.
Sourcepub fn check_hard_links(path: &str) -> Result<()>
pub fn check_hard_links(path: &str) -> Result<()>
Check whether a file has multiple hard links (potential symlink attack).
Trait Implementations§
Source§impl Clone for AutonomyPolicy
impl Clone for AutonomyPolicy
Source§fn clone(&self) -> AutonomyPolicy
fn clone(&self) -> AutonomyPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AutonomyPolicy
impl Debug for AutonomyPolicy
Auto Trait Implementations§
impl Freeze for AutonomyPolicy
impl RefUnwindSafe for AutonomyPolicy
impl Send for AutonomyPolicy
impl Sync for AutonomyPolicy
impl Unpin for AutonomyPolicy
impl UnsafeUnpin for AutonomyPolicy
impl UnwindSafe for AutonomyPolicy
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