pub struct PaymentPolicy {Show 16 fields
pub id: PaymentPolicyId,
pub organization_id: String,
pub payment_account_id: PaymentAccountId,
pub subject_type: String,
pub subject_id: String,
pub allowed_capabilities: Vec<String>,
pub allowed_hosts: Vec<String>,
pub rail_preference: Vec<PaymentRail>,
pub max_amount_usd_per_request: Option<f64>,
pub max_amount_usd_per_turn: Option<f64>,
pub max_amount_usd_per_day: Option<f64>,
pub require_approval_above_usd: Option<f64>,
pub status: PaymentStatus,
pub metadata: Value,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A payment policy — the binding between a paying account and a subject (agent identity, session) that controls which paid calls are authorized and at what spend caps.
Fields§
§id: PaymentPolicyIdPrefixed public identifier. See ID Schema.
organization_id: StringOwning organization’s prefixed public identifier.
payment_account_id: PaymentAccountIdPayment account this policy authorizes spending from.
subject_type: StringClass of subject this policy binds to (e.g. agent_identity, session).
subject_id: StringPrefixed identifier of the bound subject.
allowed_capabilities: Vec<String>Capability IDs this policy permits paid calls for. Empty list means no capability gating.
allowed_hosts: Vec<String>HTTP host allowlist for paid outbound calls. Empty list means no host gating.
rail_preference: Vec<PaymentRail>Preferred settlement rails in priority order; the authority picks the first available.
max_amount_usd_per_request: Option<f64>Maximum amount (USD) any single paid request may settle for. Enforced by the payment authority at policy selection. None means no per-request cap.
max_amount_usd_per_turn: Option<f64>Maximum cumulative amount (USD) per agent turn. Advisory only — not yet enforced. Stored on the policy for forward compatibility; the payment authority currently checks only max_amount_usd_per_request. None means no per-turn cap.
max_amount_usd_per_day: Option<f64>Maximum cumulative amount (USD) per UTC day. Advisory only — not yet enforced. Stored on the policy for forward compatibility; the payment authority currently checks only max_amount_usd_per_request. None means no per-day cap.
require_approval_above_usd: Option<f64>Threshold (USD) above which a request would require explicit human approval. Advisory only — not yet enforced. Stored on the policy for forward compatibility; no approval gate is wired up yet. None disables the (future) gate.
status: PaymentStatusCurrent lifecycle status of this policy.
metadata: ValueFree-form metadata attached to this policy.
created_at: DateTime<Utc>Timestamp when this policy was created (RFC 3339).
updated_at: DateTime<Utc>Timestamp when this policy was last updated (RFC 3339).
Trait Implementations§
Source§impl Clone for PaymentPolicy
impl Clone for PaymentPolicy
Source§fn clone(&self) -> PaymentPolicy
fn clone(&self) -> PaymentPolicy
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 PaymentPolicy
impl Debug for PaymentPolicy
Source§impl<'de> Deserialize<'de> for PaymentPolicy
impl<'de> Deserialize<'de> for PaymentPolicy
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>,
Auto Trait Implementations§
impl Freeze for PaymentPolicy
impl RefUnwindSafe for PaymentPolicy
impl Send for PaymentPolicy
impl Sync for PaymentPolicy
impl Unpin for PaymentPolicy
impl UnsafeUnpin for PaymentPolicy
impl UnwindSafe for PaymentPolicy
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request