# Safety & spend control

Agents act on your behalf, sometimes many times in a row. These controls keep them from spending credits by surprise, leaking secrets or following instructions hidden in listing data.

## Start with a test key

A test key (`au_test_...`) returns free, simulated results through exactly the same tools and errors as a live key. Use one while you build, evaluate and demo an agent. Results carry the `synthetic_result` note and `model.synthetic: true`, and the agent should say they are simulated.

OAuth connections are **always live**. If you want an assistant to be free to experiment, connect it with a test key header instead of OAuth.

## Limit what a live connection can spend

| Control | Where | Effect |
| --- | --- | --- |
| Monthly credit limit | Per key, in **API keys** | The key stops with `key_spend_limit_reached` (402) once it has used its limit this month. |
| Scopes | Per key, or approved on the OAuth consent page | Without `valuations:write`, `valuate_car` is refused with `insufficient_scope`. A catalogue-only agent needs just `catalogue:read` and `account:read`. |
| Markets | Per key and per workspace | Valuations in other markets are refused with `country_not_enabled`. |
| Workspace credits | **Billing** | When credits run out, live valuations stop with `insufficient_credits` (402). There are no automatic card charges. |
| Revocation | **API keys**, or removing a member | Takes effect on the next call. |

Errors never consume credits, and neither do refusals, failures or replays.

## Ask before spending

Instruct the agent to call `get_account` first and to confirm before each live valuation, or before a batch with its maximum cost. See the [system prompt example](/docs/mcp/examples#a-system-prompt-for-valuation-assistants).

Use your client's approval features as a second line of defence:

- In the OpenAI Responses API, keep `require_approval` on for `valuate_car` and allow only the read-only tools to run without approval ([example](/docs/mcp/openai#responses-api)).
- In IDE agents, leave tool-call confirmation on for `valuate_car`.
- The tools carry MCP annotations: `get_account`, `get_valuation` and `search_vehicles` are marked read-only and idempotent; `valuate_car` is not read-only. Clients can use these to decide what needs approval.

## Retry without double charging

Give each intended valuation a new `idempotency_key` and reuse it only to retry that same request. A replay returns the recorded outcome with `usage.credits_used: 0`. Never loop on `insufficient_credits`, `key_spend_limit_reached` or validation refusals: they will not succeed without a change. See [idempotency](/docs/concepts/idempotency).

## Treat listing data as untrusted

Descriptions, listing pages and photos come from third parties. They can contain text such as "ignore your instructions". Agents must treat them as data about the vehicle, never as instructions, and must not follow links or commands found in them. AutoUncle also treats them as data: the service only extracts vehicle attributes from them.

## Keep personal data out

Send vehicle attributes, not people. Remove owner names, phone numbers, email addresses and addresses from descriptions before an agent sends them. VINs and registration plates are optional; the raw values are not kept in valuation records.

## Keep keys out of prompts

- Configure keys through environment variables or your client's secret input. Never paste a key into a chat, a system prompt, a shared config file or a ticket.
- Each developer should use their own key. Revoke a key as soon as it may have been exposed.
- Logs should contain the key ID (`key_...`) or the request ID, never the secret.

## Present results responsibly

A valuation is an estimate of an asking price in one market, not an offer, an appraisal or financial advice. Agents should always report the price basis, currency, interval and precision grade, keep the notes, and show `attribution_text` when present. See [precision](/docs/precision) and [notes and data sources](/docs/notices).
