Configuration
fx separates repository-safe defaults from private user and workspace preferences. Use /settings, /permissions, /sandbox, and /workspace when possible; direct JSON editing is useful for settings that do not have an interactive control.
Files and precedence
| Layer | Location | Scope |
|---|---|---|
| User profile | ~/.fx/settings.json | Private global preferences and per-workspace overrides |
| Project | <workspace>/.fx.json | Repository-safe defaults that may be committed |
| MCP | ~/.fx/mcp.json | Private MCP server definitions; see MCP |
For each setting, the highest available source wins:
- command-line or process override, where supported
- environment variable
- matching workspace entry in
~/.fx/settings.json - global entry in
~/.fx/settings.json <workspace>/.fx.json- built-in default
The settings file is limited to 64 KiB. Unknown JSON keys are ignored, but invalid values in known keys can make a layer unusable and produce a startup diagnostic.
Project configuration
.fx.json accepts exactly four public fields:
{
"max_agent_steps": 40,
"max_tool_result_bytes": 131072,
"context": true,
"sandbox": "os"
}
| Field | Type and values | Default | Meaning |
|---|---|---|---|
max_agent_steps | Non-negative integer | 0 | Maximum model tool-loop steps; 0 means unlimited. |
max_tool_result_bytes | Integer of at least 1024 | 65536 | Maximum bytes retained from one tool result. |
context | Boolean | true | Load project instructions and related workspace context. |
sandbox | "os", "none", or "auto" | "none" | Command sandbox. auto selects the host-supported mode; os is currently available on macOS. |
"macos" is accepted as a legacy alias for "os". The retired "vercel" and "just-bash" values are rejected.
Profile-only fields such as model, credentials, permission mode and rules, effort, appearance, notifications, update channel, and additional directories are ignored in project config. context_limits is also profile-only.
User profile
A complete representative ~/.fx/settings.json looks like this. Omit values you want fx to resolve from a lower layer or its defaults.
{
"model": "zai/glm-5.2-fast",
"permission_mode": "auto",
"max_agent_steps": 0,
"max_tool_result_bytes": 65536,
"first_call_tool_choice": "auto",
"context": true,
"context_limits": {
"skill_catalog_bytes": 16384,
"project_instructions_total_bytes": 131072
},
"fast_mode": false,
"effort": "auto",
"sandbox": "none",
"input_appearance": "tint",
"slash_menu_categories": true,
"auto_upgrade": true,
"update_channel": "stable",
"startup_scrollback": true,
"prompt_history": {
"enabled": true
},
"statusLine": {
"sandbox": false,
"context": false,
"session": false
},
"notifications": {
"turn_end": true,
"attention_required": true,
"max": false
},
"permission": {
"*": "ask"
},
"workspaces": {
"/absolute/path/to/project": {
"sandbox": "os",
"additional_directories": [
"/absolute/path/to/shared"
],
"permission": {
"edit": {
"docs/*": "allow",
"*": "deny"
}
}
}
}
}
Agent and model settings
| Field | Type and values | Default |
|---|---|---|
model | Non-empty Gateway model ID | zai/glm-5.2-fast |
permission_mode | "ask", "auto", or "yolo" | "auto" |
max_agent_steps | Non-negative integer; 0 is unlimited | 0 |
max_tool_result_bytes | Integer of at least 1024 | 65536 |
first_call_tool_choice | "auto" or "none" | "auto" |
context | Boolean | true |
fast_mode | Boolean | false |
effort | "auto", "none", "minimal", "low", "medium", "high", "xhigh", or "max"; null resets to auto | "auto" |
sandbox | "os", "none", or "auto" | "none" |
context_limits accepts the keys and byte values listed in Context limits. Permission rules accept "allow", "ask", and "deny"; see Permissions for matching and scope.
permission_mode: "auto" enables automatic review for eligible unresolved calls. fx uses openai/gpt-5.4 as the reviewer. The reviewer model is not a profile, project, environment, or CLI setting. Automatic reviews are additional Gateway requests and can add usage and cost; see Automatic review configuration and cost.
Interface and update settings
| Field | Type and values | Default |
|---|---|---|
input_appearance | "lines" or "tint" | "tint" |
slash_menu_categories | Boolean | true |
auto_upgrade | Boolean | true |
update_channel | "stable" or "dev" | "stable" |
startup_scrollback | Boolean | true |
prompt_history.enabled | Boolean | true |
statusLine.sandbox | Boolean | false |
statusLine.context | Boolean | false |
statusLine.session | Boolean | false |
notifications.turn_end | Boolean | On by default on macOS, off elsewhere |
notifications.attention_required | Boolean | On by default on macOS, off elsewhere |
notifications.max | Boolean | false |
fx-managed fields
credential_source and yolo_acknowledged are valid profile fields, but fx manages them through authentication and permission flows. Avoid editing them by hand.
Credential source values are vercel_oidc_token, ai_gateway_api_key, fx_login, and stored_key.
Workspace entries
Keys under workspaces are absolute primary workspace paths. fx saves workspace-local sandbox settings, permission rules, and additional_directories there. An additional-directory list contains at most 16 unique absolute directory paths.
A workspace object is parsed with the same setting schema as the top-level profile and may therefore carry deliberate local overrides, including context_limits and the four project-safe fields. The current interactive controls save model, effort, fast mode, permission mode, appearance, prompt history, status line, notification, and update preferences globally; older workspace copies of model and interface preferences are treated as legacy and may be migrated.
Additional directories extend tool access only. They do not contribute config, AGENTS.md, skills, hooks, Git identity, sessions, or history. See Additional workspaces.
Environment variables
These are the supported user-facing process overrides and runtime controls:
| Variable | Purpose |
|---|---|
AI_GATEWAY_API_KEY | Authenticate with a Vercel AI Gateway API key. |
VERCEL_OIDC_TOKEN | Authenticate in a Vercel-managed environment. |
FX_MODEL | Override the model for this process. |
FX_PERMISSION_MODE | Override ask, auto, or yolo. |
FX_MAX_AGENT_STEPS | Override the agent step limit. |
FX_THEME | Force light or dark terminal theming. |
FX_SOUND | Override sounds with on, off, or max. |
FX_AUTO_UPGRADE=0 | Disable automatic upgrade checks for the process. |
FX_NO_OPEN_BROWSER=1 | Print authentication URLs instead of opening a browser. |
FX_RECORD | Write a terminal recording to an explicit path. |
FX_RECORD_INPUT=1 | Include raw terminal input events in a recording. |
FX_TRACE=1 | Write a trace to the default private trace path. |
FX_TRACE_LOG | Write a trace to an explicit path; relative paths resolve from the primary workspace. |
FX_TRACE_SCOPES | Limit traces to an exact comma-separated list of scopes. |
FX_TRACE_STDERR=1 | Write trace lines to stderr, alone or alongside a trace file. |
Advanced process controls:
| Variable | Purpose |
|---|---|
| `FX_SYNC_UPDATES=on | off` |
FX_DISABLE_KEYCHAIN=1 | Disable the native macOS API-key store; fx setup cannot save a key while set. |
FX_HERDR=0 | Disable automatic Herdr lifecycle reporting. |
Environment and command-line overrides affect only the current process and are not written back to settings.
Herdr integration
When fx runs inside Herdr, Herdr provides HERDR_SOCKET_PATH and HERDR_PANE_ID. fx then reports its lifecycle state automatically:
idle → working → idle
└→ blocked: permission, question, or recovery
Reports contain the pane identity, fx session ID, agent label, lifecycle state, and attention reason. Prompts, transcripts, and tool output are not included. Communication stays on Herdr's local Unix socket, and reporting failures never stop the fx session.
Set FX_HERDR=0 or FX_HERDR=false to opt out. You normally do not need to set the two HERDR_* variables yourself.
Inspect effective configuration
Inspect the resolved startup configuration as text or JSON:
fx statusfx status --jsonUse fx permissions --json for the resolved permission rules and fx workspace --json for active additional directories.
Local state
fx stores private runtime state under ~/.fx/, including settings, the saved Vercel session, sessions, prompt history, usage, traces, recordings, MCP config, and managed skills. On macOS, a stored API key lives in Keychain instead.
Keep local state private
Do not copy ~/.fx into a repository. It can contain credentials, prompts, transcripts, paths, permission rules, MCP environment values, and recorded terminal output.