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

# Local runs

> Run an eval against services on your own machine

A cloud sandbox cannot reach `localhost`. When the thing you are changing runs on your machine, `--local` runs the eval there instead:

```bash theme={null}
anpord eval --local ./checkout.eval.ts
```

No API key is needed, because nothing is sent anywhere. Every case runs on this machine and the results print in the terminal.

## Reaching a local service

Variables in `.env.local` and `.env` beside the eval file are given to the case, so a verifier can reach a service you are already running:

```bash theme={null}
# .env
API_BASE=http://localhost:1234
```

```ts theme={null}
cases: [
  {
    name: "the checkout completes",
    verify: 'test "$(curl -s $API_BASE/health)" = ok',
  },
]
```

`.env.local` wins over `.env`, and anything already set in your shell wins over both.

## What is forwarded

Addresses, and nothing else. A variable is given to a case when its name ends in `URL`, `URI`, `HOST`, `PORT`, `ENDPOINT`, `ORIGIN`, or `BASE`, **and** its value is a plain `http(s)` address, a hostname, or a port.

Both halves matter. `DATABASE_URL=postgres://user:password@host/db` is named like an address but carries a password inside it, so it is withheld. A local sandbox is a shell on your machine, and a value handed to it reaches the agent's context and the journal the run writes down.

An agent that needs a model key does not read one from your machine. When you have an API key set, the run leases the credential your organization already connected, for the one harness it names, expiring in fifteen minutes. It is held in memory and never written down, so nothing has to be kept locally.

Sandbox credentials are never leased: a local run opens no cloud sandbox. A lease is only issued for a run you started with `--local` and are executing yourself.

## What a local run is

A local run with an API key set is recorded like any other: it appears in the dashboard with its journal, marked as having run on your machine. What it does not get is a baseline. Its results were produced somewhere nobody else can inspect, so they never become the bar a later run is measured against, and `--fail-on regressed` has nothing to compare. The exit code reflects the result, so CI can gate on it:

```bash theme={null}
anpord eval --local ./checkout.eval.ts || exit 1
```

Without an API key nothing is sent anywhere, and the results only print.

## Requirements

The agent runs as you, on your machine, in a temporary workspace with its own `HOME`. It is not a container: a case can read and write what you can. Run evals you wrote or trust.

Harnesses install into `~/.anpord/local` and are reused, so the first local run of a harness is slower than the rest.
