pub struct ChainValidationConfig {
pub max_depth: u32,
}Expand description
Configuration for delegation chain validation.
§SR-8: Maximum delegation depth
Without a depth limit, an attacker can construct arbitrarily deep delegation chains, creating denial-of-service via quadratic chain validation cost and enabling privilege confusion through deeply nested delegation.
Fields§
§max_depth: u32Maximum number of delegation hops allowed (default: 5, hard max: 10).
A depth of 1 means the root (human) issuer → agent (no re-delegation). A depth of 2 means human → orchestrator → tool-agent. Values above 10 are clamped to 10.
Implementations§
Source§impl ChainValidationConfig
impl ChainValidationConfig
Sourcepub const HARD_MAX_DEPTH: u32 = 10
pub const HARD_MAX_DEPTH: u32 = 10
The hard maximum depth — cannot be overridden.
Sourcepub fn with_max_depth(max_depth: u32) -> Self
pub fn with_max_depth(max_depth: u32) -> Self
Create a config with a specific depth limit (clamped to HARD_MAX_DEPTH).
Trait Implementations§
Source§impl Clone for ChainValidationConfig
impl Clone for ChainValidationConfig
Source§fn clone(&self) -> ChainValidationConfig
fn clone(&self) -> ChainValidationConfig
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 ChainValidationConfig
impl Debug for ChainValidationConfig
Auto Trait Implementations§
impl Freeze for ChainValidationConfig
impl RefUnwindSafe for ChainValidationConfig
impl Send for ChainValidationConfig
impl Sync for ChainValidationConfig
impl Unpin for ChainValidationConfig
impl UnsafeUnpin for ChainValidationConfig
impl UnwindSafe for ChainValidationConfig
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