pub struct FileSystemToolPolicy { /* private fields */ }Expand description
Policy governing session-scoped filesystem access rules.
Policies are enforced by FileSystemToolResources on a per-session basis.
The primary policy today is require_read_before_write, which prevents an
agent from mutating a path it has not first inspected (via read or list).
§Example
use agentkit_tool_fs::FileSystemToolPolicy;
let policy = FileSystemToolPolicy::new()
.require_read_before_write(true);Implementations§
Source§impl FileSystemToolPolicy
impl FileSystemToolPolicy
Sourcepub fn require_read_before_write(self, value: bool) -> Self
pub fn require_read_before_write(self, value: bool) -> Self
When enabled, the agent must read (or list) a path before it can write, replace, move, or delete it. This helps prevent accidental overwrites.
Defaults to false.
Trait Implementations§
Source§impl Clone for FileSystemToolPolicy
impl Clone for FileSystemToolPolicy
Source§fn clone(&self) -> FileSystemToolPolicy
fn clone(&self) -> FileSystemToolPolicy
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 FileSystemToolPolicy
impl Debug for FileSystemToolPolicy
Source§impl Default for FileSystemToolPolicy
impl Default for FileSystemToolPolicy
Source§fn default() -> FileSystemToolPolicy
fn default() -> FileSystemToolPolicy
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FileSystemToolPolicy
impl RefUnwindSafe for FileSystemToolPolicy
impl Send for FileSystemToolPolicy
impl Sync for FileSystemToolPolicy
impl Unpin for FileSystemToolPolicy
impl UnsafeUnpin for FileSystemToolPolicy
impl UnwindSafe for FileSystemToolPolicy
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