Skip to main content

Module config

Module config 

Source
Expand description

Manage the app configuration by creating, deleting and modify the configuration

Structs§

AgentConfig
Configuration for AI agent guardrails.
Config
describe configuration folder
CustomChecksLoad
Result of loading the user’s custom checks directory.
LlmConfig
Configuration for the optional LLM-powered command analysis.
ResolvedSettings
Read-only view of settings with per-mode overrides resolved.
SandboxConfig
Extra paths for shellfirm sandbox.
Settings
Describe the configuration yaml
SettingsLock
Guard for Config::lock_settings; the lock is released on drop.
SeverityEscalationConfig
Configuration for severity-based challenge escalation.
WrapperToolConfig
Per-tool configuration for the shellfirm wrap proxy.
WrappersConfig
Configuration for the shellfirm wrap PTY proxy.

Enums§

Challenge
The user challenge when user need to confirm the command.
InheritOr
Per-mode override sentinel. Inherit means “use the global value”; Set(value) means “override with this value.”
Mode
Runtime context that a settings value applies to.

Constants§

ALWAYS_ON_BUILTIN_RULE_IDS
Built-in agent-protection rules that stay on with agent.self_protection: false (they protect the machine, or they guard the analysis itself).
BUILTIN_RULE_IDS
Every built-in agent-protection rule id (shellfirm-self:*, shellfirm:*). The others are switched off together with agent.self_protection: false.
CONFIG_DIR_ENV
Environment variable naming the configuration directory, with the same meaning as --config-dir (an explicit --config-dir wins).
CRITICAL_CONTEXTS
What makes a context critical (see ELEVATED_CONTEXTS).
DEFAULT_BLAST_RADIUS_BUDGET_MS
Default for Settings::blast_radius_budget_ms.
DEFAULT_CHALLENGE
DEFAULT_ENABLED_GROUPS
ELEVATED_CONTEXTS
What makes a context elevated, worded the same in status, config show, the TUI and the docs.
EXIT_USAGE
Exit code for a usage mistake (EX_USAGE-like, the same as clap’s): a typo’d group name in check --list -g and config groups.
IGNORABLE_BUILTIN_RULE_IDS
Built-in agent-protection rule ids that may be listed in ignores_patterns_ids.
MAX_BLAST_RADIUS_BUDGET_MS
Upper bound for Settings::blast_radius_budget_ms (ms).
MAX_SETTINGS_BACKUPS
Number of settings.yaml.bak.* files kept by config reset.
SUPPORTED_LLM_PROVIDERS
LLM provider names understood by shellfirm.

Functions§

ascii_fallback
Replace the non-ASCII punctuation shellfirm prints (—, →, ✓, ✗, …, ·, ×) with ASCII when the locale is not UTF-8.
builtin_protection_refusal
Why id (a built-in agent protection id) cannot be put on the given list, or None when it can (list is ignores_patterns_ids or deny_patterns_ids).
check_id_format_problem
Why a check id does not follow the group:snake_case form the built-in checks use (git:force_push, fs-strict:any_deletion), or None.
check_id_has_hidden_chars
true when a check id has characters that would make it look like a different id when printed: whitespace, control, bidi or zero-width characters. Such a custom check is not loaded.
color_preference
What the environment says about colour, before looking at whether the output is a terminal.
config_dir_from_env
The configuration directory named by a CONFIG_DIR_ENV value.
enable_groups_command
The command that enables groups (shellfirm config groups --enable a --enable b).
glyph
unicode under a UTF-8 locale, ascii otherwise.
is_builtin_protection_id
true for an id of a built-in agent protection rule (shellfirm-self:*, shellfirm:*) rather than a check.
known_check_ids
Every check id shellfirm knows about: built-ins plus the given custom checks.
known_groups
Every check group name: built-in groups (including ones that are off by default, such as shell) plus the groups of the given custom checks.
known_settings_keys
All top-level keys understood by Settings.
load_custom_checks_report
Load custom checks from every *.yaml / *.yml file in checks_dir.
one_line
Collapse a (possibly multi-line) message into a single line.
parse_settings_lenient
Parse settings YAML leniently.
parse_settings_strict
Parse settings YAML strictly.
read_regular_file
Read path only when it is a regular file (or a symlink to one). A FIFO or a device at a settings path would block the read, or never end.
read_regular_string
read_regular_file as UTF-8 text.
suggest_similar
Up to max candidates similar to needle, best first.
unicode_locale
Whether text output may use non-ASCII glyphs (—, →, ✓): the first non-empty of LC_ALL, LC_CTYPE, LANG names a UTF-8 locale, or none is set.
unicode_output
unicode_locale for this process (computed once).
unknown_group_message
The one message for a group name that does not exist, with a “Did you mean” hint (check --list -g gti, config groups --disable gti).
unknown_reference_warnings
Warnings for settings entries that name an unknown check id or group.
unknown_settings_key_warnings
Human-readable warnings for unknown settings keys, with “did you mean” suggestions.
unknown_settings_keys
Return the keys in content that Settings does not know.
value_set
Set a value at a dot-notation path, creating intermediate mappings as needed.