Skip to content
FlyCockpit
Cockpit Code/ Config, Tools & Security
Cockpit Code logo

Configuration, Tools & Security

Repository

Configure Cockpit Code's directory layout, permission modes, MCP servers, local LSPs, Python script VM, skills, web tools, and OS-level sandboxing.

Platforms: Linux (static musl) · macOS (Apple Silicon & Intel)

Cockpit Code keeps all configuration in one plain-JSON directory, reloads edits automatically at turn boundaries, and provides configurable permission gates, MCP servers, bring-your-own LSPs, a sandboxed Python script VM, skills, and web tools.

Configuration Layout & Live Reload

Run cockpit-code doctor to print the active CONFIG, DATA, and CACHE directories. By default, CONFIG resolves to ~/.config/cockpit-code/ (falling back to ~/.cockpit-code/ if ~/.config does not exist). Set $COCKPIT_CODE_HOME to override it.

~/.config/cockpit-code/
├── config.json          # Global settings (default model, permissions, subagents, LSP, web, goal, TUI)
├── providers/<id>.json  # One model provider per file (<id> is the file stem)
├── mcps/<id>.json       # One MCP server per file
├── tools.json           # Tool profile and per-tool name/description/enabled overrides
├── guidance/<id>.md     # Custom guidance documents (also loaded from ./.cockpit-code/guidance/)
└── system.md            # Optional custom base system prompt
  • Live reload: Changes to JSON configuration files take effect at the next turn boundary without restarting. Running agents keep the frozen tool catalog, strictness, and model settings they started with; start a new session to apply changed tool profiles or LSP maps.
  • Validation: A syntax error in config.json prevents startup, whereas an invalid provider or MCP file is skipped individually and reported by cockpit-code doctor.

Example config.json

{
  "defaultModel": "anthropic/claude-opus-5-5",
  "tools": { "profile": "full" },
  "permissions": {
    "mode": "manual",
    "autoModel": "anthropic/claude-haiku-5-5",
    "autoVariations": 3,
    "prompts": {
      "toolCall": "safety-tool-call.md",
      "writeEdit": "safety-write-edit.md"
    }
  },
  "subagents": {
    "mode": "tree",
    "maxDepth": null,
    "maxConcurrentChildren": 4,
    "maxTotalAgents": null
  },
  "script": { "cpuSecs": 10, "maxCalls": 1000 },
  "web": { "provider": "firecrawl", "apiKey": "${FIRECRAWL_API_KEY}" },
  "skillsDirs": ["~/.agents/skills", "./.agents/skills"],
  "theme": "auto",
  "vim": false,
  "mouse": true,
  "queueDefault": "next-turn"
}

Tool Profiles & Overrides (tools.json)

Set tools.profile globally, per provider, or per model (model → provider → global; default full):

  • full: Advertises all enabled tools natively.
  • core: Advertises 19 core root tools natively (read, write, edit, bash, grep, glob, code, script, history, question, answer, escalate, message, task, agents, jobs, scope, criteria, skill) and keeps extended tools (lsp, models, web, mcp, media) discoverable via Monty’s tools.search(query=...) / tools.describe(name=...). Code intelligence helpers (graph, context_pack, change_impact) are Monty-only in both profiles.
  • Per-tool overrides: CONFIG/tools.json (or tools maps on providers/models) can rename tools, adjust descriptions, or set "enabled": false (disabling both native and script surfaces).

Permission Modes

Cockpit Code enforces four permission modes (permissions.mode in config.json, --mode <mode> on the CLI, or shift+tab / /permissions in the TUI):

Mode Behavior
manual (Default) Prompts you interactively before each gated action. Approvals can be granted once or for the entire session.
auto Routes gated actions to a configurable safety sidecar model (permissions.autoModel), which approves, rejects, or asks for improved candidates (permissions.autoVariations, default 3), escalating ambiguous calls to you.
unattended Uses the safety sidecar model without interactive prompts (disables interactive terminal tool; intended for headless/CI runs).
yolo Bypasses the permission gate for routine actions.

Safety Reviewer Guidance

  • Customize safety prompts with permissions.prompts.toolCall and permissions.prompts.writeEdit (Markdown files relative to CONFIG).
  • Supply extra rules via permissions.reviewerGuidance (inline text or a CONFIG-relative file).
  • Project-level guidance at .cockpit-code/reviewer-guidance.md is applied only after explicit user trust (content hashes are recorded in DATA, and any change requires renewed trust; headless mode ignores untrusted project guidance).
  • Protected edits: Agent edits to reviewer guidance always require interactive approval, even in yolo mode.

Connecting MCP Servers (mcps/<id>.json)

Define one MCP server per file under CONFIG/mcps/<id>.json using stdio, http, or sse transport. Toggle servers per session with /mcp.

