Skip to content

Agent settings ​

Last updated Nov 30, 2026 View as Markdown

An agent's settings, such as its target, its permission mode, and its variables, apply to its runs only. pandra config set --agent writes one for an agent you have pulled, built, or loaded:

terminal
sh
pandra config set --agent github.com/acme/reviewer permission-mode read-only
~/.config/pandra/config.toml
toml
[agents."github.com/acme/reviewer"]
permission-mode = "read-only"

Settings of one agent ​

[agents."<identity>"] takes these keys; the config.toml reference lists the rest, which instructions and skills describes:

KeyMeaning
targetThe target for this agent.
permission-modeauto (the default), bypass, or read-only (permissions). bypass skips the harness's permission checks. --permission-mode chooses the mode for one run over this key.
env.<VAR>A variable for the agent's runs (below).
mcp.<server>The MCP configuration for one of the agent's servers (allowing servers).
instructions-modeappend (the default) adds the agent's instructions to the harness's built-in instructions; replace puts them in place of the built-in ones.

With instructions-mode = "replace", the harness's built-in instructions, such as its guidance on its tools, are removed, while the permission checks and sandbox the harness enforces stay. What each harness loses is on its page: Claude Code, Codex, and Pi. A session keeps the mode it was created with.

Agent identity ​

An agent's table is named by its identity, which depends on how you refer to the agent, never on its version, so settings survive upgrades:

ReferenceIdentityNote
github.com/acme/reviewer@v1.2.0github.com/acme/reviewer
github.com/acme/agents/reviewer@v1.2.0github.com/acme/agents/reviewer
gitlab.com/acme/tools/agents//reviewer@v1.2.0gitlab.com/acme/tools/agents//reviewerOn hosts other than github.com, bitbucket.org, and codeberg.org, // separates the subdirectory.
ghcr.io/acme/reviewer:1.2.0ghcr.io/acme/reviewer
oci://codeberg.org/acme/reviewer:1.2.0oci://codeberg.org/acme/reviewerA registry on github.com, gitlab.com, bitbucket.org, or codeberg.org is written with oci://.
., ./reviewer, or ./reviewer.agent.tar/home/me/src/reviewer, the absolute pathIn a worktree that git worktree add made, the same path in the main checkout.
reviewerreviewer, the local nameFor a package built or loaded into the store.

--agent takes any reference and writes to the identity's table, so --agent . means the current project, and --agent github.com/acme/reviewer@v1.2.0 writes to [agents."github.com/acme/reviewer"]. In the file, write the key as Pandra shows it: a key in another spelling is an error that shows the key to write. pandra ps shows each run's identity.

pandra config set --agent and pandra config target use --agent need the agent in the store; a project directory or a package file only needs to exist. For an agent the store does not hold, they change nothing and print the command that fetches it, or pandra agent list for a local name, so a mistyped name never writes a setting that no run uses. pandra agent remove keeps the agent's settings, and an agent you pull again finds them. pandra config unset --agent removes a setting, also for an agent the store no longer holds.

A local project's settings follow its path, and every worktree of a repository shares the main checkout's. A moved directory, a second clone, or a checkout on another machine needs its settings written again.

Environment variables for agents ​

An agent inherits your shell's environment variables. To give runs a value, set it in one of four places; when several set the same variable, the narrowest wins:

WhereApplies toFor example
[defaults.env]every run, on every harnessproxies and certificates
[harnesses.<name>.env]every run of that harnessClaude Code's telemetry opt-outs
env.<VAR> in [targets.<name>]the runs that use that targetan LLM gateway's URL
env.<VAR> in [agents."<identity>"]the runs of that agenta variable the agent declares, such as the channel it posts to
terminal
sh
pandra config set defaults.env.HTTPS_PROXY http://proxy.corp.example:8080
pandra config set harnesses.claude-code.env.DISABLE_TELEMETRY 1
pandra config set \
    --target claude-work env.ANTHROPIC_BASE_URL https://llm-gateway.corp.example
pandra config set \
    --agent github.com/acme/notifier env.SLACK_CHANNEL alerts
pandra config secret set sentry-token --1password op://Work/Sentry/token
pandra config set --agent github.com/acme/notifier env.SENTRY_TOKEN \
    --secret sentry-token
pandra config unset --agent github.com/acme/notifier env.SLACK_CHANNEL
  • [defaults.env] and [harnesses.<name>.env] take literal values only. A target's and an agent's env also take a logical secret, with --secret, and a variable the agent declares as secret must be one.
  • Every PANDRA_* name, and, outside a target's env, the harness's credential variables, such as ANTHROPIC_API_KEY, are refused with the place to use instead, such as pandra config target set --login.
  • pandra config show --agent AGENT shows what is set for each variable the agent declares, and pandra run AGENT --dry-run shows each variable a run would get, with where it came from.

Which environment variables reach the agent ​

A harness and the processes it starts inherit your shell's environment variables, because git, gh, cloud CLIs, and proxies depend on them. Pandra removes a few, and adds the ones that describe the run. For example, when you start a run from a shell that has these variables, with a configuration that reads a secret from Bitwarden, on a Claude Code target whose credential is a subscription token:

