Configuration Reference

July 21, 2026 · View on GitHub

Sashiko is configured through two files in the project root:

  • Settings.toml -- application settings (AI, server, git, review)
  • email_policy.toml -- email delivery policy

Both can be bootstrapped from the examples in docs/examples/. All settings can also be overridden via environment variables using the SASHIKO prefix with __ (double underscore) as the separator (e.g. SASHIKO__AI__PROVIDER=gemini).

For LLM provider-specific setup (API keys, auth, provider features), see the LLM Provider Configuration Guide.

Settings.toml sections

[forge]

Optional. Controls forge (GitHub/GitLab) webhook integration.

KeyTypeDefaultDescription
enabledboolfalseEnable forge webhook endpoint.
disable_nntpbooltrueDisable NNTP ingestion when forge is enabled.
providerstring--Forge provider: "github" or "gitlab".
webhook_secretstring--Webhook signing token or shared secret for authenticating incoming requests. When configured, non-localhost requests are authenticated via signature verification. See the Webhook Security Guide.
api_tokenstring--Forge API token (for future API-based features).

Security: When Settings.toml contains secrets, restrict file permissions: chmod 600 Settings.toml.

[database]

KeyTypeDefaultDescription
urlstring"sashiko.db"Path to the SQLite database file.
tokenstring""Database token (unused for SQLite).

[mailing_lists]

KeyTypeDefaultDescription
trackstring or list--Mailing lists to monitor. Accepts a TOML array or a comma-separated string.

[nntp]

KeyTypeDefaultDescription
serverstring"nntp.lore.kernel.org"NNTP server hostname.
portinteger119NNTP server port.

[smtp]

Optional. If omitted, no review emails are sent. Even when present, dry_run defaults to true as a safety measure.

KeyTypeDefaultDescription
serverstring--SMTP server hostname.
portinteger--SMTP server port.
usernamestring--SMTP username (optional).
passwordstring--SMTP password (optional).
sender_addressstring--From address for review emails.
reply_tostring--Reply-To address (optional).
dry_runbooltrueWhen true, emails are logged but not sent.

[ai]

Core AI settings that apply to all providers.

KeyTypeDefaultDescription
providerstring--LLM provider: gemini, claude, claude-cli, codex-cli, copilot-cli, bedrock, vertex, kiro-cli, openai-compat.
modelstring--Model identifier (provider-specific).
max_input_tokensinteger150000Maximum input tokens per request.
max_interactionsinteger100Maximum tool-call rounds per review turn.
temperaturefloat1.0Sampling temperature.
api_timeout_secsinteger300Timeout for individual API calls (seconds).
log_turnsboolfalseLog each AI request/response turn at info level. Verbose but useful for debugging.
response_cacheboolfalseCache AI responses to disk.
response_cache_ttl_daysinteger7TTL for cached responses (days).

[ai.claude]

Settings specific to the Claude API provider (provider = "claude").

KeyTypeDefaultDescription
prompt_cachingbooltrueEnable Anthropic prompt caching (5-minute TTL).
max_tokensinteger4096Max output tokens per response.
base_urlstring--Override the API base URL (optional, for proxies like Portkey).
thinkingstring--Extended thinking mode: "enabled" or "adaptive" (Sonnet 4.6+).
effortstring--Thinking effort: "low", "medium", "high".

[ai.claude_cli]

Settings for the Claude Code CLI provider (provider = "claude-cli").

KeyTypeDefaultDescription
effortstring--Thinking effort: "low", "medium", "high", "xhigh", "max".

[ai.gemini]

Settings for the Gemini provider (provider = "gemini").

KeyTypeDefaultDescription
explicit_prompt_cachingboolfalseUse explicit caching hints in requests.

[ai.openai_compat]

Settings for OpenAI-compatible providers (provider = "openai-compat").

KeyTypeDefaultDescription
base_urlstring--API endpoint URL.
context_window_sizeinteger--Context window size (optional).
max_tokensinteger--Max output tokens (optional).

[ai.kiro_cli]

Settings for the Kiro CLI provider (provider = "kiro-cli").

KeyTypeDefaultDescription
binarystring"kiro-cli"Path to the kiro-cli binary.
agentstring--Custom agent name (optional).
context_window_sizeinteger200000Context window size.

