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

# The agent harness native to your app

> Give your users an agent that can act — in its own sandbox, on your infrastructure, rendered in your UI.

```bash theme={null}
npm install nativeharness
```

```ts theme={null}
import { Harness } from "nativeharness";

const harness = new Harness({ model: new AnthropicAdapter() });
const workspace = await harness.workspace({ actor: "user-42" });

for await (const event of workspace.chat("add a test for the parser")) {
  render(event);            // tokens, commands, output, approvals — in your UI
}
```

That is a user with their own sandbox, their own files and their own agent. Run it for a
second user and nothing they do can reach the first.

## For your users, not for you

Most agent harnesses assume the person running the harness *is* the user: a developer at a
terminal, on their own machine. nativeharness is for developers building products, where the
agent works for **other people** — many at once, isolated from one another, inside your app.

<CardGroup cols={2}>
  <Card title="Your process" icon="microchip">
    A library, not a service. The harness, the workspaces and the sandboxes run on your
    infrastructure. The only thing that leaves is what you send to the model you chose — with
    a local model, not even that.
  </Card>

  <Card title="Your data" icon="database">
    Each workspace is one of your users or projects, in your storage — and exports to a
    portable directory you can import anywhere.
  </Card>

  <Card title="Your UI" icon="window">
    The agent is an event stream your frontend renders. No UI is imposed.
  </Card>

  <Card title="Your users" icon="users">
    Each gets their own sandbox, permissions, integrations and approvals.
  </Card>
</CardGroup>

## Safe to put in front of people

* **Every command runs in a sandbox**, hydrated from the workspace and thrown away after.
* **Containment is enforced in code.** The agent refuses to let a model's commands run on a
  provider that does not isolate — it will not construct, rather than warning.
* **Approval is on effects.** The harness reviews what a command *did* — the files it changed,
  the connectors it called — and can hold that for a person before anything is committed.
* **Bash is the only tool**, so there is one write path and every guard applies once.

## Without a model

`Harness` needs no model until you ask for a turn. Sandboxed, versioned, auditable command
execution is useful on its own:

```ts theme={null}
const harness = new Harness();
const workspace = await harness.workspace({ actor: "user-42" });

await workspace.write("/main.js", "console.log(41 + 1)");
const { result } = await workspace.exec("node main.js");   // "42\n", plus what changed
```

## Next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="play" href="/getting-started/quickstart">
    Five minutes, from install to an agent working in a workspace.
  </Card>

  <Card title="How it works" icon="diagram-project" href="/concepts/how-it-works">
    Workspace, sandbox, bash, connectors, turn — on one page.
  </Card>

  <Card title="Your users" icon="users" href="/guides/your-users">
    Actors, permissions, isolation and approvals.
  </Card>

  <Card title="Your UI" icon="window" href="/guides/your-ui">
    The event stream, and the HTTP binding your frontend talks to.
  </Card>

  <Card title="Connectors" icon="plug" href="/guides/connectors">
    Reach GitHub or your own API on a user's behalf, without the credential entering the sandbox.
  </Card>

  <Card title="Controlling the turn" icon="sliders" href="/guides/controlling-the-turn">
    Subagents, plan mode, compaction, and the ceilings that stop a stuck turn.
  </Card>
</CardGroup>

<Note>
  **Early.** The specs are drafts, published before the implementation so they can be argued
  with. The UI is the event protocol today, with reference components to come; storage ships
  as SQLite, one file per workspace; and the connector machinery is built and tested, but no
  connector ships yet.
</Note>
