Skip to main content

VerifiedResponse

Struct VerifiedResponse 

Source
pub struct VerifiedResponse {
Show 16 fields pub turn_id: String, pub request_id: String, pub tool_name: String, pub args_json: String, pub modified_args_json: String, pub approved: bool, pub approved_for_session: bool, pub covered_capabilities: Vec<String>, pub caller: String, pub approver: String, pub sandbox_mode: String, pub reason: String, pub injected_context: String, pub conversation_id: String, pub nonce: String, pub signer_public_key: Vec<u8>,
}
Expand description

A decoded approval_response payload after signature verification.

Fields§

§turn_id: String

Turn that emitted this occurrence. Empty only on durable responses written before occurrence identity was introduced.

§request_id: String

The tool-call id this response answers.

§tool_name: String

The bound tool name — the approval applies only to this exact call.

§args_json: String

The bound args_json — the model’s PROPOSED args, the identity the approval is bound to. Self::authorizes_call matches this byte-for-byte, so a re-emitted call with different args cannot inherit the approval. This is the args the approver saw, NOT necessarily the args that execute.

§modified_args_json: String

The approver’s EDIT to the proposed args — the args to actually execute, or empty when the approver did not edit (execute args_json unchanged). Signed, so the edit is unforgeable and auditable; the delta from args_json is the recorded mutation. Resolve the effective execution args with the pure polyc_agent::resolve_approved_call.

§approved: bool

Whether the request was approved.

§approved_for_session: bool

Whether the approval is remembered for the rest of the session (“don’t ask again”); false for a one-shot approval.

§covered_capabilities: Vec<String>

The capability shortfall this approval covered (#595): the stable kebab-case capability names the gate reported missing when it paused the call. Covered by the signature, so the effective session-grant key is (caller, tool, covered capabilities) — a grant recorded against one covered set never satisfies the same tool after its required set grows. Empty for an approval of an ordinary policy/sandbox gate.

§caller: String

The caller identity the (session) approval is scoped to — the paused turn’s own beneficiary (RFC 8693 sub/subject), NOT necessarily who clicked. Set by the trusted control plane and covered by the signature, so a session grant cannot be re-scoped to a different user.

§approver: String

The identity that actually resolved this decision (#1025, RFC 8693 act/actor), when the edge supplied one — empty otherwise (no edge integration yet, or a payload signed before this field existed). Distinct from caller: an admin approving on someone else’s behalf signs a different approver than caller. For approval-policy checks and the audit trail ONLY — never fed into principal_ref (see caller’s own resume-attribution use in the control plane).

§sandbox_mode: String

The sandbox/permission mode the paused turn ran under, covered by the signature so a grant cannot be replayed under a different mode.

§reason: String

Free-form human-supplied reason.

§injected_context: String

Context the approver attached to inject before the tool runs — prepended as an internal_only message ahead of execution, or empty when none. Signed, so an injected instruction is unforgeable and recorded.

§conversation_id: String

The conversation the approval was granted in, covered by the signature so a token signed for one conversation cannot be replayed into another (#370, closes #77 bug 3B).

§nonce: String

Per-approval unique value, covered by the signature. A consumer records it on use so the token cannot be re-presented once spent (single-use, #370).

§signer_public_key: Vec<u8>

The verified signer’s public key (encoded).

Implementations§

Source§

impl VerifiedResponse

Source

pub fn authorizes_call( &self, request_id: &str, tool_name: &str, args_json: &str, ) -> bool

Whether this verified, approved token authorizes the EXACT call (request_id, tool_name, args_json) — the args-binding (#370 item 3).

The signed args_json is matched byte-for-byte, so a re-emitted same-id call with different arguments (or a different tool) is NOT authorized: a captured approval can never be reused to run a different action. A denial (approved == false) authorizes nothing.

Trait Implementations§

Source§

impl Clone for VerifiedResponse

Source§

fn clone(&self) -> VerifiedResponse

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 Debug for VerifiedResponse

Source§

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

Formats the value using the given formatter. Read more

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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