[server]

KeyTypeDefaultDescription
hoststring"::"Listen address. "::" binds to all interfaces (IPv4 and IPv6).
portinteger8080Listen port for the web UI and API.
read_onlyboolfalseWhen true, disables write API endpoints. Set automatically by --no-api.

[git]

KeyTypeDefaultDescription
repository_pathstring--Path to the kernel git repository used for patch application and context.

[[git.custom_remotes]]

Optional array of additional git remotes to track.

KeyTypeDefaultDescription
namestring--Remote name.
urlstring--Remote URL.
check_all_branchesbool--Try all branches as baselines.
only_brancheslist--Restrict to specific branches (optional).

[review]

KeyTypeDefaultDescription
concurrencyinteger--Number of concurrent reviews.
worktree_dirstring--Directory for git worktrees used during review.
timeout_secondsinteger3600Maximum time per review (seconds).
max_retriesinteger3Retry count on transient failures.
max_lines_changedinteger10000Skip patches with more changed lines than this.
max_files_touchedinteger200Skip patches touching more files than this.
ignore_fileslist[]File patterns to skip during review (e.g. MAINTAINERS).
email_policy_pathstring"email_policy.toml"Path to the email policy file.
max_total_tokensinteger5000000Maximum cumulative uncached tokens (input + output) per review. Cached tokens are excluded. Set to 0 to disable.
max_total_output_tokensinteger500000Maximum cumulative output tokens per review. Set to 0 to disable.

[subsystems]

Controls how patches and emails are categorized into subsystems for targeted reviews and specific email policies. By default, this section is empty, meaning the system relies on fallback heuristics (like identifying @vger.kernel.org addresses) to determine subsystems.

This feature is globally active and applies to both mailing list (NNTP) and Forge (Webhook) ingestion.

KeyTypeDefaultDescription
mappinglist of objects[]A list of rules mapping a regular expression pattern to a subsystem name.

Each mapping object in the list requires two fields:

  • pattern (string): A regular expression used for matching.
  • name (string): The resulting subsystem name if the pattern matches.

How it works:

  • For Git Forges (Webhooks): The system applies the pattern against the file paths modified by a pull request (e.g., matching ^drivers/net/.*).
  • For Mailing Lists (NNTP): The system applies the pattern against the To and Cc email addresses of the incoming patch email.

When a patch is tagged with a subsystem, it can trigger subsystem-specific AI review rules (context loading) and specific email/embargo policies defined in email_policy.toml.

[subsystems]
mapping = [
    { pattern = ".*drivers/.*", name = "Drivers" },
    { pattern = ".*net/.*", name = "Networking" },
    { pattern = ".*fs/.*", name = "Filesystems" },
    { pattern = ".*mm/.*", name = "Memory Management" },
]

email_policy.toml

Controls how Sashiko sends (or suppresses) review emails. See docs/examples/email_policy.toml for an annotated example.

KeyTypeDefaultDescription
defaults.reply_allboolfalseAllow sending to public mailing lists.
defaults.reply_to_authorboolfalseSend review to the patch author.
defaults.cc_individualsboolfalseCC individual recipients (non-mailing-list) on review emails.
defaults.mute_allbooltrueSuppress all email sending.
defaults.cclist[]Static CC addresses.
defaults.ignored_emailslist[]Author addresses to ignore entirely.
defaults.subject_prefixeslist[]Subject prefix patterns to match for this scope.
defaults.embargo_hoursinteger--Hours to wait before sending a review. When a patch matches multiple subsystems, the shortest configured embargo wins.
defaults.send_positive_reviewboolfalseSend email even when no issues are found.

The email policy also supports per-subsystem overrides via [subsystems.<name>] sections. Each subsystem section accepts the same fields as [defaults], plus:

