Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

flock.toml reference

Layered configuration for governance, shell policy, hooks, and MCP permissions. Schema source: crates/flock-governance/src/config.rs.

File locations (merge order)

LayerPathPrecedence
User~/.flock/config.tomllowest
Projectflock.toml (walk up from cwd)middle
Local.flock/local.toml (same repo as project flock.toml)highest

Later layers override earlier ones. CLI flags and environment variables override all files.

Example

[governance]
session_spend_cap_usd = 12.5
max_risk_score = 0.85
denied_paths = ["/secret", "~/.ssh"]

[shell]
allowed_commands = ["echo", "cargo", "git"]
denied_commands = ["rm", "curl"]
denied_patterns = ["sudo .*"]
max_output_bytes = 65536

[permissions]
default_mode = "ask"
[permissions.tools]
flock_propose_mutation = "deny"
flock_deposit_signal = "allow"

[[hooks.hooks]]
event = "PreToolUse"
command = "./scripts/hooks/pre-tool.sh"

Sections

[governance]

KeyTypeDescription
session_spend_cap_usdfloatSession spend ceiling
max_risk_scorefloatRisk score threshold
denied_pathsstring[]Paths blocked for tool/file access

[shell]

KeyTypeDescription
allowed_commandsstring[]Allowlist for shell plugin
denied_commandsstring[]Blocked command names
denied_patternsstring[]Regex patterns to block
max_output_bytesintegerCap captured stdout/stderr

[permissions]

KeyTypeDescription
default_modeallow | ask | denyDefault MCP tool policy
[permissions.tools]mapPer-tool overrides

Permission modes filter tools/list before exposure to MCP clients.

[[hooks.hooks]]

KeyTypeDescription
eventstringHook event name
commandstringShell command to invoke

See Agent hooks.

Environment overrides

VariableMaps to
FLOCK_SESSION_SPEND_CAP_USDgovernance.session_spend_cap_usd
FLOCK_MAX_RISK_SCOREgovernance.max_risk_score
FLOCK_SHELL_ALLOWEDCSV → shell.allowed_commands
FLOCK_SHELL_DENIEDCSV → shell.denied_commands
FLOCK_DENIED_PATHSCSV → governance.denied_paths
FLOCK_PERMISSION_MODEpermissions.default_mode

Full list: Environment variables.