pub struct ApprovalRequest {Show 21 fields
pub approval_request_id: ApprovalRequestId,
pub approval_dispatch_effect_id: EffectId,
pub run_id: RunId,
pub session_id: Option<SessionId>,
pub agent_id: AgentId,
pub turn_id: TurnId,
pub tool_call_id: ToolCallId,
pub source: SourceRef,
pub destination: DestinationRef,
pub canonical_tool_name: String,
pub tool_source: SourceRef,
pub effect_class: EffectClass,
pub risk_class: RiskClass,
pub requested_args_ref: ContentRef,
pub redacted_args_summary: String,
pub policy_refs: Vec<PolicyRef>,
pub dispatcher_scope: DispatcherScope,
pub timeout_ms: u64,
pub allowed_decisions: Vec<ApprovalDecisionKind>,
pub created_at_millis: u64,
pub runtime_package_fingerprint: RuntimePackageFingerprint,
}Expand description
Carries the approval request record payload for journal, event, or fixture surfaces. Creating or cloning it only preserves serialized SDK state; append, publish, replay, or export effects are documented on the runtime and port methods that store it.
Fields§
§approval_request_id: ApprovalRequestIdStable approval request id used for typed lineage, lookup, or dedupe.
approval_dispatch_effect_id: EffectIdEffect id that links approval dispatch intent, response, and tool-release evidence. Use it to prove the approval decision belongs to the side effect being released.
run_id: RunIdRun identifier used for lineage, filtering, replay, and dedupe.
session_id: Option<SessionId>Optional host-provided session identifier for grouping related turns.
agent_id: AgentIdAgent identifier used for lineage, filtering, and ownership checks.
turn_id: TurnIdTurn identifier for one loop turn within a run.
tool_call_id: ToolCallIdStable tool call id used for typed lineage, lookup, or dedupe.
source: SourceRefSource label or ref for this item; it is metadata and does not fetch content by itself.
destination: DestinationRefDestination label or ref for this item; it is metadata and does not deliver content by itself.
canonical_tool_name: StringCanonical tool name used by this record or request.
tool_source: SourceRefTool source used by this record or request.
effect_class: EffectClassClassification value for effect class. Policy and projection paths use it for finite routing decisions.
risk_class: RiskClassRisk classification for the operation or capability. Policy uses it to decide whether approval, sandboxing, or denial is required.
requested_args_ref: ContentRefTyped requested args ref reference. Resolving or executing it is a separate policy-gated step.
redacted_args_summary: StringRedacted summary for display, logs, events, or telemetry. It should describe the value without exposing raw private content.
policy_refs: Vec<PolicyRef>Policy references that govern admission, projection, execution, or delivery.
dispatcher_scope: DispatcherScopeDispatcher scope used by this record or request.
timeout_ms: u64Timeout budget in milliseconds for the requested operation.
allowed_decisions: Vec<ApprovalDecisionKind>Allowlist for this policy or contract. Validation uses it to reject undeclared or policy-denied values.
created_at_millis: u64Time value in milliseconds for created at millis. Use it for timeout, ordering, or diagnostic calculations.
runtime_package_fingerprint: RuntimePackageFingerprintFingerprint of the runtime package snapshot in force when this value was produced. Use it for replay, dedupe, and package-lineage checks; the field is evidence and does not execute package behavior.
Implementations§
Source§impl ApprovalRequest
impl ApprovalRequest
Sourcepub fn validate(&self) -> Result<(), AgentError>
pub fn validate(&self) -> Result<(), AgentError>
Validates the records::approval invariants and returns a typed error on failure. Validation is pure and does not perform I/O, dispatch, journal appends, or adapter calls.
Sourcepub fn subject_ref(&self) -> EntityRef
pub fn subject_ref(&self) -> EntityRef
Returns an updated records::approval value with subject ref applied. This is data construction only and does not execute the configured behavior.
Sourcepub fn allows_decision(&self, decision: ApprovalDecisionKind) -> bool
pub fn allows_decision(&self, decision: ApprovalDecisionKind) -> bool
Returns whether allows decision applies for this state. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.
Trait Implementations§
Source§impl Clone for ApprovalRequest
impl Clone for ApprovalRequest
Source§fn clone(&self) -> ApprovalRequest
fn clone(&self) -> ApprovalRequest
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 ApprovalRequest
impl Debug for ApprovalRequest
Source§impl<'de> Deserialize<'de> for ApprovalRequest
impl<'de> Deserialize<'de> for ApprovalRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ApprovalRequest
impl PartialEq for ApprovalRequest
Source§fn eq(&self, other: &ApprovalRequest) -> bool
fn eq(&self, other: &ApprovalRequest) -> bool
self and other values to be equal, and is used by ==.