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

# Trading

> Connect an identity's own brokerage account, and let its agents trade with a person approving each order.

An identity can connect **its own** brokerage account — `paper` (simulated money) or `live`, one of
each — over OAuth. An agent running a session as that identity can then read the account and quote,
and place an order, cancel one or close a position **only after a person approves that call**.

> [!WARNING]
>
> Naive Managed Agents is not a broker, a dealer or an investment adviser, and holds no customer money. The account, its orders and its fills belong to the brokerage and the person who owns it. Nothing Naive or an agent says about a symbol is investment advice, and an agent can be wrong. Start on `paper`.

## Connecting

1. Start the authorization from the identity's page in the dashboard (**Brokerage → Connect**), with
   [`vetta trading connect`](https://vetta.sh/docs/cli/trading), or with
   [`POST /v1/identities/{id}/trading/connect`](https://vetta.sh/docs/api/trading#connect).
2. Read the consent text shown first — every surface shows it before the link — then open the link and
   approve at the brokerage. The link works once and expires after 15 minutes.
3. The brokerage sends the browser back to the identity's page, which says whether it connected. The
   connection is now `active`.

A connection belongs to the identity, never to an agent or the organization: an agent reaches a
brokerage only through the identity its session selected. Connecting and disconnecting need a key
with `billing:write`; connecting a `live` account also needs a live `sk_live_` key.

Naive keeps one **sealed** access token per identity and env. No response, log or audit entry carries
it, and it is never placed in an agent's computer, so an agent cannot reach the brokerage around the
approval below. When the brokerage revokes access the connection turns `expired`: connect again.
**Disconnect** deletes the token; revoking Naive at the brokerage too is done in its own settings.

## In the dashboard

The identity's page has a **Brokerage** panel: each env's state (with the reason on a failed one),
Connect, Reconnect or Disconnect, and — for an active account — its open positions and open orders,
read-only. Orders are placed by an agent, the [API](https://vetta.sh/docs/api/trading.md#place-an-order) or the
[CLI](https://vetta.sh/docs/cli/trading.md), never from the panel.

## Agent tools

A session whose identity has an `active` connection is offered:

| Tool | What it does | Default policy |
| - | - | - |
| `trading.account` | Cash, buying power and equity. | the agent's default |
| `trading.positions` | Open positions. | the agent's default |
| `trading.orders` | Orders by status, or one order by `order_id`. | the agent's default |
| `trading.quote` | Latest bid and ask for one or more symbols. | the agent's default |
| `trading.place_order` | Place an order. | **ask** |
| `trading.cancel_order` | Cancel an open order. | **ask** |
| `trading.close_position` | Close a position, in full or in part. | **ask** |

The three writes name the account (`env`) on every call. By default each one pauses the session on an approval
card that says, in plain words, the account, symbol, side, size, type and any limit or stop price;
nothing reaches the brokerage until a person approves, and a decline sends nothing. An approval
covers that one call — it cannot be granted for the rest of a chat.

**The live account always asks.** An operator may set a write tool to `allow` in the agent's
[policy](https://vetta.sh/docs/concepts/policies.md); that is honoured only for a call whose `env` is `paper`. A call on the
`live` account — or one that does not say — still waits for a person. A surface that cannot pause a
call does not offer the writes at all.

An approved order is placed exactly once, even if the session is retried after the approval: the call
carries a stable `client_order_id`.

## What is not here

Opening or funding a brokerage account, trailing stops, bracket orders, historical prices, streaming
and watchlists. Order kinds placed elsewhere that Naive does not offer are left out of its lists.
Trading is not billed by Naive.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.