Skip to content

Configuration

Unfault can be configured at the user level and per-workspace.

The configuration file location depends on your operating system:

PlatformLocation
Linux~/.config/unfault/config.json or $XDG_CONFIG_HOME/unfault/config.json
macOS~/.config/unfault/config.json or $XDG_CONFIG_HOME/unfault/config.json
Windows%USERPROFILE%\.config\unfault\config.json

Example configuration:

{
"api_key": "uf_live_...",
"base_url": "https://api.unfault.dev",
"llm": {
"provider": "openai",
"model": "gpt-4",
"api_key": "sk-..."
}
}

After running unfault login, your API key is stored automatically.

For CI/CD environments, set the API key via environment variable:

Terminal window
export UNFAULT_API_KEY="sk_live_..."

For the unfault ask command, configure an LLM provider:

Terminal window
unfault config llm openai --model gpt-5.1

Unfault reads configuration from your project’s manifest file, avoiding the need for a dedicated config file. The configuration location depends on your language:

[tool.unfault]
# Override auto-detected profile
profile = "python_fastapi_backend"
# Limit analysis to specific dimensions
dimensions = ["stability", "correctness", "performance"]
[tool.unfault.rules]
# Rules to exclude (supports glob patterns)
exclude = [
"python.missing_structured_logging", # We use custom logging
"python.http.*", # All HTTP rules
]
# Additional rules to include
include = ["python.security.*"]
# Severity overrides
[tool.unfault.rules.severity]
"python.bare_except" = "low"

When multiple configuration sources exist:

  1. Manifest files are checked firstpyproject.toml, Cargo.toml, then package.json
  2. .unfault.toml is the fallback — Used when no manifest contains unfault configuration
  3. No merging — Only one source is used per project (the first one found with unfault config)

Patterns for exclude and include use glob syntax:

PatternMatchesDoes Not Match
python.http.missing_timeoutExact match onlyAny other rule
python.http.*python.http.missing_timeout, python.http.missing_retrypython.http.client.timeout
*.missing_timeoutpython.missing_timeout, go.missing_timeoutpython.http.missing_timeout
python.**All rules starting with python.Rules from other languages

To disable a rule project-wide, add it to the exclude list in your config.

You can also disable rules inline in your code:

// unfault:disable http_client_missing_timeout
client := http.Client{}
VariableDescription
UNFAULT_API_KEYAPI key for authentication
UNFAULT_BASE_URLOverride API endpoint (enterprise)
OPENAI_API_KEYOpenAI API key for ask command
ANTHROPIC_API_KEYAnthropic API key for ask command

Settings are applied in this order (later overrides earlier):

  1. Default values
  2. User config (see User Configuration for platform-specific paths)
  3. Workspace config (pyproject.toml, Cargo.toml, package.json, or .unfault.toml)
  4. Environment variables
  5. Command-line flags