pub struct AgentCapabilities {
pub can_spawn: bool,
pub can_ipc: bool,
pub can_exec_tools: bool,
pub can_network: bool,
pub ipc_scope: IpcScope,
pub resource_limits: ResourceLimits,
}Expand description
Capabilities assigned to an agent process.
Governs what the agent is allowed to do within the kernel.
Fields§
§can_spawn: boolWhether the agent can spawn child processes.
can_ipc: boolWhether the agent can send/receive IPC messages.
can_exec_tools: boolWhether the agent can execute tools.
can_network: boolWhether the agent can make network requests.
ipc_scope: IpcScopeIPC scope restriction.
resource_limits: ResourceLimitsResource limits for this agent.
Implementations§
Source§impl AgentCapabilities
impl AgentCapabilities
Sourcepub fn browser_default() -> Self
pub fn browser_default() -> Self
Create capabilities for a browser-platform agent.
Browser agents default to restricted IPC scope (empty allow-list), no spawning, no network access, and no shell — maximising the sandbox surface for untrusted in-browser code.
Sourcepub fn can_message(&self, target_pid: u64) -> bool
pub fn can_message(&self, target_pid: u64) -> bool
Check whether the agent is allowed to send a message to the given PID.
Source§impl AgentCapabilities
impl AgentCapabilities
Sourcepub fn request_elevation(
current: &AgentCapabilities,
requested: &AgentCapabilities,
platform: &str,
) -> CapabilityElevationRequest
pub fn request_elevation( current: &AgentCapabilities, requested: &AgentCapabilities, platform: &str, ) -> CapabilityElevationRequest
Build an elevation request from current to requested capabilities.
The pid field is set to 0 and must be filled by the caller.
Sourcepub fn needs_elevation(platform: &str, requested: &AgentCapabilities) -> bool
pub fn needs_elevation(platform: &str, requested: &AgentCapabilities) -> bool
Check if elevation is needed (browser agents start restricted).
Returns true if the platform is "browser" and the requested
capabilities exceed the browser sandbox defaults (spawn, network,
or non-restricted IPC scope).
Trait Implementations§
Source§impl Clone for AgentCapabilities
impl Clone for AgentCapabilities
Source§fn clone(&self) -> AgentCapabilities
fn clone(&self) -> AgentCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentCapabilities
impl Debug for AgentCapabilities
Source§impl Default for AgentCapabilities
impl Default for AgentCapabilities
Source§impl<'de> Deserialize<'de> for AgentCapabilities
impl<'de> Deserialize<'de> for AgentCapabilities
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>,
Source§impl PartialEq for AgentCapabilities
impl PartialEq for AgentCapabilities
Source§impl Serialize for AgentCapabilities
impl Serialize for AgentCapabilities
impl Eq for AgentCapabilities
impl StructuralPartialEq for AgentCapabilities
Auto Trait Implementations§
impl Freeze for AgentCapabilities
impl RefUnwindSafe for AgentCapabilities
impl Send for AgentCapabilities
impl Sync for AgentCapabilities
impl Unpin for AgentCapabilities
impl UnsafeUnpin for AgentCapabilities
impl UnwindSafe for AgentCapabilities
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more