Skip to main content

What is an intent?

An intent represents a validated transaction request tracked through its full lifecycle. When an agent calls the Mandate API to validate a transaction, Mandate creates an intent record and tracks it from creation through signing, broadcast, and on-chain confirmation. Each intent has a unique ID, a state, and an expiration time. Intents exist because blockchain transactions are not instant. Between validation and on-chain confirmation, the transaction passes through multiple stages. Mandate tracks each stage to enforce time limits, manage quota reservations, and build an audit trail.

How does the state machine work?

Intents follow a strict state machine with 8 possible states. The entry point depends on which validation endpoint the agent uses: action-based validation creates an allowed intent, while raw validation creates a reserved intent. From there, the intent progresses through approval (if required), broadcast, and confirmation. The state machine is implemented in IntentStateMachineService. Every transition writes an audit event to the tx_events table with the actor (agent, owner, or system), the new state, and metadata. Terminal states trigger quota release or confirmation depending on the outcome.

What are the intent states?

StateDescriptionTTLTerminal
allowedValidated via action-based endpoint, ready to execute24 hoursYes
reservedValidated via raw endpoint, awaiting broadcast15 minNo
approval_pendingWaiting for human decision in the dashboard1 hourNo
approvedHuman approved, broadcast window open10 minNo
broadcastedTransaction hash posted, awaiting on-chain receiptNoneNo
confirmedOn-chain confirmed, quota committed permanentlyN/AYes
failedOn-chain reverted, cancelled, or envelope mismatch detectedN/AYes
expiredTTL exceeded without progression, quota releasedN/AYes
rejectedHuman rejected in the dashboardN/AYes
Terminal states (confirmed, failed, expired, rejected, allowed) end the intent lifecycle. Non-terminal states have TTLs enforced by a scheduled expiration job. When a non-terminal intent expires, Mandate releases any reserved quota back to the agent’s budget.

Who triggers each transition?

Five actors drive intent transitions. The agent initiates validation and reports broadcast. The owner approves or rejects. The system handles TTL expiration and envelope verification.
TransitionTriggerActor
[new] to reserved or allowedAgent calls validate endpointAgent
reserved to approval_pendingPolicy engine detects approval triggerSystem
approval_pending to approvedOwner clicks approve in dashboard or Slack/TelegramOwner
approval_pending to rejectedOwner clicks rejectOwner
reserved or approved to broadcastedAgent posts transaction hash via POST /intents/{id}/eventsAgent
broadcasted to confirmedEnvelope verifier confirms on-chain matchSystem
broadcasted to failedOn-chain revert or envelope mismatch detectedSystem
Any non-terminal to expiredScheduled TTL check finds past-due intentSystem
When an envelope mismatch occurs (the on-chain transaction does not match the validated parameters), the system transitions the intent to failed and trips the agent’s circuit breaker. This prevents further transactions until the owner investigates.

How does quota management interact with intents?

Mandate reserves quota when an intent is created and manages it based on the terminal state. This prevents agents from circumventing spend limits by creating many intents simultaneously. When the policy engine validates a transaction with a USD amount, the QuotaManagerService reserves that amount against the agent’s daily and monthly budgets. The reservation holds until the intent reaches a terminal state. Confirmed intents convert the reservation to a permanent spend record. Failed, expired, or rejected intents release the reservation, restoring the budget. An agent with a 1,000dailylimitthatvalidatesa1,000 daily limit that validates a 500 transaction has only $500 remaining for new validations, even before the first transaction confirms on-chain.

Next Steps

Intent States Reference

Complete reference for all intent states and their HTTP representations.

Validate Transactions

Step-by-step guide to validating and tracking transactions.

Handle Approvals

Implement approval workflows with polling and callbacks.

Intent Hash

How the intent hash binds validation to execution.