GCA · REFERENCE

    Configuration

    The unified .gadriel.toml file — every knob explained.

    Gadriel Code — Configuration (.gadriel.toml)

    gadriel reads a single unified project config file, .gadriel.toml, at the repository root. It supplies defaults for the flags documented in the CLI reference — a CLI flag or environment variable still overrides it for any one-off invocation. The file is committed to the repo; it never holds secrets.

    Generate a fully-commented starter file with gadriel code init — see Scaffolding.

    Contents

    Discovery & precedence

    The loader merges layers in this order — later layers win (crates/gadriel-cli/src/config/loader.rs, defaults.rs):

    1. Built-in defaults (compiled into the binary — see config/defaults.rs).
    2. Global file~/.gadriel/config.toml. Errors here are downgraded to warnings (the CLI keeps working).
    3. Project file./.gadriel.toml. Errors here are hard errors (the repo config must be valid).
    4. Environment variablesGADRIEL_* (preferred), with PREFLIGHT_* legacy fallbacks for a small set of keys.
    5. CLI flags — applied by each command handler, highest priority.

    In short:

    CLI flag  >  GADRIEL_*/env  >  ./.gadriel.toml  >  ~/.gadriel/config.toml  >  built-in default
    

    Each section is a partial — setting one key in a section (e.g. [scan] fail_on) does not reset the section's other keys; they still fall through to the lower layers. An empty or missing .gadriel.toml resolves every key to its documented default (fail-open).

    Path overrides

    MechanismEffect
    gadriel [--config <PATH>] code <cmd>The global --config <PATH> flag replaces ./.gadriel.toml in the stack for every command (scan, report, …). It takes precedence over the env var and the default ./.gadriel.toml lookup. Works in either position (gadriel --config X code scan or gadriel code scan --config X).
    GADRIEL_PROJECT_CONFIG_PATH=<PATH>Points the loader at a project config file outside the repo root (also the test seam). Overridden by --config.
    GADRIEL_GLOBAL_CONFIG_PATH=<PATH>Overrides the global-file location (~/.gadriel/config.toml).

    Sections

    [scan]

    Defaults for gadriel code scan.

    KeyTypeDefaultPaired flagNotes
    fail_onstring"none"--fail-onnone|info|low|medium|high|critical
    osv_auto_syncstring"prompt"--osv-auto-syncyes|no|prompt
    no_osvboolfalse--no-osvSkip OSV/CVE consumption.
    osv_ecosystemsstring"auto"--osv-ecosystemsauto|all|<csv> (e.g. pypi,npm).
    git_historyboolfalse--git-historyL4 git-history secret sweep.
    workspace_taintbooltrue--no-workspace-taint (inverts)Cross-file SAST taint analysis.
    scan_iacboolfalse--scan-iacEXPERIMENTAL Terraform/K8s/CFN/Helm.
    corroborateboolfalse--corroborateEXPERIMENTAL Tier-1 external-tool corroboration.
    output_formatstring"ocsf"--output-formatocsf|json|sarif (findings file).
    regen_htmlbooltrue--no-html (inverts)Auto-regen the HTML bundle post-scan.
    [scan]
    fail_on = "critical"
    osv_auto_sync = "yes"
    scan_iac = true

    [report]

    Defaults for gadriel code report.

    KeyTypeDefaultPaired flagNotes
    frameworksarray<string>[]--compliancee.g. ["soc2","pci-dss"] or ["all"]. Empty = supply on the CLI.
    formatsarray<string>["pdf","html"]--formatAny of pdf, markdown, html.
    fail_onstring"verdict"--fail-onverdict|render-only.
    executivebooltrue--no-executive (inverts)Emit the executive/CISO PDF.
    [report]
    frameworks = ["soc2", "pci-dss"]
    formats = ["pdf", "html"]
    fail_on = "verdict"
    executive = true

    [init]

    Defaults for gadriel code init.

    KeyTypeDefaultNotes
    skip_hooksboolfalseSkip git hook installation.
    skip_claudeboolfalseSkip the .claude/ scaffold.
    policies_urlstringhttps://github.com/Gadriel-ai/gadriel-code-policiesRule-corpus repo URL (shares its default with top-level policies_repo_url).
    platformsarray<string>[]e.g. ["cursor","codex"].

    [mcp]

    Defaults for gadriel code mcp.

    KeyTypeDefaultNotes
    auth_token_envstring"GADRIEL_TOKEN"Name of the env var to read the auth token from — never the token itself.

    [tier2]

    Host-LLM semantic-analysis layer. Off by default.

    KeyTypeDefaultNotes
    enabledboolfalseEnable Tier-2. Resolution order: --tier2 flag ▸ GADRIEL_TIER2/GADRIEL_TIER2_ENABLED env ▸ this key ▸ false.
    source_consentboolfalsePersisted --send-source consent. Privacy-gated — when true, sends source to your configured model; never auto-enables.
    [tier2]
    enabled = false
    source_consent = false

    [secrets]

    Secrets-detector signal toggles.

    KeyTypeDefaultNotes
    generic_keywordbooltrueGeneric keyword-based secret detection.
    generic_entropyboolfalseGeneric entropy-based secret detection.

    Top-level keys

    .gadriel.toml (and the global ~/.gadriel/config.toml) also accept flat, non-sectioned keys. These are not written into the starter file but are valid overrides. Defaults from config/defaults.rs:

    KeyDefault
    portal_urlhttps://app.gadriel.ai
    auth_token_path~/.gadriel/auth/token.jwt
    auth_offline_grace_days7
    policies_repo_urlhttps://github.com/Gadriel-ai/gadriel-code-policies
    policies_repo_branchmain
    policies_local_path./gadriel-code-policies
    store_dir~/.gadriel/store/
    repo_store_dir./.security/store/
    osv_mirror_urlhttps://osv-vulnerabilities.storage.googleapis.com
    osv_max_staleness_days7
    osv_auto_refresh_days7
    osv_ecosystems_modeauto
    claude_api_urlhttps://api.anthropic.com
    claude_model_defaultclaude-3-5-sonnet-latest
    claude_model_escalationclaude-3-opus-latest
    claude_l1_confirmationtrue
    claude_rate_limit_rpm60
    agent_runnerclaude
    mcp_server_port8765
    dashboard_port8765
    dashboard_open_browsertrue
    install_urlhttps://get.gadriel.ai
    homebrew_tapgadriel-ai/tap/gadriel
    npm_package@gadriel/cli
    history_retention_days90
    verdict_pass_thresholdgadriel_scoring::PASS_THRESHOLD
    verdict_partial_thresholdgadriel_scoring::PARTIAL_THRESHOLD

    verdict_pass_threshold must be within 0.0..=10.0 and strictly greater than verdict_partial_threshold, or the project file is rejected as a hard error.

    Environment variables

    Every sectioned key has a matching GADRIEL_<SECTION>_<KEY> env var (which sits between the config file and CLI flags in precedence). The most operationally relevant:

    VariableEffect
    PREFLIGHT_OFFLINELocal-only mode for any command — runs without a portal token. (PREFLIGHT_LOCAL is an alias.)
    GADRIEL_TIER2Shorthand for [tier2].enabled (1/true/yes/on = on). GADRIEL_TIER2_ENABLED wins if both are set.
    GADRIEL_TIER2_SOURCE_CONSENTSets [tier2].source_consent. Part of the --send-source consent chain (fix.rs).
    GADRIEL_CALIBRATION_TABLEExplicit path to the false-positive-prevention calibration table (commands/code/stubs.rs).
    GADRIEL_AUTH_TOKEN_PATHOverride the auth-token cache path read by the auth layer (auth/cache.rs).
    GADRIEL_TOKEN_PATHSets the config key auth_token_path.
    GADRIEL_TOKENDefault env var the MCP server reads the auth token from (name is configurable via [mcp].auth_token_env).

    Section-key env vars (all GADRIEL_*):

    SectionVariables
    [scan]GADRIEL_SCAN_FAIL_ON, GADRIEL_SCAN_OSV_AUTO_SYNC, GADRIEL_SCAN_NO_OSV, GADRIEL_SCAN_OSV_ECOSYSTEMS, GADRIEL_SCAN_GIT_HISTORY, GADRIEL_SCAN_WORKSPACE_TAINT, GADRIEL_SCAN_SCAN_IAC, GADRIEL_SCAN_CORROBORATE, GADRIEL_SCAN_OUTPUT_FORMAT, GADRIEL_SCAN_REGEN_HTML
    [report]GADRIEL_REPORT_FRAMEWORKS (csv), GADRIEL_REPORT_FORMATS (csv), GADRIEL_REPORT_FAIL_ON, GADRIEL_REPORT_EXECUTIVE
    [init]GADRIEL_INIT_SKIP_HOOKS, GADRIEL_INIT_SKIP_CLAUDE, GADRIEL_INIT_POLICIES_URL, GADRIEL_INIT_PLATFORMS (csv)
    [mcp]GADRIEL_MCP_AUTH_TOKEN_ENV
    [tier2]GADRIEL_TIER2, GADRIEL_TIER2_ENABLED, GADRIEL_TIER2_SOURCE_CONSENT
    [secrets]GADRIEL_SECRETS_GENERIC_KEYWORD, GADRIEL_SECRETS_GENERIC_ENTROPY

    Booleans accept 1, true, yes, or on (case-insensitive) for "on"; anything else is "off".

    Flat-key env vars follow the mapping in loader.rs (e.g. GADRIEL_PORTAL_URL, GADRIEL_OSV_MIRROR_URL, GADRIEL_VERDICT_PASS_THRESHOLD, …). A small legacy set falls back to PREFLIGHT_* when the GADRIEL_* name is unset (GADRIEL_PORTAL_URLPREFLIGHT_PORTAL_URL, GADRIEL_CLAUDE_MODEL_DEFAULTPREFLIGHT_LLM_MODEL); using a legacy name emits a one-shot migration warning.

    Secrets never go in the file

    Credentials are never read from .gadriel.toml. A top-level key that looks like a secret — ANTHROPIC_API_KEY, GADRIEL_TOKEN, PREFLIGHT_API_KEY, PREFLIGHT_AUTH_TOKEN — is dropped silently and surfaced as an operator warning; set it as an environment variable instead. [mcp] auth_token_env stores the name of an env var to read the token from, not a token value.

    Scaffolding with gadriel code init

    gadriel code init writes a fully-commented starter .gadriel.toml at the repo root. Its values are read live from Config::default(), so the scaffold never drifts from the code defaults it documents. Refresh it later with gadriel code init --upgrade (appends any new section a later version ships; never touches a section you already customised) or --force to replace wholesale.

    Starter file (default values):

    # .gadriel.toml — Gadriel project configuration.
    #
    # Precedence (highest wins):
    # inline CLI flag > GADRIEL_*/ANTHROPIC_* env > this file >
    # ~/.gadriel/config.toml (global) > built-in defaults
    #
    # Secrets NEVER go here (ANTHROPIC_API_KEY, GADRIEL_TOKEN, ...) — set them as
    # environment variables. `[mcp] auth_token_env` stores the NAME of an env var,
    # never a token value.
    [scan]
    fail_on = "none" # none|info|low|medium|high|critical (--fail-on)
    osv_auto_sync = "prompt" # yes|no|prompt (--osv-auto-sync)
    no_osv = false # skip OSV/CVE consumption (--no-osv)
    osv_ecosystems = "auto" # auto|all|<csv> (--osv-ecosystems)
    git_history = false # L4 git-history secret sweep (--git-history)
    workspace_taint = true # cross-file SAST taint (--no-workspace-taint inverts)
    scan_iac = false # EXPERIMENTAL Terraform/K8s/CFN/Helm (--scan-iac)
    corroborate = false # EXPERIMENTAL Tier-1 tool corrob. (--corroborate)
    output_format = "ocsf" # ocsf|json|sarif (findings file) (--output-format)
    regen_html = true # auto-regen HTML bundle post-scan (--no-html inverts)
    [report]
    frameworks = [] # e.g. ["soc2","pci-dss"] or ["all"] (--compliance)
    formats = ["pdf", "html"] # (--format)
    fail_on = "verdict" # verdict|render-only (--fail-on)
    executive = true # emit executive/CISO PDF (--no-executive inverts)
    [init]
    skip_hooks = false
    skip_claude = false
    policies_url = "https://github.com/Gadriel-ai/gadriel-code-policies"
    platforms = [] # cursor|windsurf|copilot|codex|claude-code|…
    [mcp]
    auth_token_env = "GADRIEL_TOKEN" # NAME of the env var to read the token from
    [tier2]
    enabled = false # host-LLM semantic layer — OFF by default
    source_consent = false # persist --send-source consent; privacy-gated
    [secrets] # detector signal toggles
    generic_keyword = true
    generic_entropy = false

    See also: CLI reference. </content>