In your shellIn the agent's environmentWhy
GITHUB_TOKEN=ghp_...the sameInherited, so gh and git work.
AWS_PROFILE=workthe sameInherited, also when a secret comes from AWS Secrets Manager, because the agent's own tools use it.
ANTHROPIC_API_KEY=sk-ant-...removedThe target's credential is the run's only one (target credentials). Without a credential on the target, it stays.
BW_SESSION=...removedIt serves only a secret store that your configuration uses. OP_SERVICE_ACCOUNT_TOKEN is removed the same way when a secret comes from 1Password.
PANDRA_SECRET_SLACK_TOKEN=...removedIt supplies a secret's value to Pandra only (supplying a value without its store).
PANDRA_QUEST_ID=..., in a quest's script that runs pandra runremovedPandra sets the PANDRA_QUEST_* variables for the script alone (scripts).
CLAUDECODE=1, from the Claude Code you started Pandra inremovedA parent harness sets it for itself. Pandra removes CLAUDE_*, CODEX_*, and PI_* the same way, except login and provider variables, such as CLAUDE_CODE_OAUTH_TOKEN, and the ones your configuration sets.
nonePANDRA_RUN_ID, PANDRA_AGENT, PANDRA_AGENT_DIGESTPandra sets the run's ID, the agent's identity, and its package's digest, so the agent and its commands can tell which run they are in. A run that an agent starts also gets PANDRA_PARENT_RUN_ID.

pandra run AGENT --dry-run lists the variables your configuration gives a run, each with the place it came from.

Security

There is no setting to filter these variables, and the agent and its tools can read every one of them.

Agents that run agents ​

An agent can run Pandra itself to hand work to other agents. [nested] sets how deep that goes:

~/.config/pandra/config.toml
toml
[nested]
max-depth = 2

max-depth is 1 by default: an agent you start can start other agents, and those cannot. 0 prevents nesting.

Security

These limits keep well-behaved agents from overreaching; they are not a security boundary.

A nested run:

  • uses the same Pandra, the same configuration file, and your own harness login;
  • never asks a question and never approves a package, even with --yes, so approve a remote agent first with pandra agent trust;
  • cannot change the configuration: each command that writes it refuses and says that you have to run it.

A nested run does not get PANDRA_SECRET_* variables or secret-store credentials. A secret it needs from such a source fails the check before the run. The error asks for a keychain or file source, and gives pandra --config-file PATH config secret set NAME --keychain, with the configuration file the run read as PATH, for you to run outside the agent. This matters most in CI, where secrets usually arrive as environment variables.

Show and edit the file ​

pandra config show lists each value with its file and line (Configuration shows an example). Each pandra config command validates the whole file before it saves, and keeps your comments and formatting. pandra config set writes any key, as a dotted path from the top of the file, or from the agent's table with --agent, or from the target's table with --target NAME:

terminal
sh
pandra config set defaults.permission-mode bypass
pandra config set targets.claude-work.model claude-opus-5-5
pandra config unset targets.claude-work.effort
pandra config set harnesses.claude-code.settings.permissions.allow '["Bash(npm test)", "Read"]'

A value under [harnesses.<name>.settings] is read as TOML. A list of Pandra's own, such as defaults.instruction-sources, takes the whole list as a TOML list, which replaces the list in the file. Every env.* value is a string, so env.DEBUG true sets "true".

Add to and remove from a list ​

pandra config add appends values to a list and pandra config remove takes them out, without writing the whole list again:

terminal
sh
pandra config add policy.allow-hosts \
    registry.npmjs.org internal.example.com:8443
pandra config add --agent ghcr.io/acme/reviewer vm.ports 3000:3000
pandra config remove --agent ghcr.io/acme/reviewer \
    policy.allow-hosts internal.example.com
pandra config add --target team args -- --add-dir /srv/shared

The policy and vm tables configure runs in a microVM (Running in a microVM), and pandra config add in the reference lists how each list takes its values.

pandra config edit opens the file in $VISUAL, $EDITOR, or vi and saves it only when it is valid; otherwise it shows each problem and asks again:

text
$ pandra config edit
warning: config.toml:30: unknown key "permision" in [agents."github.com/acme/notifier"]
? Edit again? [y/N]

To edit the file with another tool, or as an AI agent, which has no terminal for config edit:

terminal
sh
# Find the file
pandra config path
# Edit it with any editor, then check it
pandra config validate

pandra config validate reports each problem that config edit shows as a warning, such as the unknown key above, as an error: and exits 1.

  • Never write [allowed-servers] yourself: Pandra writes it when you allow an MCP server.
  • A pandra config command that writes during your edit can lose one of the two changes.

What overrides what ​

A setting can appear in several places. For each setting, the first place in its list that sets it wins.

The target:

  1. --target
  2. the agent's target
  3. defaults.target
  4. none: the harness Pandra finds (which harness runs)

The harness, provider, model, and effort (what decides a run):

  1. --harness, --provider, --model, and --effort
  2. the guild profile you name
  3. the target
  4. the harness's own defaults

The permission mode:

  1. --permission-mode
  2. the agent's permission-mode
  3. [harnesses.<name>] permission-mode
  4. defaults.permission-mode
  5. auto

An environment variable:

  1. the agent's env
  2. the target's env
  3. [harnesses.<name>.env]
  4. [defaults.env]
  5. your shell

The instruction and skill sources:

  1. --instruction-sources and --skill-sources
  2. the agent's instruction-sources and skill-sources
  3. the same keys in [defaults]
  4. none

The preloaded skills:

  1. the agent's preload-skills
  2. a guild member's preload-skills
  3. defaults.preload-skills
  4. none

The harness installation (which installation runs):

  1. --harness-version
  2. a pin in [harnesses.<name>]
  3. the harness on PATH
  4. the newest installation Pandra made

A target or an MCP configuration is used whole, with no merging of fields; only environment variables are layered. A --harness or --provider that differs from the configured target drops that target, and next to an explicit --target it is a usage error. pandra run AGENT --dry-run shows each value with the place it came from.

Released under the Apache License 2.0