Local stdio server (mcps/github.json):

{
  "transport": "stdio",
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-github"],
  "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" },
  "enabledByDefault": false,
  "description": "GitHub issues and pull requests",
  "timeouts": { "startupSecs": 30, "callSecs": 120 }
}

Remote http / sse server (mcps/context.json):

{
  "transport": "http",
  "url": "https://context.example.com/mcp",
  "headers": { "Authorization": "Bearer ${COCKPIT_CONTEXT_TOKEN}" },
  "enabledByDefault": true,
  "description": "Dependency source investigations"
}

Note: ${VAR} expands in command, env, url, and headers (not in args). OAuth is not supported for MCP connections—use bearer tokens or API keys via ${VAR}. Running /exclusive in network-blocking mode automatically disables http and sse MCP servers.

Bring-Your-Own Local LSPs

At session start, Cockpit Code runs a .gitignore-aware scan (up to 100,000 entries) and activates installed language servers only for languages present in the project. It never downloads LSP binaries automatically; cockpit-code doctor reports detected servers and install hints.

Built-in Key Detected Binary
rust rust-analyzer
typescript typescript-language-server --stdio
python basedpyright-langserver --stdio (fallback: pyright-langserver)
go gopls
cpp clangd

Override defaults, disable a server, add custom languages, or tune post-edit diagnostics in config.json:

{
  "lsp": {
    "cpp": { "enabled": false },
    "python": { "command": "pyright-langserver" },
    "afterWrite": "errors+warnings",
    "afterWriteMs": 1500
  }
}
  • lsp.afterWrite accepts "errors", "errors+warnings" (default), or "off", and lsp.afterWriteMs (default 1500) bounds post-write diagnostic checks (both overridable per model). Only newly introduced diagnostics appear on write/edit results (capped at 20 lines), and LSP timeouts never fail a write.
  • Resolved LSP availability freezes per session; install a new binary or edit lsp config and start a new session to pick it up.

Sandboxed Python script Tool, Skills & Web Tools

Sandboxed Python script Tool (Monty VM)

The script tool executes short Python programs inside an embedded Monty VM so agents can chain multiple tool calls, filter large outputs, or invoke code-graph queries in one round trip:

  • Bounded by script.cpuSecs (default 10) and script.maxCalls (default 1000).
  • Provides tools.search(query=..., limit=10) and tools.describe(name=...) (mcp.search/mcp.describe are aliases) to inspect permitted tools.
  • Provides agent-local in-memory persistence via store(key, value) / load(key) (capped at 1 MiB total and 1,024 keys; cleared on agent exit/restart; not intended for secrets).

Skills

Cockpit Code loads agent skills from skillsDirs (default ["~/.agents/skills", "./.agents/skills"]) and ships a bundled cockpit-code-config skill so the agent itself can inspect and edit provider, model, MCP, and config.json settings accurately.

Web Search & Fetch

Configure web in config.json to enable web_search and enhanced web_fetch:

{
  "web": {
    "provider": "firecrawl",
    "apiKey": "${FIRECRAWL_API_KEY}"
  }
}
  • Supported providers: firecrawl and tinyfish (with optional baseUrl for self-hosted instances or proxies).
  • web.apiKey must be a single ${VAR} reference—a literal API key is rejected as a config error.
  • Without a web.provider, web_search returns an error and web_fetch falls back to a plain HTTP GET.

Security Controls & OS Sandboxing Guidance

Cockpit Code enforces strict credential and session hygiene:

  • Zero secrets in config: Provider, MCP, and web configs only accept ${ENV_VAR} references; cockpit-code init never writes secrets to disk.
  • Owner-only session storage: Saved session directories are created with mode 0700, and job/tool output files inside them are created 0600.
  • Automatic credential redaction: Command-provider failure diagnostics automatically redact values (≥ 8 bytes) matching credential environment variable names (*_TOKEN, *_SECRET, *_KEY, *_PASSWORD, *_AUTH, etc.).
  • Untrusted content labeling: Tool descriptions explicitly mark cross-session, other-agent, and external outputs as untrusted data.

Warning — No Built-In OS Sandbox: Permission modes control when actions are reviewed, not kernel-level isolation. Once a shell command, script, or edit runs, it executes with your OS user’s full filesystem, network, and credential access.

When working on untrusted repositories, running autonomous --goal loops, or using unattended / yolo modes, always run cockpit-code inside an external isolation boundary:

  • WS Sandbox Proxy (wssp): Pair Cockpit Code with FlyCockpit’s WS Sandbox Proxy to execute agent workspaces inside isolated, managed sandboxes with controlled egress and credential boundaries.
  • Containers or MicroVMs: Run the static Linux binary inside a rootless container or ephemeral VM mounting only the target repository directory and injecting only the specific model API key required for the task.