> ## Documentation Index
> Fetch the complete documentation index at: https://sella.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sella agent operations: wallets, budgets, and policies

> Fund your agent's wallet, configure SKILLS.md policies, and govern purchase behavior with commerce_mode, buytemp, and budget limits.

Your agent transacts autonomously, but you set the guardrails. As an operator, you fund the wallet, define what the agent may buy, and configure the policies that govern every purchase decision — before the agent ever touches a payment.

## Fund the wallet

Paid calls draw from your agent's USDC wallet balance. You can add funds in two ways.

<CardGroup cols={2}>
  <Card title="From the dashboard" icon="credit-card" href="https://sellag.vercel.app">
    Sign in at [sellag.vercel.app](https://sellag.vercel.app) and add funds via checkout. Card payments convert to USDC automatically.
  </Card>

  <Card title="Direct transfer" icon="wallet" href="https://sellag.vercel.app">
    Send USDC to your agent's wallet address on Base, Solana, or Stellar.
  </Card>
</CardGroup>

You can also start a funding checkout programmatically:

```bash theme={null}
curl -X POST "https://sellag.vercel.app/api/funding/checkout" \
  -H "Authorization: Bearer sk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"amount_usdc": 50}'
```

The response returns a `checkout_url`. Open it in a browser to complete the payment; the balance is credited to your agent's wallet automatically once the card payment settles.

### Just-in-time funding

If the wallet runs dry mid-session, a paid call fails with `WALLET_UNFUNDED` and your agent surfaces a funding link. Click it, top up, and the agent resumes — no need to restart the task.

<Tip>
  Pre-fund a session budget before enabling autonomous buying. It's smoother than reacting to empty-wallet interruptions, and your policies cap the downside.
</Tip>

## Govern spend with SKILLS.md

`SKILLS.md` is your agent's constitution — a markdown file that tells Sella how your agent is allowed to spend. It drives the **Policy Engine**, which gates every purchase before any payment is authorized.

```markdown SKILLS.md theme={null}
# Commerce policy
commerce_mode: human-assisted     # human-assisted | autonomous | read-only
buytemp: 0.3                       # 0.0 = exploit known-good, 1.0 = explore freely
budget:
  session_usdc: 50
  per_purchase_usdc: 10
required_fields: [text, label]     # never buy datasets missing these
```

Place this file in your agent's working directory. Sella reads it at the start of each session and enforces it throughout.

<AccordionGroup>
  <Accordion title="commerce_mode" icon="shield">
    Controls how much autonomy the agent has. **Human-assisted** requires you to approve each purchase and is the safe default. **Autonomous** buys within budget limits without prompting you. **Read-only** lets the agent discover and evaluate listings but never make a purchase.
  </Accordion>

  <Accordion title="buytemp" icon="thermometer">
    A 0.0–1.0 dial that tunes exploration versus exploitation. Low values (closer to 0.0) favor proven, popular listings the agent already knows work well. High values (closer to 1.0) let the agent try novel or untested listings. Set it to match your risk appetite for the task.
  </Accordion>

  <Accordion title="budget" icon="piggy-bank">
    Hard caps enforced per session and per purchase. The Policy Engine checks these limits before producing any x402 payment signature — an over-budget purchase never reaches the wallet, regardless of agent behavior.
  </Accordion>

  <Accordion title="required_fields" icon="list-checks">
    Global schema requirements applied to every dataset purchase decision, on top of any per-search filters you specify. If a dataset is missing any field listed here, the Policy Engine blocks the purchase.
  </Accordion>
</AccordionGroup>

### The Policy Engine

Every purchase attempt passes through layered governance: `SKILLS.md` gates, `buytemp`, commerce mode, purchase history, and contextual task-fit checks. A purchase must clear every layer to proceed. No single signal can override the stack.

<Info>
  The Policy Engine and `SKILLS.md` are actively expanding. Start with `commerce_mode` and `budget` — those are the highest-leverage controls available today.
</Info>

## Monitor usage

Track spend, purchases, and per-tool activity from **Dashboard → Usage**, or read it programmatically using the usage endpoint.

```bash theme={null}
curl "https://sellag.vercel.app/api/agent/usage" \
  -H "Authorization: Bearer sk_live_your_key_here"
```

The response includes a breakdown of spend by session and by tool, giving you a clear picture of what your agent is buying and how much each task costs.

To inspect the active policy configuration — the settings currently in effect for your agent — use the policies endpoint:

```bash theme={null}
curl "https://sellag.vercel.app/api/agent/policies" \
  -H "Authorization: Bearer sk_live_your_key_here"
```

The response reflects the parsed state of your `SKILLS.md`: commerce mode, buytemp value, budget limits, and required fields. Use it to verify that your policy file was loaded correctly before a session begins.

## Security recap

The following controls are always in effect, independent of your `SKILLS.md` configuration.

<CardGroup cols={2}>
  <Card title="Keys never leave you" icon="lock" href="https://sellag.vercel.app">
    Private keys live in `~/.sella-wallet.json` on your machine. Sella never has custody.
  </Card>

  <Card title="Budgets are enforced" icon="shield-check" href="https://sellag.vercel.app">
    Hard limits in `SKILLS.md` cap spend regardless of agent behavior.
  </Card>

  <Card title="Replay-safe payments" icon="repeat" href="https://sellag.vercel.app">
    Each x402 payment carries a nonce and expiry, preventing replay attacks.
  </Card>

  <Card title="Rotate anytime" icon="key" href="/consumers/authentication">
    Re-[authenticate](/consumers/authentication) to mint a fresh key and retire the old one.
  </Card>
</CardGroup>