KeyTypeDefaultDescription
listslist[]Mailing list addresses that map to this subsystem.
patchwork.enabledboolfalseEnable Patchwork integration for this subsystem.
patchwork.api_urlstring--Patchwork REST API URL (e.g. https://patchwork.kernel.org/api/1.3). Trailing slashes are stripped automatically. Invalid schemes are rejected with a warning.
patchwork.tokenstring--Patchwork API token. Can also be set via SASHIKO_PATCHWORK_TOKEN env var (fills in where token is omitted in TOML).
patchwork.emailstring--Email address for email-based Patchwork notifications.
patchwork.min_severitystring--Minimum finding severity to include in patchwork checks. Findings below this threshold are excluded. Accepts: Low, Medium, High, Critical (case-insensitive). Default: all findings included.
patchwork.fail_severitystringHighMinimum severity of NEW findings that triggers the fail check state instead of warning. New findings at or above this threshold produce fail; below it produce warning. Pre-existing findings never affect the check state.

Patchwork integration

Sashiko can report review results as checks on a Patchwork instance. Two delivery modes are available and can be enabled simultaneously for the same subsystem.

API mode posts checks directly to the Patchwork REST API with retry-queuing (3 attempts, exponential backoff). Requires a maintainer API token. Note: Patchwork tokens grant full project-maintainer permissions (state changes, delegation, etc.), not just check access.

[subsystems.net.patchwork]
enabled = true
api_url = "https://patchwork.kernel.org/api/1.3"
token = "your-api-token"   # or set SASHIKO_PATCHWORK_TOKEN env var

Email mode sends a structured notification email to a bot address. A local script (such as pw_tools) parses the email and posts the check. This avoids giving Sashiko a write token.

[subsystems.linux-media.patchwork]
enabled = true
email = "pw-bot@lists.example.org"

Severity filtering and check state mapping

By default, all findings are included in the patchwork check count. Set min_severity to exclude findings below a threshold. When all findings fall below the threshold, the check is posted as success.

The check state depends only on new findings (not pre-existing):

  • fail -- new findings at or above fail_severity (default: High)
  • warning -- new findings below fail_severity
  • success -- no new findings (pre-existing findings are still shown in the description but do not affect the state)

The check description shows a per-severity breakdown with pre-existing counts in parentheses, dropping zero-count severities. For example: Critical: 1 · High: 2 (1 pre-existing).

[subsystems.net.patchwork]
enabled = true
api_url = "https://patchwork.kernel.org/api/1.3"
min_severity = "Medium"    # exclude Low findings entirely
fail_severity = "High"     # High+ new findings = fail (default)

Edge case behaviors:

  • Missing or null preexisting flag on a finding is treated as new
  • When min_severity filters out all findings, the check is success with "Sashiko AI review found no regressions"
  • When only pre-existing findings remain after filtering, the check is success but the description shows the pre-existing breakdown

Email notification format

When email mode is enabled, Sashiko sends a plain-text email with:

  • To: the configured patchwork.email address
  • Subject: [sashiko-check] {status} - {patch_subject}
  • Body (one key-value pair per line):
msgid: <message-id>
status: success|warning
description: Sashiko AI review found N potential issue(s)
target_url: https://sashiko.dev/#/patchset/...
context: sashiko

Downstream tools can parse this format with simple line splitting.

Environment variables

VariableDescription
LLM_API_KEYAPI key for the configured LLM provider (universal fallback).
GEMINI_API_KEYAPI key for Gemini (takes precedence over LLM_API_KEY).
ANTHROPIC_API_KEYAPI key for Claude (takes precedence over LLM_API_KEY).
OPENAI_API_KEYAPI key for OpenAI-compatible providers (takes precedence over LLM_API_KEY).
ANTHROPIC_BASE_URLOverride the Claude API base URL (for proxies).
ANTHROPIC_VERTEX_PROJECT_IDGCP project ID for Vertex AI provider.
CLOUD_ML_REGIONGCP region for Vertex AI provider.
SASHIKO_SERVEROverride daemon URL for CLI commands.
SASHIKO__*Override any Settings.toml value (e.g. SASHIKO__AI__PROVIDER).
SASHIKO__FORGE__WEBHOOK_SECRETOverride webhook secret from Settings.toml. Avoids storing the secret on disk.
SASHIKO_PATCHWORK_TOKENPatchwork API token. Fills in patchwork.token for enabled subsystems that have api_url set but no explicit token in TOML.
NO_COLORDisable ANSI color output.
SASHIKO_LOG_PLAINUse plain log format (no level/target/timestamp).