pub struct PendingApproval {
pub occurrence_turn_id: Option<String>,
pub id: String,
pub name: String,
pub args_json: String,
pub title: String,
pub sandbox_mode: String,
pub reason: String,
pub missing_capabilities: Vec<String>,
pub computed_preview: String,
}Expand description
One tool call awaiting human-in-the-loop approval.
Emitted by run_turn when ToolExecutor::needs_approval returns
true for a tool the model wants to call. The caller surfaces these to
the human / approver, persists an approval_request event per entry, and
re-drives the loop once a matching approval_response event lands.
id matches the provider’s tool-call id (so the assistant’s tool-use
content block lines up with the eventual tool-result), and is also used as
the request_id on the wire approval_request event payload.
Fields§
§occurrence_turn_id: Option<String>Turn that first emitted this approval occurrence. None for a new call
in the turn that is currently running; set when replay re-pauses an
earlier dangling call.
id: StringProvider-assigned tool-call id; also used as the approval request_id.
name: StringTool name, as advertised by ToolExecutor::specs. Raw machine
identifier; the field of record for trust/audit (unchanged in the
event log).
args_json: StringArguments as a JSON string (opaque at this layer).
title: StringHuman display label (MCP-style title) for the tool, carried from the
harness wire for presentation in the approval prompt. May be empty when
the harness produced no label; renderers derive one from
name then.
sandbox_mode: StringThe sandbox/permission mode (POLYCHROME_SANDBOX_MODE) the harness was
running under when it paused this call. Empty at the agent layer (the
agent is sandbox-unaware); the harness stamps it onto the wire payload so
the control plane can bind a remembered approval to the mode it was
granted under.
reason: StringWhy this specific call is being routed through the approval gate.
Empty for an ordinary gated call (the tool’s intrinsic needs_approval,
the operator allow-list, or a sandbox-denial escalation) — those need no
extra explanation and the edge renders its default prompt. Non-empty
when the escalation is the containment path (the call requires a
capability that untrusted content in context revoked): a distinct,
human-readable sentence from the one shared copy helper
(polyc_capability::escalation_reason), so a human decides before
bytes can leave. Surfaced on the chat approval card and persisted on
the durable approval_request event.
missing_capabilities: Vec<String>The capability shortfall that paused this call (#595): the stable
kebab-case names of the capabilities the gate found
required-but-not-granted. Persisted on the durable approval_request
and signed into a “don’t ask again” response as its covered set, so a
session grant is keyed by (caller, tool, covered capabilities). Empty
for an ordinary policy/sandbox gate.
computed_preview: StringA routine_delete call’s pre-resolved computed preview (#1643), as
JSON. The agent loop never sets this — it is filled in afterward by
the control plane (resolve_delete_previews in polyc-control-plane)
before either the durable approval_request payload or the live wire
card is built, since resolving one needs provider I/O neither of
those synchronous steps can perform. Empty for every tool but
routine_delete, and for a routine_delete call the control plane
could not resolve (falls open to the generic card).
Trait Implementations§
Source§impl Clone for PendingApproval
impl Clone for PendingApproval
Source§fn clone(&self) -> PendingApproval
fn clone(&self) -> PendingApproval
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 PendingApproval
impl Debug for PendingApproval
Source§impl Default for PendingApproval
impl Default for PendingApproval
Source§fn default() -> PendingApproval
fn default() -> PendingApproval
Auto Trait Implementations§
impl Freeze for PendingApproval
impl RefUnwindSafe for PendingApproval
impl Send for PendingApproval
impl Sync for PendingApproval
impl Unpin for PendingApproval
impl UnsafeUnpin for PendingApproval
impl UnwindSafe for PendingApproval
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<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