Skip to main content

SandboxCapabilities

Struct SandboxCapabilities 

Source
pub struct SandboxCapabilities {
Show 13 fields pub files: bool, pub reconnect: bool, pub jobs: bool, pub preview: bool, pub pause_resume: bool, pub snapshot: bool, pub domain_egress_rules: bool, pub egress_deny: bool, pub enforced_limits: bool, pub process_limit: bool, pub sandbox_lifetime: bool, pub supervisor_pid_namespace: bool, pub supervisor_isolation: bool,
}
Expand description

What a platform’s sandbox backend can actually do.

Published so portable code can branch before calling rather than discovering a gap through an error. Every field here corresponds to a capability that at least one platform lacks; create, exec and terminate are the guaranteed floor and are therefore not listed.

Fields§

§files: bool

Files can be moved in and out of a sandbox

§reconnect: bool

A later call can reach a sandbox created by an earlier one

§jobs: bool

A command can be started, polled and cancelled across separate calls, so it outlives the one that started it. False where nothing inside the sandbox owns the process in between.

§preview: bool

An authenticated, port-scoped capability to reach a service inside the sandbox

§pause_resume: bool

Sandbox state can be paused and resumed

§snapshot: bool

A sandbox’s full state can be captured and used to create another

§domain_egress_rules: bool

Egress can be restricted to a hostname allowlist

§egress_deny: bool

Whether a declared deny is actually enforced, rather than accepted and dropped

§enforced_limits: bool

The platform enforces the declared cpu, memory and disk ceilings

§process_limit: bool

The platform can cap how many processes a sandbox runs

§sandbox_lifetime: bool

The platform terminates a sandbox at a declared wall-clock deadline

§supervisor_pid_namespace: bool

A command runs in its own PID namespace and cannot see or signal the agent’s processes.

Only where an agent runs as root. Creating the namespace needs CAP_SYS_ADMIN, and the Kubernetes sandbox pod drops every capability — which is also what denies ptrace by construction, so granting it there would remove a lock to add one.

§supervisor_isolation: bool

The process supervising a command is a different identity from the command.

False where a command runs as the agent’s own user: it can then read the supervisor’s environment and signal it. Separate from supervisorPidNamespace, which is about visibility rather than identity — a backend can have one without the other.

Implementations§

Source§

impl SandboxCapabilities

Source

pub fn for_platform(platform: Platform) -> Result<Self>

Returns what the given platform’s sandbox backend supports.

Errors for platforms with no sandbox backend, rather than returning an all-false set — “every capability is missing” and “this platform has no sandboxes” are different conditions and an application should not have to tell them apart by inspection.

Source

pub fn azure() -> Self

What the Azure sandbox backend supports; the body of the Platform::Azure arm.

Source

pub fn gcp_agent_platform() -> Self

What the GCP Agent Platform sandbox backend supports; the body of the Platform::Gcp arm.

Source

pub fn require( &self, capability: SandboxCapability, platform: Platform, ) -> Result<()>

Returns a typed error if the named capability is absent on this platform.

Trait Implementations§

Source§

impl Clone for SandboxCapabilities

Source§

fn clone(&self) -> SandboxCapabilities

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for SandboxCapabilities

Source§

impl Debug for SandboxCapabilities

Source§

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

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

impl<'de> Deserialize<'de> for SandboxCapabilities

Source§

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

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

impl Eq for SandboxCapabilities

Source§

impl PartialEq for SandboxCapabilities

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for SandboxCapabilities

Source§

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

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

impl StructuralPartialEq for SandboxCapabilities

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more