> ## 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.

# How Vetta works

> Three layers — harness, tools, runtime — optimised together for cost per finished task.

export const Levers = ({items, cols}) => <div style={{
  display: "grid",
  gridTemplateColumns: `repeat(${cols || 2}, minmax(0,1fr))`,
  gap: "12px",
  margin: "1.5rem 0"
}}>
    {items.map((it, i) => <div key={i} style={{
  border: "1px solid rgba(0,0,0,0.10)",
  padding: "16px 18px",
  background: "#ffffff"
}}>
        <div style={{
  fontSize: "13px",
  fontWeight: 500,
  color: "#777777"
}}>{it.k}</div>
        <div style={{
  fontSize: "15px",
  fontWeight: 500,
  margin: "6px 0 4px",
  letterSpacing: "-0.02em",
  color: "#000000"
}}>{it.v}</div>
        <div style={{
  fontSize: "14px",
  color: "#555555",
  lineHeight: 1.5
}}>{it.d}</div>
      </div>)}
  </div>;

Vetta is a **managed agent for long-horizon tasks**, optimised for cost at every layer. You configure the whole agent — model, system prompt, tools, skills, budget, completion window, and the **harness** that runs the loop. Vetta operates all three layers below so that a finished task costs as little as possible.

## The three layers

<img src="https://mintcdn.com/vetta/rjfQyQrWaQ5bFTTq/images/three-layers.svg?fit=max&auto=format&n=rjfQyQrWaQ5bFTTq&q=85&s=1156aebe4972c05afd917251d3de2976" alt="The three layers: harness, tools, and the runtime" width="1240" height="470" data-path="images/three-layers.svg" />

<Levers
  cols={3}
  items={[
{ k: "Harness", v: "The agent loop — configurable per agent", d: "Assemble the turn, call the model, parse tool calls, decide what carries forward. Several loops, one field — and the layers below do not change when it does.", accent: true },
{ k: "Tools", v: "What the harness reaches for", d: "Computer, browser, storage, skills, identity, connections, MCP — every call resolves allow / ask / deny and is priced before it runs." },
{ k: "Runtime", v: "The managed infrastructure", d: "Durable state and scheduling, model routing and the completion window, budget enforcement, sandboxed computers, the ledger." }
]}
/>

<Note>
  **Optimising all three together** is the product — a cheap model on a wasteful loop, or a tight loop on infrastructure that bills an idle machine, both end up expensive.
</Note>

## The harness (`harness`)

The harness is the agent loop: assemble a turn, call the model, parse tool calls, decide what carries into the next turn. It is configurable per agent, and **`pi` is the default**:

```json theme={"system"}
{ "harness": "pi", "model": "zai-org/GLM-5.2-FP8", "window": "loose" }
```

The field is a stable seam: switching harnesses for one agent changes nothing about the durable loop, the budget gate, the tool surface, or the policy layer beneath it.

Which loops exist, what each can be admitted for, and what an idle session on one costs are all in **[Harnesses](/docs/concepts/harnesses)** — and readable at runtime from [`GET /v1/harnesses`](/docs/api/harnesses), because a harness needs an adapter compiled in and an environment can have a different set.

## The runtime

The runtime is everything under that seam — the managed infrastructure every agent runs on:

* **[Durable loop & scheduling](/docs/concepts/runtime)** — wake, one bounded turn, commit, sleep. A crash loses one turn, never the run.
* **[Sandboxed computers & browser](/docs/capabilities/computer)** — a disposable micro-VM per agent, paused between turns; idle time meters storage.
* **[Model routing & completion window](/docs/concepts/completion-window)** — one model, three lanes; unsupported lanes are refused, never downgraded.
* **[Budget enforcement](/docs/concepts/budgets)** — every call quoted against the cap *before* it runs, refused over it.
* **[The ledger](/docs/capabilities/observability)** — five-tier token accounting in integer micro-USD, per session and agent.

### The durable loop

<img src="https://mintcdn.com/vetta/rjfQyQrWaQ5bFTTq/images/durable-loop.svg?fit=max&auto=format&n=rjfQyQrWaQ5bFTTq&q=85&s=c979fee5c246d668f3e7ac4fc77ce3ab" alt="The durable loop: wake, one bounded turn, commit, sleep, repeat" width="900" height="360" data-path="images/durable-loop.svg" />

An hours-long run is a sequence of bounded turns, not a machine held hot. Only the turn is metered compute; between turns the micro-VM is paused, so waiting meters storage. State commits every turn — a crash costs one turn, never the run.

## The tools

One interface to a [computer](/docs/capabilities/computer), a browser, [storage](/docs/capabilities/files), [skills](/docs/capabilities/skills), [identity](/docs/capabilities/identity), [connections](/docs/identity/connections), and [MCP servers](/docs/capabilities/tools#mcp-connector). Every call passes [policy](/docs/concepts/policies) — `allow` / `ask` / `deny` — and is priced before it runs.

What this stack does to cost per finished task is measured on the published [benchmark](https://usenaive.ai/benchmarks).

<Card title="Next: the completion window" icon="gauge" href="/docs/concepts/completion-window">
  Three prices for one model, chosen per request.
</Card>
