Configuration File

Posit Assistant is configured through a JSON settings file. This file controls model selection, behavior preferences, runtime configuration, permissions, and more.

File Locations

Posit Assistant uses two levels of configuration:

  • Global config applies to all projects. Located at:

    • macOS / Linux: ~/.positai/settings.json
    • Windows: %USERPROFILE%\.positai\settings.json
  • Project config overrides global settings for a specific project. Place a .positai/settings.json file in your project root.

Some settings (like providers, storage, and logging) are global-only. Others (like model, permissions, and MCP servers) can be set at either level, with project values taking precedence. The sections below indicate which level each setting supports.

Settings are resolved in this order (last wins): defaults → global config → project config → environment variables.

Per-Project Settings

The following settings can be set in either the global ~/.positai/settings.json or a project-level .positai/settings.json. Project values take precedence over global values.

Model Settings

KeyTypeDefaultDescription
model.idstring"claude-sonnet-4-6"The model to use for conversations.
model.providerstring"positai"The LLM provider. Options include "positai", "anthropic", "openai", "bedrock", "ollama", and others.
model.thinkingEffortstringDefault thinking effort level for new conversations. During a conversation, thinking effort is adjusted via the UI and stored per-conversation.
model.webSearchbooleanfalseDefault web search preference for new conversations. During a conversation, web search is toggled via the UI and stored per-conversation.

Permissions

Control which tools the assistant can use. Each key is a tool name (bash, read, edit, etc.) mapped to either an action string or an object of glob patterns:

{
	"permission": {
		"bash": {
			"git *": "allow",
			"rm *": "deny"
		},
		"read": "allow",
		"edit": "ask"
	}
}

You can also set a single action for all tools as a shorthand:

{
	"permission": "ask"
}
KeyTypeDefaultDescription
permissionstring | objectTool permission configuration. Set to "allow", "ask", or "deny" for all tools, or an object with per-tool rules. Pattern matching uses glob syntax for bash commands.
📝 Project vs. global permissions

When you grant or deny permissions through the UI, they are saved to your project-level .positai/settings.json. If you want permissions to apply across all projects, copy the permission block to your global ~/.positai/settings.json instead.

MCP Servers

Connect external tool servers using the Model Context Protocol.

{
  "mcpServers": {
    "my-server": {
      "type": "local",
      "command": ["node", "server.js"],
      "environment": {
        "API_KEY": "..."
      }
    },
    "remote-server": {
      "type": "remote",
      "url": "https://mcp.example.com",
      "headers": {
        "Authorization": "Bearer ..."
      }
    }
  }
}
KeyTypeDefaultDescription
typestring"local"Server type. "local" for stdio subprocess, "remote" for HTTP/SSE.
commandstring[]Command and arguments to start a local MCP server.
urlstringURL of a remote MCP server.
enabledbooleantrueWhether this server is active.
timeoutnumber10000Connection timeout in milliseconds.
📝 Project vs. global MCP servers

MCP servers can be configured in either the project-level .positai/settings.json or the global ~/.positai/settings.json. Project-level servers are merged with global servers by server name, with project values taking precedence. Use project-level config for project-specific servers and global config for servers you want available everywhere.

Runtime Settings

Control how Posit Assistant connects to R and Python.

KeyTypeDefaultDescription
runtime.r.enabledbooleantrueEnable R runtime integration.
runtime.r.pathstring"Rscript"Path to the Rscript executable.
runtime.r.timeoutnumber30000Timeout in milliseconds for R code execution.
runtime.python.enabledbooleantrueEnable Python runtime integration.
runtime.python.pathstring"python3"Path to the Python executable.
runtime.python.timeoutnumber30000Timeout in milliseconds for Python code execution.

Workspace Settings

KeyTypeDefaultDescription
workspace.pathstring""Working directory. Defaults to the current directory.
workspace.allowedRootsstring[]Allowed root directories for workspace switching. Defaults to the user home directory.

Sandbox

