#[non_exhaustive]pub enum ToolVerdict {
Allowed {
tool: String,
budget_remaining: u64,
elapsed_us: u64,
payout_micros: u64,
principal_id: Option<String>,
},
Blocked {
tool: String,
stage: &'static str,
policy: Option<String>,
denial_code: DenialCode,
reason: String,
response: Value,
elapsed_us: u64,
},
}Expand description
Verdict for one intercepted tool call.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Allowed
Forward to the downstream tool server.
Fields
payout_micros: u64Payout amount (USD micros) that
ActionBudget::try_tool_call debited on this call. Threaded
out so a lost execution.claim() race in the harness can
call [ActionBudget::refund_tool_call] with the exact same
amount, closing the concurrent-MCP budget
double-spend.
principal_id: Option<String>Principal id whose ledger was ALSO debited (when a principal-scoped budget is bound). Threaded out so every harness failure path that refunds the session ledger can mirror the refund on the principal ledger — without this, each lost claim race / saturated worker permanently consumed principal quota with zero tools executed.
Blocked
Block; respond to the agent with response.
Fields
policy: Option<String>Name of the policy engine that denied, when the block came
from the named policy chain (stage: "policy"). Parse,
schema, and budget gates are configured limits rather than
named policies, so they stay None — the console’s
per-policy attribution must never invent a policy that the
operator can’t find in their policy inventory.
denial_code: DenialCodeStructured denial code for machine consumption.
Implementations§
Source§impl ToolVerdict
impl ToolVerdict
Sourcepub fn is_allowed(&self) -> bool
pub fn is_allowed(&self) -> bool
True when the call may proceed.
Sourcepub fn elapsed_us(&self) -> u64
pub fn elapsed_us(&self) -> u64
Decision latency in microseconds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolVerdict
impl RefUnwindSafe for ToolVerdict
impl Send for ToolVerdict
impl Sync for ToolVerdict
impl Unpin for ToolVerdict
impl UnsafeUnpin for ToolVerdict
impl UnwindSafe for ToolVerdict
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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