# Platform engineers and agent builders

Build an agent or BI view on one headless Precise Access server. Request a private per-company workspace key (`penv_...`) at `https://sandbox.precise.ai` to run SQL and MCP tools against your isolated sandbox enclave. On your own deployment, discover the enabled profile and tools before submitting a tenant read or a buy.

## Headless Contract

1. **In-Cloud Read.** Read approved columns from a pinned table snapshot inside the tenant's warehouse. Keep raw delivery logs in that cloud.
2. **Exact Math.** Precise Gateway computes additive contributions directly. Eligible weighted-ratio games can use its deterministic Schwinger-Beta solver. Read the returned method and sample count for other games. [Estimator selection and worked examples](../data-and-measurement/methodology-and-holdouts.md)
3. **REST/MCP/AdCP + BI Rows.** REST and MCP expose the same product operations. Query results include `columns` and `rows` for charts. A2A exposes the agent skills. Direct Seller (AdCP) requires the buyer's spending authority.
4. **Offline Proof & DuckDB.** Rerun exported SQL on the pinned data to check a figure. Verify a signed proof with its expected subject and trusted key or root. [Offline verification](../security-and-infosec/offline-verification.md)

## Run one call now

This lists the sandbox's ten MCP tools using your authenticated workspace key (`Authorization: Bearer $PRECISE_SANDBOX_KEY`, automatically attached when you sign in on `sandbox.precise.ai`).

```json try mcp
{"jsonrpc": "2.0", "id": 1, "method": "tools/list"}
```

## The surfaces

| Capability | Runtime | Status |
|---|---|---|
| Discover the ten public MCP tools and five prompts | Sandbox | Live |
| Query, reopen runs and size a holdout over REST on the synthetic book | Sandbox | Live |
| Discover the public-test Access catalog and four cards on a configured server | Sandbox | Preview |
| Run six AdCP governance tasks, a buying workflow and read-only `buying_inspect` on spend-capable Access | Tenant Cloud | Preview |

```mermaid
flowchart LR
  agent["Your agent"] -->|MCP| mcp["Sandbox MCP server"]
  service["Your service"] -->|REST| rest["Sandbox REST routes"]
  mcp --> gateway["Precise Gateway"]
  rest --> gateway
  gateway --> book["Synthetic buying book"]
  gateway -->|run_id and digest| answer["Verified run"]
```

The sandbox's MCP tool `query` and its REST route `POST /api/sql/run` are one code path. The same SQL returns the same `run_id` on either.

## Discover the Access profile

Read `GET /api/v1/runtime`, `GET /api/v1/operations` and `GET /openapi.json` on Access. In the verified public-test configuration, all 34 catalogued operations had MCP tools. OpenAPI also lists the HTTP event stream and the route that reopens a connection. Tenant-read derives the tenant from the authenticated principal. The public-test profile exposes a synthetic book. A spend-capable deployment adds governance and authorized spending.

The four public-test MCP Apps resources are `ui://precise/cards/figure-card`, `ui://precise/cards/decision-card`, `ui://precise/cards/holdout-dial-card` and `ui://precise/cards/proof-verifier-card`. A headless caller reads the tool result as JSON. Rendering a card depends on the host.

Product figures carry three kinds of context when available.

1. **A plain sentence comes first.** Structured fields follow it.
2. **Read the evidence tier.** In the captured API, `said` labels a Forecast and `measured` labels recorded outcomes. Holdout-Proven requires an eligible comparison and confirmed delivery. Observed figures can come from logs alone.
3. **A figure carries its source.** The query or method, the tables read, the `run_id`, the approver and the proof file.

**Approved · Awaiting Readback** earns $0 until the buying platform confirms application. Crediting net gain also requires a settled measurement window.

## Discovery documents

These are live on the sandbox today.

| Address | Document |
|-|-|
| `/.well-known/mcp/server-card.json`, `/api/mcp/server-card` | The MCP server card: name, version, endpoint and protocol revisions |
| `/.well-known/ai-catalog.json` | An AI catalog entry that points at the card |
| `/.well-known/oauth-protected-resource` | RFC 9728 metadata: the four scopes and bearer workspace authentication |
| `/api/catalog` | The Gateway's own list: 64 methods and 5 workflows |
| `/api/guide` | What the tables, measures, methods and workflows mean, under one digest |

```sh try
curl -s https://sandbox.precise.ai/.well-known/mcp/server-card.json
```

Access also serves `/openapi.json` (OpenAPI 3.1), `/llms.txt`, `/llms-full.txt`, `/SKILL.md` and `/.well-known/agent-card.json`. These five documents returned HTTP 200 on the verified public-test Access server. They belong to that origin. The deployed measurement sandbox returns HTTP 404 for them.

This docs site ships its own `llms.txt`, `llms-full.txt`, `SKILL.md` and `openapi.json` at its root, so an agent can read these pages as plain text.

## Scopes and keys

The sandbox enforces per-company workspace isolation (`ENCLAVE_REQUIRE_KEY=on`) across four scopes. Every MCP and REST data call requires a valid workspace key (`penv_...`) sent via `Authorization: Bearer <key>` or the URL-scoped MCP endpoint `/api/mcp/<key>`.

| Scope | Allows |
|-|-|
| `precise:read` | Read the book, the guide, the track record and verified runs |
| `precise:query` | Run read-only SQL or a structured join on the pinned catalog |
| `precise:run` | Run Gateway analyses, workflows and holdout sizing |
| `precise:record` | Record a decision, score it and move the workspace clock inside your isolated enclave |

Request a private per-company workspace key on `https://sandbox.precise.ai`. Unauthenticated MCP and REST data calls fail closed with HTTP 401 (`workspace_required`). MCP clients must also inspect the JSON-RPC error and the tool result’s `isError` flag, including on HTTP 200.

## Where to go next

- [MCP and A2A](mcp-and-a2a.md): the ten sandbox tools, resources, prompts, protocol revisions and client setup.
- [REST API quickstart](rest-api-quickstart.md): the sandbox routes and the unified Access operation catalog.
- [AdCP governance and buying](adcp-governance-and-buying.md): spend plans, signed approvals and buying inside limits.
- [API and MCP playground](../../reference/playground.md): pick a tool or a query, edit it and run it.
- [Limits and errors](../../reference/limits-and-errors.md) and the [Standards map](../../reference/standards-map.md).
