Configuration

Nestor reads its configuration from a JSON file under $NESTOR_HOME (default ~/.nestor) and from environment variables. This page documents every supported field plus the precedence rules between sources.

Config file

Location: $NESTOR_HOME/config.json. Created interactively by npx nestor-sh install. The full schema:

{
  "version": "3.5.0",
  "server": {
    "studioPort": 3100,
    "apiPort": 3101,
    "dataDir": "~/.nestor",
    "host": "127.0.0.1"
  },
  "providers": {
    "anthropic": {
      "apiKey": "sk-ant-...",
      "defaultModel": "claude-sonnet-4-6",
      "baseURL": null
    },
    "openai": {
      "apiKey": "sk-...",
      "defaultModel": "gpt-4o",
      "projectId": null,
      "baseURL": null
    },
    "google": {
      "apiKey": "...",
      "defaultModel": "gemini-2.0-pro"
    },
    "grok": {
      "apiKey": "xai-...",
      "defaultModel": "grok-3"
    },
    "mistral": {
      "apiKey": "...",
      "defaultModel": "mistral-large-latest"
    },
    "ollama": {
      "baseURL": "http://localhost:11434",
      "defaultModel": "llama3.2"
    },
    "openrouter": {
      "apiKey": "sk-or-...",
      "defaultModel": "anthropic/claude-sonnet-4-6"
    }
  },
  "approval": {
    "mode": "smart",
    "allowlist": ["file_read", "file_list", "web_fetch"],
    "manualForRiskAtLeast": "high"
  },
  "budgets": {
    "perRunUsd": 5.00,
    "perDayUsd": 50.00,
    "warningPct": 80,
    "hardCap": true
  },
  "telemetry": {
    "enabled": true,
    "otelEndpoint": null,
    "retainDays": 30
  },
  "memory": {
    "governance": false,
    "decayRate": 0.05,
    "maxAgentMemoryMb": 100
  },
  "personaV2": false,
  "feedback": {
    "promptAfterRun": true
  }
}

Quick edits

You can edit the file directly, or use the CLI helpers (which preserve formatting and validate the schema):

npx nestor-sh config show              # dump current config
npx nestor-sh config set approval.mode manual
npx nestor-sh config get budgets.perRunUsd

Environment variables

Environment variables override file values for the lifetime of the process. They're useful for CI, sandboxed installs, and running multiple Nestor instances against different homes.

VariableEffectDefault
NESTOR_HOMEData directory (DB, logs, skills)~/.nestor
NESTOR_STUDIO_PORTStudio dashboard port3100
NESTOR_API_PORTUnderlying API server port3101
NESTOR_PERSONA_V2Enable BMAD+ persona stack (Atlas, Forge, Sentinel, Nexus, Shadow)0
NESTOR_NATIVESet to disabled to force JS fallback for the Rust security coreauto
NESTOR_LOG_LEVELerror | warn | info | debug | traceinfo
NESTOR_TELEMETRYSet to 0 to disable all telemetry collection1
ANTHROPIC_API_KEYOverride config file Anthropic key
OPENAI_API_KEYOverride config file OpenAI key
OPENAI_PROJECT_IDFor OpenAI project-scoped keys
GEMINI_API_KEYGoogle AI Studio key
GROK_API_KEYxAI key
MISTRAL_API_KEYMistral key
OLLAMA_BASE_URLCustom Ollama endpointhttp://localhost:11434
OPENROUTER_API_KEYOpenRouter key

LLM providers

Each provider section in config.json follows the same shape:

"providers": {
  "<provider>": {
    "apiKey": "<your key>",
    "defaultModel": "<model id>",
    "baseURL": null,                // optional override for self-hosted gateways
    "extraHeaders": {}              // optional, e.g. for HTTP proxies
  }
}

Provider switching mid-mission is supported via the HotSwapAdapter. Use /model <name> in the shell or call runtime.getHotSwap().swap(adapter, reason) programmatically.

Default model selection

If an agent doesn't specify a model, the runtime picks the first provider with a configured key in this order:

  1. Anthropic Claude (cheapest reliable tool-use)
  2. OpenAI GPT-4o
  3. Google Gemini 2.0 Pro
  4. Grok 3
  5. Mistral Large
  6. OpenRouter (300+ models)
  7. Ollama (local fallback, no key required)

Approval modes

Three modes control when Nestor pauses to ask the user before executing a tool:

ModeBehaviorWhen to use
offNever ask. All tools execute autonomously.CI, fully-trusted environments
smart (default)Ask only for high/critical-risk tools (shell_exec, file_write, destructive HTTP)Daily use
manualAsk for every tool except those in allowlistFirst runs, paranoid mode

Toggle at runtime in the shell with /approve off|smart|manual.

Budgets

Two cost ceilings guard against runaway spend:

"budgets": {
  "perRunUsd": 5.00,    // per agent run
  "perDayUsd": 50.00,   // total across all agents
  "warningPct": 80,     // emit budget_warning event at this %
  "hardCap": true       // abort run when reached (false = warn only)
}

Per-agent overrides:

npx nestor-sh agent config <agent-name> --budget-per-run-usd 1.00

Telemetry

Local-only by default. Stores OTel-style traces in SQLite for the Studio dashboard. Nothing is sent off-machine unless you set otelEndpoint:

"telemetry": {
  "enabled": true,
  "otelEndpoint": "http://otel-collector:4318",  // optional
  "retainDays": 30,                              // auto-prune older traces
  "samplingRate": 1.0                            // 1.0 = 100% sampled
}

Disable globally with NESTOR_TELEMETRY=0.

Memory governance

Off by default. When enabled, agent memory entries are subject to:

Recommended for multi-tenant deployments and long-running daemons. See Security for the full memory governance model.

Precedence rules

When multiple sources define the same value, the highest priority wins:

  1. CLI flags--port, --data-dir, etc. (per command)
  2. Environment variablesNESTOR_*, provider keys
  3. Config file$NESTOR_HOME/config.json
  4. Built-in defaults — defined in packages/cli/src/utils/config.ts

Sensitive values (API keys) are never logged. The Rust security core's secret-redaction layer applies to all outbound logs and tool results.


✎ Edit this page on GitHub · Last updated 2026-04-26