pub struct ErgativeGate { /* private fields */ }Expand description
Permission gate that enforces role-based tool access.
Implementations§
Source§impl ErgativeGate
impl ErgativeGate
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a gate with the default permission set.
Default rules:
- Observer:
Read,Glob,Grep - Reader: Observer tools +
WebSearch,WebFetch - Writer: Reader tools +
Edit,Write - Admin: wildcard
*(everything)
Sourcepub fn can_invoke(&self, _agent_id: &str, role: &AgentRole, tool: &str) -> bool
pub fn can_invoke(&self, _agent_id: &str, role: &AgentRole, tool: &str) -> bool
Check whether an agent with a given role may invoke a tool.
Sourcepub fn filter_tools(&self, role: &AgentRole, tools: &[String]) -> Vec<String>
pub fn filter_tools(&self, role: &AgentRole, tools: &[String]) -> Vec<String>
Filter a list of tools down to those accessible by a given role.
Sourcepub fn generate_manifest(
&self,
agent_id: &str,
role: &AgentRole,
) -> PermissionManifest
pub fn generate_manifest( &self, agent_id: &str, role: &AgentRole, ) -> PermissionManifest
Generate a permission manifest for an agent.
Trait Implementations§
Source§impl Clone for ErgativeGate
impl Clone for ErgativeGate
Source§fn clone(&self) -> ErgativeGate
fn clone(&self) -> ErgativeGate
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 ErgativeGate
impl Debug for ErgativeGate
Source§impl Default for ErgativeGate
impl Default for ErgativeGate
Source§impl<'de> Deserialize<'de> for ErgativeGate
impl<'de> Deserialize<'de> for ErgativeGate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErgativeGate
impl RefUnwindSafe for ErgativeGate
impl Send for ErgativeGate
impl Sync for ErgativeGate
impl Unpin for ErgativeGate
impl UnsafeUnpin for ErgativeGate
impl UnwindSafe for ErgativeGate
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