Skip to main content

Constraint

Enum Constraint 

Source
pub enum Constraint {
Show 23 variants PathPrefix(String), DomainExact(String), DomainGlob(String), RegexMatch(String), MaxLength(usize), MaxArgsSize(usize), GovernedIntentRequired, RequireApprovalAbove { threshold_units: u64, }, SellerExact(String), MinimumRuntimeAssurance(RuntimeAssuranceTier), MinimumAutonomyTier(GovernedAutonomyTier), Custom(String, String), TableAllowlist(Vec<String>), ColumnDenylist(Vec<String>), MaxRowsReturned(u64), OperationClass(SqlOperationClass), AudienceAllowlist(Vec<String>), ContentReviewTier(ContentReviewTier), MaxTransactionAmountUsd(String), RequireDualApproval(bool), ModelConstraint { allowed_model_ids: Vec<String>, min_safety_tier: Option<ModelSafetyTier>, }, MemoryStoreAllowlist(Vec<String>), MemoryWriteDenyPatterns(Vec<String>),
}
Expand description

A constraint on tool parameters.

Variants§

§

PathPrefix(String)

File path parameter must start with this prefix.

§

DomainExact(String)

Network domain must match exactly.

§

DomainGlob(String)

Network domain must match a glob pattern.

§

RegexMatch(String)

Parameter must match a regular expression.

§

MaxLength(usize)

String parameter must not exceed this length.

§

MaxArgsSize(usize)

Serialized argument payload must not exceed this many bytes.

§

GovernedIntentRequired

Requests must carry a governed transaction intent.

§

RequireApprovalAbove

Requests at or above this threshold require a valid approval token.

Fields

§threshold_units: u64
§

SellerExact(String)

Requests must carry commerce approval context for this exact seller.

§

MinimumRuntimeAssurance(RuntimeAssuranceTier)

Governed requests must carry valid runtime attestation at or above this tier.

§

MinimumAutonomyTier(GovernedAutonomyTier)

Governed requests at or above this autonomy tier must carry autonomy context and pass bond gating.

§

Custom(String, String)

Extensibility: arbitrary key-value constraint.

§

TableAllowlist(Vec<String>)

Data layer: database tables the grant may reference.

Evaluated against parsed SQL by chio-data-guards; the kernel records the constraint and leaves enforcement to that guard.

§

ColumnDenylist(Vec<String>)

Data layer: forbidden columns, formatted as "table.column".

Evaluated by chio-data-guards; kernel treats it as an advisory constraint and does not reject at the request-matching stage.

§

MaxRowsReturned(u64)

Data layer: maximum number of rows a query may return.

Enforced post-invocation by downstream result-shaping guards.

§

OperationClass(SqlOperationClass)

Data layer: operation class the grant authorises.

§

AudienceAllowlist(Vec<String>)

Communication: allowed recipient channels or IDs.

§

ContentReviewTier(ContentReviewTier)

Communication: content review tier demanded of downstream guards.

§

MaxTransactionAmountUsd(String)

Financial: maximum transaction amount in USD.

The value is a decimal string (e.g. "100.00") because rust_decimal is not in the workspace.

§

RequireDualApproval(bool)

Financial: whether the grant requires dual approval before execution.

§

ModelConstraint

Model routing: constrain the models this grant may execute under.

Fields

§allowed_model_ids: Vec<String>

Explicit allowlist of model identifiers. Empty means no allowlist.

§min_safety_tier: Option<ModelSafetyTier>

Minimum acceptable model safety tier, if any.

§

MemoryStoreAllowlist(Vec<String>)

Memory governance: memory stores the grant may write to.

§

MemoryWriteDenyPatterns(Vec<String>)

Memory governance: regex patterns that block writes.

Patterns are compiled lazily during kernel evaluation so invalid regexes do not break construction or round-trip serialization.

Trait Implementations§

Source§

impl Clone for Constraint

Source§

fn clone(&self) -> Constraint

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Constraint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Constraint

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Constraint, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Constraint

Source§

fn eq(&self, other: &Constraint) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Constraint

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Constraint

Source§

impl StructuralPartialEq for Constraint

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,