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 first - pyproject.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. Use this in CI/CD instead of unfault login.
UNFAULT_BASE_URLOverride API endpoint. For enterprise deployments or local development.

Used by unfault ask --llm for AI-synthesized answers:

VariableDescription
OPENAI_API_KEYOpenAI API key. Required when using unfault config llm openai.
ANTHROPIC_API_KEYAnthropic API key. Required when using unfault config llm anthropic.

Used by unfault review --discover-observability to find Google Cloud SLOs:

VariableDescription
GOOGLE_APPLICATION_CREDENTIALSPath to service account JSON file. Takes precedence over ADC.
GOOGLE_CLOUD_PROJECTGCP project ID. Overrides auto-detection from credentials.
GCP_PROJECTAlternative to GOOGLE_CLOUD_PROJECT.
GCLOUD_PROJECTAlternative to GOOGLE_CLOUD_PROJECT.

Used by unfault review --discover-observability to find Datadog SLOs:

VariableDescription
DD_API_KEYDatadog API key. Required for Datadog integration.
DD_APP_KEYDatadog application key. Required for Datadog integration.
DD_SITEDatadog site (e.g., datadoghq.eu for EU). Defaults to datadoghq.com.

Used by unfault review --discover-observability to find Dynatrace SLOs:

VariableDescription
DT_API_TOKENDynatrace API token with SLO read permissions.
DT_ENVIRONMENT_URLDynatrace environment URL (e.g., https://abc12345.live.dynatrace.com).
VariableDescription
XDG_CONFIG_HOMEOverride config directory. Defaults to ~/.config.
HOMEUser home directory (Linux/macOS). Used to locate ~/.config/unfault/.
USERPROFILEUser home directory (Windows). Used to locate .config\unfault\.

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