Configuration
View as MarkdownThe configuration file
The command reads ~/.dex/agents/HARNESS.yaml unless --config names another file. The file is YAML 1.2. Only true and false are booleans, so yes and off are strings and fail the schema. A key repeated in one mapping is an error. An empty file means every default.
model: claude-opus-5-5
system_prompt: |
You are my personal assistant. Ask before posting anything.
dex:
server: auto
connectors:
mcp: auto
enabled:
- slack/support-slack
- hackernews
- gmail/personal:
tools: [get_message, send_message]
approval:
always: [slack_post_channel_message]
workspace: ~/dex-agent-workspace
local_tools:
files: true
shell: {enabled: true, allow: ["git status", "ls"]}
web_fetch: true
browser: true
media:
store: auto
sessions:
summary: auto
lease_ttl_seconds: 600
claude: {}
| Field | Default | Meaning |
|---|---|---|
| model | The command's default model | A non-empty model ID in the harness's format. See Commands. |
| system_prompt | The harness's instructions | The agent's instructions. |
| system_prompt_file | None | A UTF-8 file whose text is the instructions. Set either this or system_prompt, not both. |
| dex.server | auto | auto reuses or starts the local dexcli dev. Otherwise an http or https URL of a Dex server. See The local Dex server. |
| dex.auth.mode | none | Since 0.6.2. How the command authenticates to the Dex server: none, api_key, or bearer. See Run against a remote Dex server. |
| dex.auth.token_url, dex.auth.server_id | None | Since 0.6.2. With api_key: the token endpoint that exchanges DEX_API_KEY, and the server ID of the access tokens. |
| dex.auth.source, dex.auth.file | None | Since 0.6.2. With bearer: env reads the token from DEX_CREDENTIAL; file reads it from the file that file names. |
| dex.tls.ca_file, dex.tls.server_name | None | Since 0.6.2. With an https dex.server: a PEM file of root CAs to trust as well, and the name the server certificate must match. |
dex.payload_encryption.key_file | None | Since 0.6.19. A payload key file. The command encrypts the session payloads it writes with it. DEX_CODEC_KEY_FILE overrides it. See Payload encryption. |
| connectors.mcp | auto | The Connectors MCP server. auto runs dexcli connectors mcp for this machine's ~/.dex/connectors/connections.json, with any dex.server; see Connectors. Otherwise an http or https URL on 127.0.0.1, localhost, or [::1]. Changed in 0.6.9: auto used the server of dexcli dev, and had none with a URL dex.server. |
| connectors.enabled | Every authorized connection | The connections, and their operations, that the agent may call. See Connectors. |
| mcp_servers | Empty | Since 0.6.4. Remote MCP servers whose tools the agent may call, by name. See Remote MCP servers. |
| approval.always | Empty | Tool names, as the agent sees them, whose every call waits for approval. They add to the approvals the tools already require. No approval mode or rule approves them. |
| approval.auto_modes | [low_risk] | Since 0.6.20. The approval modes sessions may switch to besides ask. [] turns approval modes and rules off. all is on only when listed. See Approval modes. |
| approval.default_mode | ask | Since 0.6.20. The mode a new session starts in: ask or a mode in auto_modes. |
| workspace | ~/dex-agent-workspace; for dex-agents-pi, the directory the command starts in | The only directory the file tools use, and the working directory of shell commands. dex-agents-pi uses it only as the working directory; see Harnesses with their own tools. |
| local_tools.files | true | Read, write, list, and search files in the workspace. |
| local_tools.shell.enabled | true | Run shell commands in the workspace. |
| local_tools.shell.allow | Empty | Commands that run without approval. A command matches only when its whole text equals an entry. |
| local_tools.web_fetch | true | Fetch web pages. |
| local_tools.browser | true | Drive a local headless browser. |
| media.store | auto | Where the session's images are stored. auto is ~/.dex/agents/media on this machine. s3://BUCKET or s3://BUCKET/PREFIX is an S3 bucket. See Images. |
| media.endpoint | None, which means AWS S3 | The http or https URL of an S3-compatible service, such as http://127.0.0.1:9000. Valid only with an s3:// store. |
| sessions.summary | auto | Since 0.6.0. Whether each session keeps the indexed title, last activity time, and turn count that sessions shows. auto keeps it with dex.server: auto only, and leaves a Dex server URL alone, because that server may be shared. Changed in 0.6.19: with payload encryption on, auto stops writing the summary, because the title is plaintext; see Payload encryption. on keeps it with any server, and off never. The command refuses to start when its harness builds a session Flow whose declared persistence schema does not follow this setting. The check verifies what the Flow declares; it does not sandbox harness code. See List sessions for what it stores and the index keys it registers. |
| sessions.lease_ttl_seconds | 600 | Since 0.6.9. How many seconds a session's terminal lease lasts without a renewal, from 10 to 3600. DEX_AGENTS_SESSION_LEASE_TTL_SECONDS overrides it. See One terminal per session. |
| claude, openai, pydantic_ai, deepagents, google_adk, vercel_ai, mastra, pi, builtin | Empty | The options of one harness. Each command reads only its own section. |
Other keys are errors, and null is never valid: omit a field to take its default. In system_prompt_file and workspace, a leading ~ is the home directory, and a relative path is relative to the file's directory.
A URL takes no user info, such as user:pass@. The command rejects a URL with invalid_url when an IPv4 part is over 255 or has a leading zero, the IPv6 address is invalid, a DNS label starts with xn--, or the port is over 65535.
The configuration schema defines every field. A file that fails it stops the command with the error code and the JSON Pointer of the problem, such as schema at "/local_tools/shell/allow". Since 0.6.0, the error for a field that takes one of several forms, such as dex.server, also names the forms it takes.
When the command cannot reach the Dex server at all, it stops with one line that names the server's address and says how to fix it: run dexcli dev for auto, or start the server that dex.server names. A server that answers but reports UNAVAILABLE is named with its details and a hint to try again. Changed in 0.6.0: these lines replace the raw gRPC error. A server that rejects the credential is named the same way; see Run against a remote Dex server.
Harness options
Only the Pi command has options. Every other harness section must be empty; any key in it is a configuration error.
| Field | Default | Meaning |
|---|---|---|
| pi.load_project_context | true | Each model call adds the project context files after the instructions, as Pi does: the AGENTS.md in Pi's global directory, ~/.pi/agent, and the one in the workspace and in each directory above it, outermost first. In each directory, the first of AGENTS.override.md, AGENTS.md, AGENTS.MD, CLAUDE.md, and CLAUDE.MD counts. |
| pi.bash_timeout_seconds | 120 | Seconds a bash command runs when the model passes no timeout. A whole number from 1 to 600. Pi has no default timeout, but cancelling a turn waits for a running tool call, so the command keeps one. |
| pi.provider_base_urls | Empty | An http or https URL per provider that replaces the URL in pi-ai's catalog, such as a proxy. |
The Pi command reads the context files in every model call, so an edited file applies from the next model call. Each file is at most 1 MiB. A file that is a link to another directory, has more than one hard link, or, above the workspace, belongs to another user, is skipped with a warning.
Session settings
Each session has a settings JSON object of at most 16 KiB. It is set when the session starts and changed with update_session_settings, such as from the Conversation tab in Dex Web. The command reads the settings at the start of every turn. They can change the model and the instructions. They can only narrow the rest of the file, because anyone who can edit the session in Dex Web can edit its settings.
| Field | Rule |
|---|---|
| model | Replaces the file's model. |
| reasoning_effort | Since 0.6.2. Sets the reasoning effort of every model call to one of the values the command offers. Omitted, the model's own default applies. See Model and reasoning effort. |
| system_prompt | Replaces the file's system_prompt or system_prompt_file. |
| connectors.enabled | Replaces the file's list. Each entry must fall inside one of the file's entries: the same connector, the same connection unless the file's entry names none, and a subset of its operations unless it lists none. When the file has no list, any list narrows it. |
| approval.always | Adds tools to the file's list. |
| local_tools.files, web_fetch, browser, shell.enabled | false switches the tool group off. true is allowed only where the file has true. |
| local_tools.shell.allow | Replaces the file's allow list with a subset of it. |
Other top-level keys are ignored, so other readers can keep their own keys in the settings. This includes dex, workspace, system_prompt_file, media, sessions, and the harness sections, which belong to the file only. The command prints each ignored key as a warning, and the turn still runs. Inside a known field, an unknown key is an error, so connectors.mcp fails.
Settings that fail the schema or widen the file are rejected as a whole. The turn fails with the error code and the JSON Pointer of the first problem. The session keeps its settings until someone fixes them. The session settings schema defines every field. Settings are stored in the session, so never put a secret in them. See Credentials.
Model and reasoning effort
Since 0.6.2. The settings' model and reasoning_effort pick the model and its reasoning effort for the next turn. The configuration file stays as it is: its model is the default, and it has no reasoning effort field. In the terminal UI, /model and /effort change both. A resumed session keeps them, because they are stored in the session; a session that /new starts begins with the file's model and the model's default effort.
Each command offers the effort values its SDK accepts, and maps them to that SDK. A value the command does not offer fails the turn with unsupported_reasoning_effort at "/reasoning_effort". The model must support reasoning effort too; a model without it may reject the call.
| Command | Values | Passed to the SDK as |
|---|---|---|
| dex-agents-builtin (Python) | low, medium, high | LiteLLM reasoning_effort |
| dex-agents-claude-sdk | low, medium, high, xhigh, max | Claude Agent SDK effort |
| dex-agents-openai-sdk | low, medium, high | reasoning.effort of the model settings |
| dex-agents-pydantic-ai | low, medium, high | Pydantic AI thinking |
| dex-agents-builtin (TypeScript), dex-agents-vercel-ai | low, medium, high | AI SDK reasoning |
| dex-agents-pi | low, medium, high | pi-ai reasoning |
| dex-agents-deepagents, dex-agents-google-adk, dex-agents-mastra | None | These commands have no reasoning effort setting yet |
/model offers the file's model, the command's default model, and a few models the command suggests. Any other model ID works too.