pub struct Governance { /* private fields */ }Expand description
Facade over the kernel GovernancePipeline.
Implementations§
Source§impl Governance
impl Governance
pub fn new(default_action: PermissionAction) -> Self
pub fn allow() -> Self
pub fn set_identity( &mut self, agent_id: impl Into<String>, session_id: impl Into<String>, )
pub fn add_permission_rule( &mut self, pattern: impl Into<String>, action: PermissionAction, )
pub fn block_tool(&mut self, name: impl Into<String>)
pub fn set_rate_limit( &mut self, tool_name: impl Into<String>, max_calls: u32, window_ms: u64, )
pub fn require_param( &mut self, tool_name: impl Into<String>, param_path: impl Into<String>, )
pub fn allow_param_values( &mut self, tool_name: impl Into<String>, param_path: impl Into<String>, allowed_values: Vec<String>, )
pub fn limit_param_range( &mut self, tool_name: impl Into<String>, param_path: impl Into<String>, min: Option<f64>, max: Option<f64>, )
pub fn set_time(&mut self, now_ms: u64)
pub fn evaluate( &mut self, tool_name: &str, args_json: &str, ) -> GovernanceVerdict
Auto Trait Implementations§
impl Freeze for Governance
impl RefUnwindSafe for Governance
impl Send for Governance
impl Sync for Governance
impl Unpin for Governance
impl UnsafeUnpin for Governance
impl UnwindSafe for Governance
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