Files
fermata/docs/configuration.md
T
g4borg 34298c5f9a fix(fermata): a shell behind a wrapper and a verb given by path are read; the forms that stay text are named
The bash/sh/zsh/eval unwrap reads the word after the prefix walk, so sudo, env,
timeout, nohup, exec, xargs, busybox and X=1 in front of a shell no longer hide
its command line. A prefix counts by its file name, as a verb already did, so
/bin/bash -c, /usr/bin/env cat and /usr/bin/timeout 5 cat are read.

Named as limits, each with a test in known_limits.rs: dash -c, ksh -c,
bash -c -- x, eval past its first argument, sudo -u root bash -c, and on the read
gate eval cat id_rsa and cat <&3 id_rsa. (re-check I-3, I-4 leftover, I-5's stale line)
2026-11-07 02:11:10 +01:00

20 KiB

Configuration Reference

Do not use this software. fermata is an experiment. It does not protect your secrets, and secrets can and do reach the model while it is installed. This document describes what fermata tries to do. See Known limits for where it fails.

Fermata reads .botsecrets (in up to three layers) and any number of .botignore files, to control what an AI coding agent can access and what secret values it can see. .botsecrets is the primary configuration file. Most projects need only this file.

File Where Purpose Syntax
.botsecrets project root Declare secrets, control redaction, and set policy rules TOML
.botsecrets.local project root, git-ignored Developer-specific overrides of the project file TOML
.botsecrets ~/.config/fermata/ (Linux/macOS) or %APPDATA%\fermata\ (Windows) User-global defaults for every project TOML
.botignore any directory of the project (optional) Block agent access to matching paths gitignore

fermata.toml is accepted as an alias for .botsecrets (same format, .botsecrets takes priority when both exist).

A field fermata does not know is an error. Every section rejects unknown fields, so a typo, or a setting that no longer exists ([enforcement] mode, on_parse_error = "mask-entire-file"), makes that layer fail to load. The hooks then switch that layer's rules off and say so beside text output (naming the file and the line); under on_parse_error = "deny" they refuse instead; fermata check exits 2. A stale user-global .botsecrets with an unknown field therefore affects every project on the machine, and it also makes Dirigent refuse every agent-channel message from that machine (see docs/configuration/matrix.md in the Dirigent repository).

Configuration is layered, with later (more specific) sources overriding earlier ones. All files are optional. Without any configuration Fermata allows all operations and performs no redaction.


.botsecrets -- Secret Redaction and Policy

.botsecrets declares which files contain secrets, how Fermata should redact them from tool output, and (optionally) access control policy rules. The aim is to keep secret values out of the LLM context window, also when the agent reads files indirectly (via shell output or log files). Many values get through: see Known limits.

Layered Configuration

.botsecrets configuration is layered, with later sources overriding earlier ones:

  1. Built-in defaults -- sensible patterns that cover common secret files and key names.
  2. User-global -- ~/.config/fermata/.botsecrets (Linux/macOS) or %APPDATA%\fermata\.botsecrets (Windows). Applies to all projects.
  3. Project -- <project-root>/.botsecrets. Checked into version control.
  4. Local overrides -- <project-root>/.botsecrets.local. Git-ignored, for machine-specific or developer-specific settings.

Merge rules:

  • Vec fields (files.patterns, heuristic.patterns, file_overrides): replaced by the more specific layer when present.
  • Key lists (keys.include, keys.exclude): accumulated across layers (appended, not replaced).
  • Scalar fields (redaction.style, heuristic.enabled, enforcement.on_parse_error, etc.): the most specific value wins.

[files] -- Secret File Patterns

Declares which files contain secrets. Fermata parses these files, extracts key-value pairs, and uses the values for exact-match redaction.

Field Type Default Description
patterns string[] See below Glob patterns matching files that contain secrets.

Built-in default patterns (active when [files] is not specified):

.env, .env.*, *.env, secrets.*, credentials.*, *.key, *.pem, *.p12, *.pfx,
id_rsa, id_ed25519, id_ecdsa, Secrets.toml, Secrets.*.toml,
terraform.tfvars, *.auto.tfvars, terraform.tfstate, *.tfstate,
*.tfstate.backup, .docker/config.json, config/master.key,
config/credentials/*.key, .aws/credentials, credentials, .netrc, .htpasswd,
service-account.json, service-account-key.json

Fermata chooses a parser from the file's name:

Files Format
.env, .env.*, *.env, credentials, terraform.tfvars, *.auto.tfvars, .aws/credentials, secrets.{sh,bash,zsh,ini,conf,cfg} .env style (KEY=value, [section] lines skipped)
*.toml, *.json, *.yaml, *.yml, *.py, *.properties (also secrets.* and credentials.* with these extensions) TOML, JSON, YAML (every document), Python assignments, properties
*.tfstate, *.tfstate.backup JSON. Its secrets sit by position, not by key, so a Read is always stopped
*.pem, *.key, id_rsa, id_ed25519, id_ecdsa, config/master.key, config/credentials/*.key Opaque text: a secret as a whole. A Read is stopped unless its armor labels are only certificates and public keys (other text in the file is not looked at). A PEM private block's body, or a single token of 16 or more characters, becomes a manifest entry
.netrc, .htpasswd, *.p12, *.pfx No parser. A Read is stopped, and nothing from them is masked

A [[file]] override can name a format. A leading UTF-8 byte order mark is read. UTF-16, Latin-1 and JSON with comments do not parse. A file named secrets.* or credentials.* takes its parser from its extension (secrets.yaml, secrets.sh). One with a source or template extension (rs, ts, go, java, md, tf, example, template, and so on) is taken for code that handles secrets, and is neither parsed nor stopped.

The read gate. A Read, a Grep with a path, or a printing command (cat, grep, ...) naming an existing file on this list that fermata cannot mask is stopped, under every on_parse_error: the file has no parser, is a secret as a whole, cannot be parsed, holds lines no value can be read from, or marks its secrets by position. The setting is [enforcement] on_unparsed_read. Other routes (grep -r, a script that opens the file, a verb off the list) pass the gate, and the file's values are not masked there. A file with {{ or {% that fails to parse passes as a template. See Known limits.

Setting files.patterns in a layer replaces the defaults entirely. A glob here or in [policy] that does not compile costs only that pattern, with a note naming it beside text output, and a list with no usable pattern leaves the built-in list. Under on_parse_error = "deny" it refuses instead, and fermata check exits 2.

[files]
patterns = [".env", ".env.*", "config/secrets.yaml"]

[keys] -- Secret Key Name Patterns

Controls which key names within secret files are treated as sensitive. Patterns use glob syntax and are matched case-insensitively.

Field Type Default Description
include string[] [] Additional key name patterns to treat as secret. Accumulated across layers.
exclude string[] [] Key name patterns to remove from the effective set. Exact string match against the pattern text, with one alias: *AUTH* removes the three patterns that replaced it.

Fermata ships with ~30 built-in key patterns that are always active:

*PASSWORD*, *SECRET*, *API_KEY*, *APIKEY*, *TOKEN*, *ACCESS_KEY*,
*PRIVATE_KEY*, *AUTH, *AUTH[!O]*, *AUTHORIZATION*, *CREDENTIAL*,
*CONNECTION_STRING*, DATABASE_URL,
AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, OPENAI_API_KEY, ANTHROPIC_API_KEY,
JWT_SECRET, ENCRYPTION_KEY, MASTER_KEY, SECRET_KEY_BASE, ...

*AUTH* is three patterns (*AUTH, *AUTH[!O]*, *AUTHORIZATION*), so that AUTHOR, AUTHORITY and AUTHORIZED_* do not match. exclude = ["*AUTH*"] removes all three; it does not remove *TOKEN*, so AUTH_TOKEN stays.

Use keys.include to add project-specific patterns. Use keys.exclude to suppress a built-in pattern that causes false positives.

Plain settings make no entry. A value that is a boolean or null word (true, off, none, ...), a number under 6 characters or a duration (30s, 2d) is never a secret, even under a matching key. A key whose last word is a setting word (TTL, TIMEOUT, PORT, POLICY, NAME, ...: core/secrets/value_class.rs has the list) makes no entry either, unless a keys.include pattern matches it or a [[file]] override names the file. So AUTH_ENABLED=true and API_TOKEN_TTL=604800 mask nothing, and DB_PASSWORD=postgres still masks postgres in every output.

[keys]
include = ["STRIPE_*", "MY_APP_SIGNING_*"]
exclude = ["*AUTH*"]  # too broad for this project

[redaction] -- Redaction Style

Controls how redacted values appear in tool output.

Field Type Default Description
style string "masked" How to replace secret values.

Available styles:

Style Output Description
masked ***** Replaces the value with asterisks. Default.
typed <REDACTED:string:12> Shows the type and the value's length (N) but not the content.
named <REDACTED:DB_PASSWORD> Shows the key name but not the value.
absent (empty string) Removes the value entirely. Where a text would come out empty it reads [fermata]. The write guard has nothing to count in this style.
[redaction]
style = "named"

[heuristic] -- Heuristic Secret Scanning

In addition to known-value redaction, Fermata can scan tool output for patterns that look like secrets (AWS keys, JWTs, GitHub PATs, high-entropy strings, database connection URLs). This looks for secrets not covered by the .botsecrets manifest, and only warns.

Field Type Default Description
enabled bool true Enable or disable heuristic scanning.
mode string "enforce" What to do when a heuristic match is found.
patterns string[] [] Additional regex patterns to scan for. Replaces the layer's custom patterns when set.

Available modes:

Mode Behavior
enforce Add a warning beside the output, naming the rules that matched. The match itself stays in the output: patterns have too many false positives to mask. Default.
report Log findings to stderr. The model sees nothing.
disabled Do not run heuristic scanning at all.
[heuristic]
enabled = true
mode = "enforce"
patterns = ["MYAPP-[A-Za-z0-9]{32}"]

[enforcement] -- Enforcement Behavior

Controls what fermata refuses.

Field Type Default Description
on_parse_error string "allow" What to do when a secret file or a config layer cannot be parsed.
on_unparsed_read string "deny" What to do with a Read of a listed file that fermata cannot mask.
on_mask_write string "deny" What to do with a Write or Edit that adds a mask to a file.

There is no mode field: an [enforcement] mode line, or on_parse_error = "mask-entire-file", is an unknown value and breaks the layer.

on_parse_error:

Action Behavior
allow Default. Go on without that file's values: they are not masked. A note beside text output names the file (or the broken config layer and its line).
deny The hooks refuse. PostToolUse answers each tool output with a refusal naming the file, until it parses. See Known limits.

on_unparsed_read: deny stops a Read of a file on the secret list that fermata cannot mask (see the read gate above), with a reason that names the file and this setting and says to ask the user; allow lets it through. It applies under every on_parse_error.

on_mask_write: deny stops a Write, Edit or MultiEdit whose new text holds more masks than the old text, because a mask stands for a value fermata hid and writing it back corrupts the file. allow turns the guard off. A shell command that writes is not checked.

Messages name the file and the line, never the line's text.

If the config itself cannot be read, the setting is unknown. Any layer with an uncommented line setting deny counts, even in a file that does not parse, and PreToolUse then refuses too. A layer whose bytes cannot be read says nothing, so it does not count. Otherwise the hooks stay open, with that layer's rules off.

Editor files never refuse: a discovered vim swap file (*.swp, then *.swo and on down to *.swa, and *.swx), Kate's *.kate-swp or a *~ that cannot be read or parsed is passed over under every setting. If it can be parsed, its values are still redacted. .bak and .env.gpg follow the setting, and so does anything named in [[file]].

[enforcement]
on_parse_error = "deny"
on_unparsed_read = "deny"
on_mask_write = "deny"

[[file]] -- Per-File Overrides

Override parsing behavior for specific secret files. Useful when a file uses a non-standard format or you only want to redact specific keys.

Field Type Required Description
path string Yes Path to the file (relative to project root).
format string No Force a specific parser: "env", "toml", "yaml", "json", "python", "properties", "tfstate", "opaque". Auto-detected from the name if omitted.
keys string[] No Only redact these specific keys from this file (instead of applying global key patterns).
[[file]]
path = "config/database.yml"
format = "yaml"
keys = ["password", "secret_key_base"]

[[file]]
path = ".env.production"
format = "env"

[policy] -- Access Control Rules

Optional access control rules embedded directly in .botsecrets.

[policy.write] -- Write Rules

Stops the Write and Edit tools on matching paths, for example vendored code, lock files and policy files. A shell command that writes to them is not checked.

Field Type Description
patterns string[] Glob patterns for paths the agent cannot write to.
[policy.write]
patterns = [".claude/**", "vendor/**", "*.lock", "dist/**"]

[policy.bash] -- Command Execution Rules

Controls which shell commands the agent can run, for Bash, PowerShell and Monitor.

Field Type Description
deny string[] Patterns that block commands outright.
allow_prefixes string[] Command prefixes that skip the ask rules below. deny still applies. It approves nothing: fermata never answers allow, so Claude Code's own permission prompt stays. To approve a command, use its permissions.allow.
ask string[] Patterns requiring user confirmation.
[policy.bash]
deny = ["rm -rf /", "curl * | sh"]
allow_prefixes = ["cargo", "npm", "just"]
ask = ["docker", "kubectl"]

[policy.read] -- Read Restrictions (Rarely Needed)

Stops the Read tool on matching paths, and a printing command (cat, grep, ...) that names a matching file. A command that hides the file name (a variable, a substitution, a script) is not checked.

[policy.read]
patterns = ["*.sqlite", "*.dat"]

.botignore -- Path-Based Access Control

For most projects, .botsecrets with [policy] is sufficient. .botignore remains useful for monorepo subtree exclusion or teams that prefer gitignore syntax for simple path blocking.

A .botignore file uses gitignore syntax to stop the Read, Write and Edit tools on matching paths, and commands that name a matching file (the verb decides: see below). When a path matches, both reads and writes are denied. There is no distinction between operations -- if you need per-operation control, use the [policy] section in .botsecrets instead.

Placement and Scoping

.botignore files can be placed at any level of your project directory tree. Fermata walks the project root recursively and loads every .botignore it finds. Each file is scoped to its own directory:

myproject/
  .botignore          # applies to the entire project
  infra/
    .botignore        # applies only under infra/
  src/
    .botignore        # applies only under src/

When multiple .botignore files match the same path, the deepest (most specific) file wins. A negation pattern (!) at any depth overrides an ignore from a shallower .botignore.

Syntax

These gitignore rules apply. A directory pattern such as vendor/ matches the files below it, as in git (!vendor/keep allows one back), and a relative path is taken against the project root. The path is also checked as the file system resolves it, so a symlink does not hide its target.

Commands. A command is checked for the files it names, by the verb of each segment: a printing verb (cat head tail less more bat nl tac cut sort uniq grep egrep fgrep rg awk sed strings xxd od hexdump base64 gc type get-content select-string) meets .botignore, [policy.read] and the read gate; a metadata verb (ls stat file test [ du which echo printf, git status, git commit, ...) meets nothing; every other verb (source, cp, rm, python) meets the rules but not the read gate. Only a word that names an existing file, an existing path with a separator, a path with $, * or ? in it, or a redirect's target counts; $(...), scripts and a verb off the list that opens the file itself are not seen. The argument of bash|sh|zsh -c and the first argument of eval are read as a command line, also behind a wrapper (sudo bash -c, X=1 bash -c) or given by path (/bin/bash -c); another shell (dash -c) is not. [policy.write] is not applied to commands. The forms that pass, and the harmless commands a rule stops, are in Layer 3.

  • Blank lines and lines starting with # are ignored.
  • * matches anything except /.
  • ** matches zero or more directories.
  • A trailing / matches directories only.
  • A leading / anchors the pattern to the .botignore file's directory.
  • Prefix a pattern with ! to negate (whitelist) a previously ignored path.

Example

# Block entire subtrees in a monorepo
packages/legacy-app/**
vendor/**

# Block private keys
*.pem
*.key
id_rsa
id_ed25519

# But allow the public key
!id_ed25519.pub

Examples

Minimal: Just Redact Secrets (most projects)

# .botsecrets
[files]
patterns = [".env", ".env.*"]

Standard: Redact Secrets + Write Rules

# .botsecrets
[files]
patterns = [".env", ".env.*", "secrets/*.yaml"]

[keys]
include = ["STRIPE_*"]

[policy.write]
patterns = [".claude/**", "vendor/**", "*.lock"]

[policy.bash]
deny = ["rm -rf /", "curl * | sh"]

With .botignore: Simple Path Blocking + Redaction

For teams that prefer gitignore syntax:

# .botignore (optional)
node_modules/**
build/**
dist/**
# .botsecrets
[files]
patterns = [".env", ".env.*"]

Every section of .botsecrets at once, for redaction and policy:

# .botsecrets
[files]
patterns = [".env", ".env.*", "config/credentials.yaml"]

[keys]
include = ["STRIPE_*", "PLAID_*"]
exclude = ["*AUTH*"]

[redaction]
style = "named"

[heuristic]
enabled = true
mode = "enforce"

[enforcement]
on_parse_error = "allow"
on_unparsed_read = "deny"
on_mask_write = "deny"

[policy.write]
patterns = [".claude/**", "vendor/**", "*.lock", "dist/**", "migrations/**"]

[policy.bash]
deny = ["rm -rf /", "curl * | sh"]
allow_prefixes = ["cargo", "npm", "just", "git"]
ask = ["docker", "terraform"]

[policy.read]
patterns = ["*.sqlite", "*.dat"]

[[file]]
path = "config/credentials.yaml"
format = "yaml"
keys = ["api_key", "webhook_secret"]
# .botsecrets.local (git-ignored, developer-specific)
[redaction]
style = "masked"

[enforcement]
on_parse_error = "allow"