---
url: /integrations/editor.md
---
# Running an agent in an editor

`pandra run AGENT --acp` serves the agent over the [Agent Client Protocol](https://agentclientprotocol.com) (ACP), so an editor such as [Zed](https://zed.dev) runs it in its agent panel; [ACP's list of clients](https://agentclientprotocol.com/get-started/clients) names the other editors that can. Each conversation you open there is a Pandra session. In Zed, add the agent to `agent_servers` in your settings ([Zed's external agents](https://zed.dev/docs/ai/external-agents)):

```json
{
  "agent_servers": {
    "pandra": {
      "type": "custom",
      "command": "pandra",
      "args": ["run", "github.com/acme/reviewer@v1.2.0", "--acp"]
    }
  }
}
```

Before you add the command to the editor, check it on a terminal. With `--dry-run`, it lists every problem, including those the endpoint checks only when a conversation opens, and starts nothing:

```sh
pandra run github.com/acme/reviewer@v1.2.0 --acp --dry-run
```

```text
Run plan for github.com/acme/reviewer@v1.2.0 (nothing was started)

Agent       github.com/acme/reviewer (sha256:2a0123b71802)  approved 2026-11-02
Harness     claude-code
Backend     host
Permission  auto
Mode        acp                                         --acp
Prompt      none
Workspace   the client's directory

Checked when the run starts: model and effort support, secret values, harness version support

Ready to run.
```

Options you add to `args`, such as `--harness`, `--model`, or `--target`, apply to every conversation. The editor sends every prompt and chooses each conversation's directory, so `--acp` rejects options such as `--prompt`, `--json`, and `--workspace` ([`pandra run`](/reference/cli.md#pandra-run)), and the agent's prompt is never sent. The endpoint never asks a question, so with several harnesses installed and none chosen, give `--harness` or `--target`, or every conversation fails with `harness_ambiguous`.

## What the endpoint checks

* **When the editor starts the command**, Pandra resolves the agent. A package that needs approval fails the command, with the error on standard error, which an editor may show only in its logs. Approve the agent on a terminal first, with `pandra pull` and then `pandra agent trust`, so you see what it contains.
* **When the editor opens or resumes a conversation**, Pandra reads your configuration again and checks inputs without values, servers that are not allowed, and the harness. A problem fails that conversation with an error that lists the commands that fix it. Fix them on a terminal, for example with `pandra config setup github.com/acme/reviewer@v1.2.0`, and open a new conversation; the agent does not need a restart.

## Conversations and sessions

Each conversation is an ordinary session that works in the directory the editor sends: `pandra ps` lists it, and `pandra resume` continues it on a terminal once the editor has closed it. The editor can also resume a session you started with `pandra run`, and its list of earlier conversations shows the agent's idle sessions. Pandra does not send the editor a resumed conversation's earlier messages.

Closing a conversation in the editor stops its harness and leaves the session; remove sessions you no longer need with `pandra session remove` or `pandra session prune`. When the editor disconnects, or Pandra receives SIGTERM or SIGHUP, every session closes the same way, and you can resume it later.

## Permission requests and questions

When the harness asks permission for a tool call, the editor shows the tool and its input with the options **Allow**, **Reject**, and, when the harness offers it, **Allow for this session**. On Claude Code, that last option adds the rule Claude Code suggests for this session only, never to a settings file. Under the default `permission-mode = "auto"`, the harness decides most actions itself ([permissions](/harnesses/permissions.md)); with `bypass` or `read-only`, the editor gets no requests.

When the agent asks you a question, as Claude Code does with its `AskUserQuestion` tool, an editor that supports ACP's forms ([elicitation](https://agentclientprotocol.com/protocol/v1/elicitation)) shows it as a form. Without forms, the question is declined, as in a headless run.

## MCP servers from the editor

An editor can add MCP servers of its own to a conversation; Zed, for example, passes the [MCP servers configured in it](https://zed.dev/docs/ai/mcp). Pandra adds them beside the agent's own servers, as your choice made through the editor, so they need no allowing in your configuration.

* Keep tokens in the server's environment variables and headers, never in an argument or a URL's query: Pandra passes those values to the harness by reference, while the command, its arguments, and the URL go into the harness's configuration as written.
* A server with the name of one of the agent's own servers is left out, with a warning, and the agent's server is used.
* An SSE server, a name outside lowercase letters, digits, `-`, and `_`, and a server whose values the harness cannot receive intact ([how values reach servers](/mcp-servers/allowing.md#how-values-reach-servers)) fail the conversation before a session exists.
* `pandra resume` on a terminal runs without them; an editor that resumes the session passes its servers again.

## Agents in a microVM

With `--backend vm` among the arguments, such as `run github.com/acme/reviewer@v1.2.0 --backend vm --acp`, every conversation of the editor runs in a microVM of its own ([Running in a microVM](/run/vm.md)). `--backend` and the VM options, `--cpus`, `--memory`, `--network-preset`, `--allow-host`, and `--publish`, apply to every session of the endpoint.

* The MCP servers the editor provides are left out of VM sessions, with one warning, `runtime_mcp_not_supported_in_vm`: a stdio server names a program on your computer, and an HTTP server may listen on its loopback.
* When the agent tries to reach a destination that is not allowed, and allowing it can help, the editor asks with a permission request, and allowing it allows the destination for the session.
* A thread that the editor opens and closes before its first prompt can leave a session that cannot be resumed. `pandra session remove ID` removes it, and so does `pandra system prune --sessions`.
