> For the complete documentation index, see [llms.txt](https://docs.aftermath.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aftermath.finance/perpetuals/architecture/account/agent-wallets.md).

# Agent Wallets

Agent Wallets let you delegate trading permissions on a Perpetuals account to another wallet without giving up ownership of the account itself. This is useful for bots, automation, or managing permissions across an organization, while keeping a primary wallet as the account's admin.

### How it works

Each Perpetuals account is controlled by an admin capability. With Agent Wallets, the admin wallet can grant assistant-level permissions to a second wallet (the agent). Each grant mints a capability object owned by the recipient wallet, and an account can have up to 10 active agent wallets at a time (a protocol parameter). The agent wallet can then execute supported trading actions on behalf of that account. **The agent can perform all actions except withdrawing collateral**, granting or revoking other agent wallets, and revoking [builder code](/perpetuals/architecture/builder-codes-front-end-fee.md) approvals (agents can add approvals, but only the admin can remove them).

### Why use Agent Wallets

* Run automated strategies from a dedicated wallet
* Separate signing keys for risk management
* Keep long-term treasury/admin wallet isolated from execution
* Revoke permissions instantly if needed

{% hint style="warning" %}
Always use an agent wallet for any type of automation. Do not reuse your treasury/admin wallet for bot execution.
{% endhint %}

### Grant an Agent Wallet

Submit a transaction from the account admin wallet specifying:

* The `accountId`
* The `recipientAddress` — the wallet that should receive agent permissions

After on-chain confirmation, the recipient can trade on behalf of the account with assistant-level permissions.

**Endpoint:** `POST /api/perpetuals/account/transactions/grant-agent-wallet`

### Revoke an Agent Wallet

Submit a transaction from the account admin wallet specifying:

* The `accountId`
* The `accountCapId` of the assistant capability to revoke

After confirmation, the revoked wallet immediately loses its delegated permissions.

An agent can also renounce its own permissions at any time by destroying its capability, without involving the admin wallet.

**Endpoint:** `POST /api/perpetuals/account/transactions/revoke-agent-wallet`

{% hint style="info" %}
Running bots? You don't need SUI in your agent wallet. See [Gasless Trading (GasPool)](/perpetuals/architecture/account/gasless-trading.md) to sponsor gas from a central pool.
{% endhint %}
