Skip to main content

GuardContext

Struct GuardContext 

Source
pub struct GuardContext<'a> {
    pub request: &'a PortableToolCallRequest,
    pub scope: &'a ChioScope,
    pub agent_id: &'a str,
    pub server_id: &'a str,
    pub session_filesystem_roots: Option<&'a [String]>,
    pub matched_grant_index: Option<usize>,
}
Expand description

Inputs a guard sees when it runs inside the core evaluate pipeline.

Mirrors chio_kernel::GuardContext with two deliberate restrictions:

  • request carries only the portable shape (no dpop_proof, governed_intent, approval_token, or model_metadata – those are full-kernel concerns). The legacy adapter in chio-kernel builds a temporary PortableToolCallRequest when it runs the core evaluate pipeline.
  • session_filesystem_roots stays in the portable surface so the filesystem-roots guard (today the only session-aware guard) can run unchanged on every platform.

Fields§

§request: &'a PortableToolCallRequest

The tool call request being evaluated.

§scope: &'a ChioScope

The verified capability scope.

§agent_id: &'a str

The agent making the request.

§server_id: &'a str

The target server.

§session_filesystem_roots: Option<&'a [String]>

Session-scoped enforceable filesystem roots, when the request is being evaluated through the supported session-backed runtime path.

§matched_grant_index: Option<usize>

Index of the matched grant in the capability’s scope, populated by [crate::evaluate] before guards run.

Auto Trait Implementations§

§

impl<'a> Freeze for GuardContext<'a>

§

impl<'a> RefUnwindSafe for GuardContext<'a>

§

impl<'a> Send for GuardContext<'a>

§

impl<'a> Sync for GuardContext<'a>

§

impl<'a> Unpin for GuardContext<'a>

§

impl<'a> UnsafeUnpin for GuardContext<'a>

§

impl<'a> UnwindSafe for GuardContext<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.