Skip to main content
Grantex is the authorization and governance layer above a wallet, card, bank, or on-chain issuer. It does not replace custody, payment-network, or merchant controls. A production design combines all of these layers and fails closed if any required layer is unavailable.

Responsibility matrix

This division is deliberate. Issuer controls remain authoritative for movement of money. Grantex can make the authorization more precise by proving which agent may spend, for which principal, wallet, recipient, resource, action, project, purpose, and cost center. purpose, projectId, and costCenter are integrity-bound into the Grantex authorization and x402 exchange, but they originate with the caller. Grantex prevents an in-flight substitution; it does not independently prove that the caller chose the correct accounting label. High-assurance deployments must map these values from a trusted workflow, merchant order, or independently attested runtime context instead of accepting arbitrary model output.

Layered policy model

Every payment first passes the assignment baseline and then every matching layered policy. Grantex supports policy scopes for:
  • one wallet assignment;
  • one wallet across assigned agents;
  • one agent across assigned wallets;
  • a shared budgetGroup across agents and wallets;
  • one principal;
  • the developer tenant.
Policies can deny a matching payment, require principal approval, or limit amount and count. Limit windows can be per authorization, rolling seconds, calendar day, week, month, or lifetime. Optional filters match recipients, resource origins, action scopes, assets, networks, merchant IDs, purposes, project IDs, cost centers, and verified merchant status. The most restrictive applicable result wins:
  1. A deny policy rejects the payment.
  2. A limit breach rejects or requires approval according to onExceed.
  3. A matching approval policy requires approval.
  4. Only a fully allowed decision can reserve value.
Reserved and settled amounts count toward limits. Policy evaluation, usage calculation, and wallet reservation run under database locks, so parallel agents cannot race a shared group or principal budget.

Safe assignment defaults

New assignments do not silently allow every recipient, action scope, or HTTPS resource. The principal must provide an allowlist or explicitly opt into the corresponding allowAnyRecipient, allowAnyScope, or allowAnyResource setting. Existing assignments created before migration 092 retain their prior meaning during migration. An authorization can never add OAuth authority. The agent’s DPoP access token must contain wallet:spend and the exact merchant action scope even when wallet policy would otherwise allow the payment.

Exact principal approval

A require_approval result creates a short-lived durable request bound to the exact agent, principal, wallet, assignment, amount, asset, network, recipient, resource, action scope, merchant, purpose, project, cost center, policy set, and idempotency key.
Approval does not create a reusable spending token. A changed amount, recipient, resource, semantic context, wallet, or idempotency key is rejected. Successful reservation consumes the approval once.

Reload governance

Agents may request reloads but cannot approve or fund them. Wallet controls can set a maximum balance, maximum single reload, cumulative reload amount and window, and reload count and window. These controls are rechecked when the principal funds an approved request, not only when the agent asks for it. Reload and payment events are emitted to the Grantex event stream. Operators must bridge those events to email, SMS, chat, or another approved human channel when the principal is not actively using the dashboard.

Audit and emergency controls

Every policy decision has a durable decision ID, matched policy IDs, outcome, usage snapshot, and normalized payment context. Policy decisions are append-only. Wallet ledger entries are also append-only. The principal dashboard exposes pending approvals, policy status, wallet activity, reload requests, and stop controls. Blocking an assignment, a wallet, or all of one agent’s wallets releases active reservations in that boundary. Disabling or revoking a policy also releases active reservations. Policy mutation, release, authorization, and settlement share a developer-scoped database lock, so they have a single serial order and a released authorization cannot settle afterward.

Current implementation and external gaps

See Agent Prepaid Wallets, the x402 integration guide, and Prepaid Wallet Production Readiness for protocol and hosting details.
Last modified on August 31, 2026