Control filesystem and network isolation for bash tool execution. When enabled, shell commands run inside a platform-specific sandbox (macOS Seatbelt / Linux bubblewrap) that restricts writes to the workspace and temp directories, blocks network access, and prevents reading sensitive paths like ~/.ssh and ~/.aws.

KeyTypeDefaultDescription
sandbox.enabledbooleanfalseEnable sandboxing for bash tool execution.

You can also toggle sandbox mode during a session with the /sandbox command.

Compaction

Control how Posit Assistant manages long conversations. See Context Management for details on how compaction works.

KeyTypeDefaultDescription
autoCompactTokenBuffernumber30000Tokens reserved for the compaction summary. Auto-compaction triggers once fewer than this many tokens remain in the context window.
microCompactTokenThresholdnumber150000Token count above which micro-compaction activates, silently trimming old tool results.
microCompactKeepRecentCountnumber8Number of recent user turns preserved without micro-compaction.

Global Settings

The following settings can only be set in the global ~/.positai/settings.json. They are not supported in project-level config files.

Provider Settings

Provider credentials and connection details are configured under the providers key. Credentials are normally set through the application’s settings UI, but you can override the base URL for a provider’s API in the config file. This is useful for enterprise proxies, custom API gateways, or local development servers.

{
  "providers": {
    "anthropic": {
      "baseUrl": "https://my-proxy.example.com"
    },
    "openai": {
      "baseUrl": "https://my-openai-proxy.example.com/v1"
    }
  }
}
KeyTypeDefaultDescription
providers.{provider}.baseUrlstringCustom base URL for the provider's API. Supported by: anthropic, openai, gemini, openai-compatible, ms-foundry, snowflake-cortex, and positai.
providers.{provider}.endpointstringLocal endpoint URL for self-hosted providers (ollama, lmstudio). For example, "http://localhost:11434" for Ollama.
providers.allowedProvidersstring[]Restrict which providers are available. If omitted, the platform default is used.
💡 Positron users

In Positron, base URLs are configured through the model provider registration UI and stored in Positron’s authentication.* settings. See Positron Settings for details.

Storage Settings

KeyTypeDefaultDescription
storage.pathstring"~/.positai"Directory for conversation storage.

Logging

KeyTypeDefaultDescription
logging.levelstring"info"Log level. Options: "error", "warn", "info", "debug", "trace".
logging.filestring""Log file path. Defaults to ~/.positai/logs/{platform}.log.
logging.consolebooleantrueOutput logs to the console.

Example Configuration

{
  "model": {
    "provider": "anthropic",
    "id": "claude-sonnet-4-6"
  },
  "permission": {
    "read": "allow",
    "bash": {
      "git *": "allow"
    }
  }
}
📝 Changes take effect on restart

Some configuration changes require restarting the assistant or opening a new conversation to take effect.

Environment Variables

Some settings can also be controlled via environment variables. Environment variables take precedence over file-based configuration.

VariableDescription
ANTHROPIC_API_KEYAPI key for the Anthropic provider
ANTHROPIC_BASE_URLCustom base URL for the Anthropic provider
OPENAI_API_KEYAPI key for the OpenAI provider
OPENAI_BASE_URLCustom base URL for the OpenAI provider
GEMINI_API_KEYAPI key for the Gemini provider
GEMINI_BASE_URLCustom base URL for the Gemini provider
OPENAI_COMPATIBLE_API_KEYAPI key for the OpenAI Compatible provider
OPENAI_COMPATIBLE_BASE_URLCustom base URL for the OpenAI Compatible provider
MS_FOUNDRY_API_KEYAPI key for the Microsoft Foundry provider
MS_FOUNDRY_BASE_URLCustom base URL for the Microsoft Foundry provider
POSITAI_BASE_URLCustom base URL for the Posit AI provider
OLLAMA_ENDPOINTEndpoint URL for Ollama
LMSTUDIO_ENDPOINTEndpoint URL for LM Studio
⚠️ API keys

Never commit API keys to version control. Use environment variables or a secrets manager for sensitive credentials.