pub struct Sandbox { /* private fields */ }Expand description
The sandbox: compiled schemas + policy chain + budget spec.
Implementations§
Source§impl Sandbox
impl Sandbox
Sourcepub fn new(
config: SandboxConfig,
policies: Vec<Box<dyn PolicyEngine>>,
) -> Result<Self, String>
pub fn new( config: SandboxConfig, policies: Vec<Box<dyn PolicyEngine>>, ) -> Result<Self, String>
Build a sandbox, compiling every tool schema up front (a schema that fails to compile is a configuration error surfaced at boot, not a silently-skipped validation at request time).
Sourcepub fn check(
&self,
store: &dyn StateStore,
session: &str,
raw: &[u8],
) -> ToolVerdict
pub fn check( &self, store: &dyn StateStore, session: &str, raw: &[u8], ) -> ToolVerdict
Evaluate a raw MCP payload for session.
Auto Trait Implementations§
impl Freeze for Sandbox
impl !RefUnwindSafe for Sandbox
impl Send for Sandbox
impl Sync for Sandbox
impl Unpin for Sandbox
impl UnsafeUnpin for Sandbox
impl !UnwindSafe for Sandbox
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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