AgentCap — and swaps SUI on DeepBook through the gated adapter. One swap within the cap is allowed. One over the cap is denied on-chain. After the owner revokes, the same swap halts.
Source on GitHub
altheia-sui-demo — the demo agent repo.What this shows
| Step | Action | Expected |
|---|---|---|
| 1 | Agent swaps 0.05 SUI (within the per-tx cap) | allowed, transaction lands |
| 2 | Agent swaps 0.2 SUI (over the per-tx cap) | denied over_per_tx_cap |
| 3 | Owner revokes in the dashboard, agent retries step 1 | denied policy_revoked |
Step 1 is a policy decision, not a guaranteed fill. The agent submits a gated DeepBook order; on a thin testnet book it can fill zero. Allowed means the policy permitted the action and the transaction landed — it does not assert the order filled.
Setup
1. Provision the agent
In the dashboard, provision an agent with:| Field | Value |
|---|---|
| Budget asset | SUI |
| Per-tx cap | 0.5 SUI |
| Per-day cap | 2 SUI |
| Allowed actions | swap |
| Scope | the DeepBook pool |
2. Configure
The loop
agentRefs derives the agent’s objects from its key. guardedSubmit dry-runs each swap: an allowed swap submits and the on-chain AllowedAction event indexes it; a denied swap is recorded to the Chronicle without spending gas.
What the run shows
Step 1 submits a real gated DeepBook order; the digest is on a Sui explorer. Step 2 aborts insidecheck_and_consume before any coin leaves the vault, and the denial is recorded. After the owner revokes (via the dashboard, signed with the OwnerCap), step 3 aborts policy_revoked — the same action that worked now halts.
Owner side
Revoke and the kill-and-drain are owner operations. In the dashboard the owner clicks Revoke (or Withdraw to wallet, which revokes and sweeps the vault back). Programmatically, with owner refs:Verify
Open the agent in the dashboard. The Chronicle has the allowed swap (settled, with a digest), the denied attempt (over_per_tx_cap), and the post-revoke halt.

SDK reference
AltheiaSui, agentRefs, builders, reads.