<!-- tempo-docs-context -->
> Source: [/docs/accounts/agents](https://tempo.xyz/developers/docs/accounts/agents.md)
> Section: [Accounts](https://tempo.xyz/developers/docs/accounts.md). Create accounts, connect wallets, read balances, send and receive payments, and reconcile deposits.
> [Documentation index](https://tempo.xyz/developers/llms.txt) · [Docs skill](https://tempo.xyz/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.xyz/developers/llms.txt) and Markdown pages directly.

# Give an agent access

Let an agent transact from your account with an access key. Set its budget, expiry, and allowed actions, then connect the signer to your payment client.

For an agent that pays for APIs, start with [Let an agent pay for services](https://tempo.xyz/developers/docs/wallet/recipes#let-an-agent-pay-for-services). The steps below use a key authorized to send test stablecoins to one recipient.

## Authorize the agent's task

:::steps
### Define what the agent can do

Choose the network, token, total or recurring budget, expiry, and contracts the agent needs to call. For a payment to a known recipient, scope the key to that token's transfer function and recipient.

For a custom [MPP client](https://tempo.xyz/developers/docs/guide/machine-payments/client), authorize the calls its payment mode requires. One-time payments can use `transferWithMemo`; payment sessions use channel operations. The linked limited-key example permits direct transfers only. Review the client's token, recipients, and contract calls before authorizing its key.

### Create and authorize a separate signer

Follow [Authorize a limited key](https://tempo.xyz/developers/docs/accounts/access-keys#authorize-a-limited-key). Create one key for the agent integration and have the account's root or admin key authorize it.

Store the agent's key in its runtime's secret storage. Keep the root key with the account owner.

### Connect the signer to the payment client

After authorization and before revocation, create a Viem client using `accessKey`, `alphaUsd`, and `tempoModerato` from the [authorization example](https://tempo.xyz/developers/docs/accounts/access-keys#authorize-a-limited-key):

```ts [Viem]
const agentClient = createClient({
  account: accessKey, chain: tempoModerato, feeToken: alphaUsd,
})
```

Use this client for the authorized AlphaUSD transfers on Moderato. For paid API requests, configure the [MPP client](https://tempo.xyz/developers/docs/guide/machine-payments/client) separately with a signer authorized for its payment calls.

### Show spending and end access

Show the agent's name, account, budget, expiry, and allowed actions in the account UI. Read the [remaining key budget](https://tempo.xyz/developers/docs/accounts/access-keys#read-the-remaining-permission) and [account activity](https://tempo.xyz/developers/docs/accounts/balances) to explain what it spent.

Provide a revoke action using the root or an active admin key. Wait for revocation to be confirmed before showing access as removed.
:::

## Keep account and request budgets distinct

Use the [access-key budget](https://tempo.xyz/developers/docs/accounts/access-keys#set-limits-that-match-the-task) for the account's spending allowance and a per-request limit for each purchase. Tempo Wallet CLI exposes `--max-spend`; its [agent and script mode](https://tempo.xyz/developers/docs/cli/wallet#agent-and-script-mode) shows how to preview and pay for a request.
