pub struct PolicyToolSetProvider {
pub policy: PolicyConfig,
/* private fields */
}Expand description
ToolSetProvider that wraps the default registry with an L1 policy config.
The policy is stored in the registry for tools to query at call time via
registry.policy(). It does not automatically enforce anything by itself;
individual tools (e.g. run_shell) are responsible for calling
registry.policy().check_shell(...) before executing.
Fields§
§policy: PolicyConfigThe L1 policy to attach to the built registry.
Implementations§
Source§impl PolicyToolSetProvider
impl PolicyToolSetProvider
pub fn new( workspace: PathBuf, shell_timeout_secs: u64, skills: Vec<Skill>, policy: PolicyConfig, ) -> Self
Sourcepub fn restrictive(
workspace: PathBuf,
shell_timeout_secs: u64,
skills: Vec<Skill>,
) -> Self
pub fn restrictive( workspace: PathBuf, shell_timeout_secs: u64, skills: Vec<Skill>, ) -> Self
Create with PolicyConfig::default_restrictive policy.
Trait Implementations§
Source§impl ToolSetProvider for PolicyToolSetProvider
impl ToolSetProvider for PolicyToolSetProvider
Source§fn build_registry(&self) -> ToolRegistry
fn build_registry(&self) -> ToolRegistry
Build and return the tool registry for this provider.
Source§fn sandbox_mode(&self) -> SandboxMode
fn sandbox_mode(&self) -> SandboxMode
Report the sandbox level this provider operates at.
Auto Trait Implementations§
impl Freeze for PolicyToolSetProvider
impl RefUnwindSafe for PolicyToolSetProvider
impl Send for PolicyToolSetProvider
impl Sync for PolicyToolSetProvider
impl Unpin for PolicyToolSetProvider
impl UnsafeUnpin for PolicyToolSetProvider
impl UnwindSafe for PolicyToolSetProvider
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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