pub struct ToolEnvelope {
pub exit_code: Option<i32>,
pub stdout: Option<String>,
pub stderr: Option<String>,
pub timed_out: Option<bool>,
pub stdout_truncated: bool,
pub stderr_truncated: bool,
pub denied: bool,
pub denials: Vec<Denial>,
pub sandbox_kind: SandboxKind,
pub enforcement: EnforcementReport,
pub disclosure: Disclosure,
}Expand description
A structured execution result. Serialized to the MCP content shape via
ToolEnvelope::into_json; absent fields are omitted.
Fields§
§exit_code: Option<i32>Process exit code, when the operation had one.
stdout: Option<String>Captured standard output, when relevant.
stderr: Option<String>Captured standard error, when relevant.
timed_out: Option<bool>Whether the operation was cut short by a timeout.
stdout_truncated: boolWhether captured stdout was clipped at the output cap (more was produced
than was kept). Lets a consumer tell a complete result from a truncated
one. Omitted (treated as false) when output was not clipped.
stderr_truncated: boolWhether captured stderr was clipped at the output cap. Omitted when not.
denied: boolWhether the in-process leash recorded at least one denial during this
invocation. This is a structured signal: it is set iff
Self::denials is non-empty, so a consumer never has to string-match
stderr to detect a security refusal. Omitted (treated as false) when
no denial was recorded.
denials: Vec<Denial>The denials the interceptor recorded, in the order they occurred. Empty
(and omitted from JSON) unless Self::denied is true.
sandbox_kind: SandboxKindThe OS-level sandbox in force when this ran. Always present so callers can tell whether the leash was kernel-enforced or advisory.
enforcement: EnforcementReportPer-axis confinement report (ADR 0004 D1): for each restricted axis,
whether it is kernel / interceptor / advisory. Refines the coarse
sandbox_kind (which stays the minimum claim) at axis grain. Omitted
from JSON when no axis is restricted.
disclosure: DisclosureOperator-facing disclosure (ADR 0017 D6) — informational only, never
part of the enforcement claim. Quiet by default (omitted when nothing is
worth disclosing); an unbridled run always surfaces here.
Implementations§
Source§impl ToolEnvelope
impl ToolEnvelope
Sourcepub fn new(sandbox_kind: SandboxKind) -> ToolEnvelope
pub fn new(sandbox_kind: SandboxKind) -> ToolEnvelope
An envelope stamped with the sandbox kind and nothing else set.
Sourcepub fn with_exit_code(self, code: i32) -> ToolEnvelope
pub fn with_exit_code(self, code: i32) -> ToolEnvelope
Set the exit code (builder style).
Sourcepub fn with_stdout(self, stdout: impl Into<String>) -> ToolEnvelope
pub fn with_stdout(self, stdout: impl Into<String>) -> ToolEnvelope
Set captured stdout (builder style).
Sourcepub fn with_stderr(self, stderr: impl Into<String>) -> ToolEnvelope
pub fn with_stderr(self, stderr: impl Into<String>) -> ToolEnvelope
Set captured stderr (builder style).
Sourcepub fn with_timed_out(self, timed_out: bool) -> ToolEnvelope
pub fn with_timed_out(self, timed_out: bool) -> ToolEnvelope
Mark whether the operation timed out (builder style).
Sourcepub fn with_truncation(
self,
stdout_truncated: bool,
stderr_truncated: bool,
) -> ToolEnvelope
pub fn with_truncation( self, stdout_truncated: bool, stderr_truncated: bool, ) -> ToolEnvelope
Mark whether captured stdout/stderr were clipped at the cap (builder style). A truncated stream is a bounded read: peak buffering never exceeds the cap regardless of how much the child produced.
Sourcepub fn with_denials(self, denials: Vec<Denial>) -> ToolEnvelope
pub fn with_denials(self, denials: Vec<Denial>) -> ToolEnvelope
Attach the leash denials the interceptor recorded (builder style).
Self::denied is set to true iff denials is non-empty, so the
boolean flag and the list can never disagree. Passing an empty vec is a
no-op (the result stays un-denied), which keeps the common
nothing-was-denied path clean.
Sourcepub fn with_enforcement(self, enforcement: EnforcementReport) -> ToolEnvelope
pub fn with_enforcement(self, enforcement: EnforcementReport) -> ToolEnvelope
Attach the per-axis confinement report (builder style; ADR 0004 D1).
Sourcepub fn with_disclosure(self, disclosure: Disclosure) -> ToolEnvelope
pub fn with_disclosure(self, disclosure: Disclosure) -> ToolEnvelope
Attach the operator-facing disclosure (builder style; ADR 0017 D6).
Purely informational — it does not affect Self::enforcement,
Self::sandbox_kind, or any confinement claim.
Trait Implementations§
Source§impl Clone for ToolEnvelope
impl Clone for ToolEnvelope
Source§fn clone(&self) -> ToolEnvelope
fn clone(&self) -> ToolEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolEnvelope
impl Debug for ToolEnvelope
Source§impl Default for ToolEnvelope
impl Default for ToolEnvelope
Source§fn default() -> ToolEnvelope
fn default() -> ToolEnvelope
Source§impl<'de> Deserialize<'de> for ToolEnvelope
impl<'de> Deserialize<'de> for ToolEnvelope
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolEnvelope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ToolEnvelope
impl Serialize for ToolEnvelope
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ToolEnvelope
impl RefUnwindSafe for ToolEnvelope
impl Send for ToolEnvelope
impl Sync for ToolEnvelope
impl Unpin for ToolEnvelope
impl UnsafeUnpin for ToolEnvelope
impl UnwindSafe for ToolEnvelope
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Self to a value of type T.impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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