---
url: /harnesses/pi.md
---
# Pi

Pi has no permission checks, so a Pi run starts only in `bypass` or in `read-only`, where Pi gets only tools that read ([Pi's permissions](/harnesses/permissions.md#pi)). To run a review in `read-only`:

```sh
pandra run github.com/acme/agents/reviewer --harness pi \
    --permission-mode read-only \
    --prompt "Review the uncommitted changes."
```

Without the option, the mode comes from your configuration, such as `harnesses.pi.permission-mode` ([which setting wins](/harnesses/permissions.md#which-setting-wins)).

How Pi differs from the other harnesses is in the [comparison](/harnesses/choosing.md#how-the-harnesses-differ).

## Providers and models

Pi takes a provider only together with a model. `--provider` needs `--model`, unless the provider is Pi's `defaultProvider` with a `defaultModel`:

```text
$ pandra run . --harness pi --provider github-copilot --prompt "Review PR 12."
error: pi needs a model with a provider; add --model MODEL
  To make github-copilot pi's default provider (1 of 2):
    pandra config set harnesses.pi.settings.defaultProvider github-copilot
  To set pi's default model of that provider (2 of 2):
    pandra config set harnesses.pi.settings.defaultModel MODEL
```

A [target](/configure/targets.md#targets) follows the same rule: a Pi target with a `provider`, or with a credential, needs a `model`, unless Pi's `defaultProvider` and `defaultModel` settings already name that provider. Pandra refuses any other such target, and names both fixes:

```sh
# Name the model in the target, after defining its secret
pandra config secret set openai-api-key --env OPENAI_API_KEY
pandra config target set pi-work --harness pi --provider openai \
    --model gpt-6.1-sol --login api-key --secret openai-api-key
# Or make openai Pi's default provider, with its default model
pandra config set harnesses.pi.settings.defaultProvider openai
pandra config set harnesses.pi.settings.defaultModel gpt-6.1-sol
```

Pi uses its built-in model catalog, and refreshes it from pi.dev only when the target lists the `model-catalog` harness feature. A model newer than that catalog needs its provider: give `--provider`, or write the model as `provider/id`, as in `--model openai-codex/gpt-5.5`. An `effort` on such a model runs with a warning that Pi cannot confirm the level.

## Login

Pandra reuses Pi's `auth.json` and `models.json`, and its API key and token environment variables. A [target's credential](/configure/targets.md#target-credentials) can supply a login instead, for these providers:

| Provider | `--login` | Variable |
| --- | --- | --- |
| `anthropic` | `api-key` | `ANTHROPIC_API_KEY` |
| `anthropic` | `subscription` | `ANTHROPIC_OAUTH_TOKEN` |
| `openai` | `api-key` | `OPENAI_API_KEY` |
| `openrouter` | `api-key` | `OPENROUTER_API_KEY` |

The key of another provider Pi knows is an ordinary variable of the target, which reaches the run as its real value, without the proxy.

## Settings

Keys of Pi's `settings.json` go under `[harnesses.pi.settings]`, such as `defaultProvider` and `defaultModel`; Pandra refuses the keys it sets itself, with the reason ([harness programs and runners](/configure/targets.md#harness-programs-and-runners)).

## Harness features

A target's `harness-features` lets a run reach this, which is off unless listed ([targets](/configure/targets.md#targets)):

| Feature | Lets the run reach |
| --- | --- |
| `model-catalog` | the refresh of Pi's model catalog from pi.dev, and the downloads of its `fd` and `rg` tools; without it, Pi runs offline on its built-in catalog |

## MCP servers

These values stop a run before Pi starts, with `mcp_value_undeliverable`, and `pandra run --dry-run` shows them:

* A remote server that connects over SSE, which Pi does not support. When the server's registry entry offers another method, choose it ([choosing another execution method](/mcp-servers/methods.md#choosing-another-execution-method)).
* A local server's argument that is `~` or starts with `~/`, which Pi would replace with your home directory.

With `secret-proxy = false` ([harness programs and runners](/configure/targets.md#harness-programs-and-runners)), Pi gets the real secret values and follows redirects by its own rules. When a remote server redirects it to another origin, it drops only `Authorization`, so the server's other secret headers reach that origin.

## Installation on musl systems

Pi publishes only glibc builds for Linux. On musl systems such as Alpine, install Pi's npm package and point Pandra at it with `pandra harness use pi --path PATH`.

## Skills

Pi has no skill namespaces and gets every skill under its bare name. Pandra does not rewrite skills or instructions, so text that refers to `superpowers:brainstorming` does not match the name on Pi.

## Instructions

When you [add the instructions your harness reads](/configure/instructions-and-skills.md#add-the-instructions-your-harness-reads), a Pi run gets these files:

* `home`: the first of `AGENTS.override.md`, `AGENTS.md`, `AGENTS.MD`, `CLAUDE.md`, and `CLAUDE.MD` in `~/.pi/agent`, or in `$PI_CODING_AGENT_DIR`.
* `repo`, in each directory from the repository's root down to the workspace: the first of the same names.

With `instructions-mode = "replace"` ([settings of one agent](/configure/agent-settings.md#settings-of-one-agent)), the agent's instructions take the place of Pi's coding role and tool rules.

Pi builds its instructions at every launch, so an edit to an instructions file reaches a resumed conversation at the resume.

## Files Pi changes in the workspace

Pandra leaves a workspace's harness files as they are, but Pi changes one itself: it renames a workspace's `.pi/commands/` directory to `.pi/prompts/` when it starts there.
