docs(fermata): the failure list moves out of the READMEs into docs/known-failures.md
One list, merged from both READMEs and security-model.md "Known limits", each entry with its test. Entries fixed on this branch are gone. Both READMEs keep the warning and point at the page. tests/docs_known_failures.rs keeps the page and known_limits.rs in step, and test_crate_export.py checks that the public README's links resolve in the exported tree.
This commit is contained in:
+4
-4
@@ -1,6 +1,6 @@
|
||||
# CLI Command 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](security-model.md#known-limits) for where it fails.
|
||||
> **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 failures](known-failures.md) for where it fails.
|
||||
|
||||
Fermata is an experiment in stopping tool calls by rule and masking secret values in tool output. It ships two subcommands: `check` for interactive path validation and `hook` for integration with AI harness hook systems.
|
||||
|
||||
@@ -79,9 +79,9 @@ The hook payload is always read from **stdin** as JSON. The response is written
|
||||
| 0 | Success. The JSON response on stdout tells the harness what to do. |
|
||||
| 2 | Internal error (unknown harness, unknown event type, stdin read failure) |
|
||||
|
||||
Fermata follows a **fail-open** policy for hooks: if the payload cannot be parsed, it writes `{}` to stdout and exits 0 so the agent can continue. If a config layer cannot be loaded (including a field fermata does not know), only that layer's rules are off, and PostToolUse adds a note beside text output naming the file and line. A glob that does not compile costs only that pattern, with a note naming it. A tool PreToolUse has no rules for answers `{}` without a message. Errors are reported on stderr and never quote a file.
|
||||
Fermata follows a **fail-open** policy for hooks: if the payload cannot be parsed, it writes `{}` to stdout and exits 0 so the agent can continue. If a config layer cannot be loaded (including a field fermata does not know), only that layer's rules are off, and PostToolUse adds a note beside text output naming the file and line. A glob that does not compile costs only that pattern, with a note naming it, its section and its layer. A tool PreToolUse has no rules for answers `{}` without a message. Errors are reported on stderr and never quote a file.
|
||||
|
||||
The exception is `on_parse_error = "deny"` (the default is `allow`). If the config or a secret file cannot be loaded, `post-tool-use` answers with a refusal naming the file, in a form the tool's output schema accepts; if the config or the rules cannot be loaded or applied, `pre-tool-use` answers deny. See [`on_parse_error`](configuration.md) for what happens when the config itself is the broken file. Claude Code drops a replacement that its schema rejects and uses the original: see [Known limits](security-model.md#known-limits).
|
||||
The exception is `on_parse_error = "deny"` (the default is `allow`). If the config or a secret file cannot be loaded, `post-tool-use` answers with a refusal naming the file, in a form the tool's output schema accepts; if the config or the rules cannot be loaded or applied, `pre-tool-use` answers deny. See [`on_parse_error`](configuration.md) for what happens when the config itself is the broken file. Claude Code drops a replacement that its schema rejects and uses the original: see [Known failures](known-failures.md).
|
||||
|
||||
**Event types**
|
||||
|
||||
@@ -138,7 +138,7 @@ patterns = [".env", ".env.*"]
|
||||
enabled = true
|
||||
```
|
||||
|
||||
The `.botignore` stops the Read, Write and Edit tools on those paths, and a printing command such as `cat .env` that names one of them. It does not see a command that hides the name (`cat $(...)`, a script). The `.botsecrets` tries to mask the values of the files it can parse in the output of tools that succeed.
|
||||
The `.botignore` stops the Read, Write and Edit tools on those paths, and a command such as `cat .env` or `cp a.txt .env` that names one of them. It does not see a command that hides the name (`cat $(...)`, a script). The `.botsecrets` tries to mask the values of the files it can parse in the output of tools that succeed.
|
||||
|
||||
### Single-file setup with .botsecrets
|
||||
|
||||
|
||||
+17
-16
@@ -1,6 +1,6 @@
|
||||
# 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](security-model.md#known-limits) for where it fails.
|
||||
> **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 failures](known-failures.md) 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
|
||||
@@ -36,7 +36,7 @@ operations and performs no redaction.
|
||||
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](security-model.md#known-limits).
|
||||
through: see [Known failures](known-failures.md).
|
||||
|
||||
### Layered Configuration
|
||||
|
||||
@@ -87,14 +87,14 @@ Fermata chooses a parser from the file's name:
|
||||
| `.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 |
|
||||
| `*.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 it holds only certificate and public key blocks, and beside them only blank lines, comments, `Bag Attributes` and their indented lines, `subject=`, `issuer=` or the head of `openssl x509 -text`. 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](security-model.md#known-limits).
|
||||
**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 failures](known-failures.md).
|
||||
|
||||
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.
|
||||
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, its section and its layer 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.
|
||||
|
||||
```toml
|
||||
[files]
|
||||
@@ -209,7 +209,7 @@ There is no `mode` field: an `[enforcement] mode` line, or `on_parse_error = "ma
|
||||
| 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](security-model.md#known-limits). |
|
||||
| `deny` | The hooks refuse. PostToolUse answers each tool output with a refusal naming the file, until it parses. See [Known failures](known-failures.md). |
|
||||
|
||||
`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`.
|
||||
|
||||
@@ -257,7 +257,7 @@ 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.
|
||||
lock files and policy files, and a command that writes to them (see Commands below).
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
@@ -339,17 +339,18 @@ 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
|
||||
meets `.botignore`, `[policy.read]` and the read gate; a metadata verb as a bare word
|
||||
(`ls stat file test [ du which echo printf`, `git status`, `git commit`, ...) meets
|
||||
nothing; a write (a redirect's target, `cp mv rm touch mkdir tee sed -i`, the value of
|
||||
`-o`, the rest in [Layer 3](security-model.md#layer-3-access-control-botignore--botsecrets-policy))
|
||||
meets `.botignore`, `[policy.write]` and `[policy.read]`, also for a file not there yet;
|
||||
every other verb (`source`, `python`, `chmod`) meets `.botignore` and `[policy.read]`. 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
|
||||
`*` or `?` in it, or a file the command writes counts; `$(...)`, scripts and a verb off
|
||||
the list that opens the file itself are not seen. The argument of a shell's `-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](security-model.md#layer-3-access-control-botignore--botsecrets-policy).
|
||||
`X=1 bash -c`) or given by path (`/bin/bash -c`). The forms that pass, and the harmless
|
||||
commands a rule stops, are in [Known failures](known-failures.md).
|
||||
|
||||
- Blank lines and lines starting with `#` are ignored.
|
||||
- `*` matches anything except `/`.
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
# Known failures
|
||||
|
||||
> **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 page lists where fermata is known to fail. The list is not complete.
|
||||
|
||||
Each entry names its test in `tests/known_limits.rs`. That test runs the fermata binary with fake values and asserts that the failure happens. An entry marked "Claude Code's documentation" comes from that documentation and from the v2.1.314 bundle, and has no test. The test suite never runs Claude Code, and none of this has been checked in a live session.
|
||||
|
||||
In the commands below, `.env` is under a rule in `.botignore` or `[policy.read]`, unless the entry says otherwise.
|
||||
|
||||
## A tool that fails
|
||||
|
||||
This is the largest limit for values fermata knows.
|
||||
|
||||
- A failed tool's output goes down a path no hook can rewrite. That includes a Bash command with a non-zero exit code and an MCP error result. `cat .env; false` shows the file if no rule names it, and so does a failing `npm test` that prints its environment, `curl -v -f` with a token header on a 500, or a failing `set -x` script. (Claude Code's documentation. Test: `the_failed_tool_event_is_not_hooked`.)
|
||||
- A rule stops only what names the file. `cat .env; false`, `cat ./.env; false` and `source .env; false` are stopped. `env; false`, `grep -r TOKEN .; false`, `printenv; false` and a failing `npm test` pass. (Test: `cat_env_then_false_is_stopped_only_under_a_rule_and_only_for_what_names_the_file`.)
|
||||
- On the default configuration a parseable `.env` is not stopped at all, by any route. (Test: `on_default_config_a_parseable_env_is_not_stopped_at_all`.)
|
||||
|
||||
## Commands a rule does not see
|
||||
|
||||
The check reads the command's text, not what the shell makes of it.
|
||||
|
||||
- A substitution that builds the name, and a script that opens the file: `cat $(printf '.e%s' nv)`, `python -c "print(open('.env').read())"`, `sh run.sh`. (Test: `a_variable_a_substitution_and_a_script_hide_the_file_from_the_command_rules`.)
|
||||
- A form where the name is not a word of its own: `echo "$(cat .env)"`, `bash <<EOF` with `cat .env` in its body, `find . -name .env -exec cat {} \;`, `curl -d @.env`, `curl -F file=@.env`, `git show HEAD:.env`, `git show :.env`, `cat .{env,x}`. (Test: `a_command_that_names_the_file_in_a_form_the_check_does_not_read_passes`.)
|
||||
- A command line the check does not read as one: `bash -c -- 'cat .env'`, `eval` past its first argument (`eval 'true' 'cat .env'`), and a shell behind a wrapper's flag value (`sudo -u root bash -c 'cat .env'`). (Test: `a_command_line_the_check_does_not_read_as_one_passes`.)
|
||||
- A printing verb off the list: `python -c`, `perl -e`. (Test: `a_printing_verb_off_the_list_is_not_checked_against_the_rules_unless_it_names_the_file`.)
|
||||
- A ruled file run as the program itself: `./.env`, `sudo vendor/bin/x` under a rule on `vendor/`. (Test: `a_ruled_file_run_as_the_program_passes`.)
|
||||
- A change of directory: `cd ../other && cat .env`. A secret file in no project has no rules at all. (Test: `a_command_that_prints_a_secret_file_outside_the_project_passes`.)
|
||||
- A command run in one project does not meet another project's rules: `cat ../other/x` passes, while a Read of that file is stopped. (Test: `a_command_in_one_project_is_not_stopped_by_another_projects_rule`.)
|
||||
- A new file named to a verb off the writing list: `git clone https://example.invalid/x vendor/new`, `unzip a.zip -d vendor/new`, `python make.py vendor/new`, and a flag's value such as `cp --target-directory=vendor/new a.txt`. (Test: `a_new_file_named_to_a_verb_off_the_writing_list_is_not_checked`.)
|
||||
|
||||
## Secret files fermata cannot mask
|
||||
|
||||
A Read, a Grep with that `path` and a printing command that names such a file are stopped. Other routes are not.
|
||||
|
||||
- A route that does not name the file: `grep -r TOKEN .`, `ls -R`, `tar cf x.tar .`, a script that opens it. This holds for `*.p12`, `*.pfx`, `.netrc`, `.htpasswd` and a text `*.key`. (Test: `an_unmaskable_file_is_reached_by_a_route_that_does_not_name_it`.)
|
||||
- A printing verb off the list: `dd if=server.p12`, `perl -ne print server.p12`, `python3 show.py server.p12`. (Test: `a_printing_verb_not_on_the_list_passes_the_read_gate`.)
|
||||
- A form the gate does not read: `sudo -u root cat id_rsa`, where the flag's value becomes the verb; `eval cat id_rsa`, where only the first argument is read as a command line; `cat <&3 id_rsa`, where `<&` ends the segment; `cat */id_rsa` and `cat ./s*/a.key`, a glob over directories. A rule on the file's name still stops each of them. (Test: `a_flag_value_as_verb_and_a_glob_over_directories_pass_the_read_gate`.)
|
||||
- The stop needs the PreToolUse hook. Without it a Read reaches the model, and PostToolUse has nothing to mask in it. (Test: `the_read_gate_stands_only_in_a_pre_tool_use_hook`.)
|
||||
- A text with `{{` or `{%` that does not parse passes as a template, and a literal value in it reaches the model. (Test: `a_template_holding_a_literal_value_passes_a_read`.)
|
||||
- A certificate file may hold comment lines and indented attribute lines beside its blocks, so a value spelled as one of them passes: `# fake-value`, ` api_token: fake-value`. (Test: `a_comment_or_an_attribute_line_beside_a_certificate_passes`.)
|
||||
- A UTF-16 or Latin-1 `.env`, and JSON with comments, are stopped on a Read. Their values are not masked in the output of other commands. (Test: `a_utf16_or_latin1_file_or_json_with_comments_is_not_masked_when_no_command_names_it`.)
|
||||
|
||||
## Values that never enter the list of known secrets
|
||||
|
||||
These values then reach the model.
|
||||
|
||||
- A key the key filter does not match, in a parsed file. (Test: `a_key_the_filter_does_not_match_leaves_its_value_in_a_parsed_file`.)
|
||||
- A `.tfvars` heredoc. (Test: `a_tfvars_heredoc_is_not_masked`.)
|
||||
- A `*.tfvars` other than `terraform.tfvars` and `*.auto.tfvars`. (Test: `a_tfvars_file_off_the_list_is_not_masked`.)
|
||||
- A comment in a TOML or YAML secret file. (Test: `a_comment_in_a_toml_or_yaml_secret_file_is_not_masked`.)
|
||||
- The first value of a duplicate JSON key. (Test: `the_first_value_of_a_duplicate_json_key_is_not_masked`.)
|
||||
- A `.env` value inside a quoted value that spans several lines, when a program prints it alone. With `API_TOKEN="abc` over a line `DB_PASSWORD=fake-pass` and a closing quote on a later line, `echo $DB_PASSWORD` shows it. (Test: `a_value_inside_a_quoted_value_that_spans_lines_is_not_masked_when_printed_alone`.)
|
||||
- Python triple quotes, on one line or over several. (Tests: `a_python_triple_quoted_value_on_one_line_is_not_masked`, `a_python_triple_quoted_value_over_several_lines_is_not_masked`.)
|
||||
- Shell-quoted spellings such as `'a'\''b-x` and `abc"def"-x`, when a program prints the decoded value. (Test: `a_shell_quoted_value_is_not_masked_when_a_program_prints_it_decoded`.)
|
||||
- A number under 6 characters. (Test: `a_number_under_six_characters_is_not_masked`.)
|
||||
- A secret number that an MCP tool returns as a JSON number. (Test: `a_secret_number_in_mcp_structured_content_is_not_masked`.)
|
||||
- A secret equal to a plain setting word (`true`, `3600`, a short duration). It makes no entry. (Test: `tests/core_value_class.rs`.)
|
||||
- A secret file outside the working project: a Read of `../other/.env` and `cat ../other/.env` pass. (Test: `a_secret_file_outside_the_project_is_not_masked_and_a_read_of_it_passes`.)
|
||||
- A run with no `.botsecrets` or `.botignore` above the working directory: there is nothing to load, and the output passes. (From the code: `find_project_root` finds no root.)
|
||||
|
||||
## Masks that do too much or too little
|
||||
|
||||
- A short password's word is masked everywhere, in other files too. `DB_PASSWORD=postgres` masks `postgres` in every output. (Test: `a_short_passwords_word_is_masked_in_other_files_too`.) An Edit copied from such masked text fails, since Claude Code's Edit needs the real text. (Claude Code's documentation.)
|
||||
- A line of fewer than 8 characters of a multi-line value passes when printed alone, by a grep or a line range. (Test: `a_short_line_of_a_multi_line_value_is_not_masked`.)
|
||||
- A value split across strings, or encoded, does not match: a value divided between `stdout` and `stderr` or two MCP content blocks, base64, URL encoding, a value cut short. (Test: `a_value_split_across_strings_or_encoded_is_not_masked`.)
|
||||
- A binary field stays as it is: `base64` in a built-in's output, image data, Bash's image `stdout`. A mask there would break the next API request. (Test: `a_binary_field_is_not_masked`.)
|
||||
- A secret the heuristic scanner finds gets a warning, and the value stays. (Test: `a_heuristic_finding_is_warned_about_and_not_masked`.)
|
||||
- A secret equal to a schema's fixed word stays in that field. A later Claude Code's new enums are not known. (Test: `a_secret_equal_to_a_schema_enum_value_is_not_masked`; Claude Code's bundle for the later enums.)
|
||||
|
||||
## Routes no hook sees
|
||||
|
||||
All of these come from Claude Code's documentation and bundle, and have no test.
|
||||
|
||||
- Monitor's output. Each line of a Monitor's command goes to the model as an event, and PostToolUse only sees `{taskId, timeoutMs}`. `tail -f server.log` passes logged tokens straight through.
|
||||
- A changed file's attachment. After a Read, a file that changes on disk comes back to the model with a snippet. Read `.env`, rotate the token, and the next turn carries the new value. `@`-mentions likely take the same route; that has not been traced.
|
||||
- A hook that times out lets the output through.
|
||||
|
||||
## The write guard
|
||||
|
||||
The guard stops a Write or Edit that adds a mask to a file. It does not cover these.
|
||||
|
||||
- A shell command that writes a mask: `sed -i 's/x/*****/' a.txt`, `echo '*****' > new.txt`. (Test: `a_shell_command_that_writes_a_mask_is_not_checked`.)
|
||||
- `style = "absent"` leaves nothing to count. (Test: `the_absent_style_leaves_nothing_for_the_guard_to_count`.)
|
||||
- A real run of exactly five asterisks in a Write is stopped as if it were a mask. (Test: `a_real_five_star_run_is_stopped_as_if_it_were_a_mask`.)
|
||||
|
||||
## Harmless commands a rule stops
|
||||
|
||||
- A verb given by a path counts as no metadata verb: `/bin/ls .env`.
|
||||
- `git` with any flag before its command other than `--no-pager`, `-P`, `--no-optional-locks` and `-C`: `git -c core.pager=x status .env`.
|
||||
- A word with a separator and `$`, `*` or `?` may be a path once the shell expands it: `git log vendor/$BRANCH`, `curl example.invalid/vendor/$ID`, `composer require vendor/*` under a rule on `vendor/`.
|
||||
- The text after `=` in a flag off the short exclude list: `tool --name=.env`.
|
||||
- A value flag of a tool other than `grep` and `rg`, or one off their list: `grep --color always .env a.txt` takes `always` as the pattern.
|
||||
|
||||
(Test for all five: `a_harmless_command_a_rule_still_stops`.)
|
||||
+11
-50
@@ -1,6 +1,6 @@
|
||||
# fermata Security Model
|
||||
|
||||
> **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](#known-limits) for where it fails.
|
||||
> **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 failures](known-failures.md) for where it fails.
|
||||
|
||||
## The Problem
|
||||
|
||||
@@ -20,7 +20,7 @@ Most security models think about secrets in terms of *files*: can the agent read
|
||||
|
||||
**Reveal** -- Do secret *values* enter the LLM context? A file read that configures a database is not a security event. The same file read that feeds credentials to an LLM *is*.
|
||||
|
||||
These three dimensions are independent. In theory an agent could have read access to `.env` without the secret values being revealed, if the output were masked before it reached the model. The agent would see file structure and key names and not the values. fermata tries this and does not achieve it reliably: see [Known limits](#known-limits).
|
||||
These three dimensions are independent. In theory an agent could have read access to `.env` without the secret values being revealed, if the output were masked before it reached the model. The agent would see file structure and key names and not the values. fermata tries this and does not achieve it reliably: see [Known failures](known-failures.md).
|
||||
|
||||
The key insight is that Read and Write operate on file identity (*which file*). Reveal operates on data content (*which values*). File identity alone does not answer the reveal question.
|
||||
|
||||
@@ -32,7 +32,7 @@ The design has four layers. Layers 1 and 2 operate on data content (the actual s
|
||||
|
||||
Parse secret-containing files at startup, extract actual secret values, build an Aho-Corasick automaton. Scan all tool output for those exact byte strings and replace them with redaction markers.
|
||||
|
||||
This layer looks at values, not at how they reached the output: file reads, shell command output, log files. If a value such as `fake-db-pass-1` (the `DB_PASSWORD` of a parsed `.env`) made it into the manifest, every occurrence in a string of a successful tool's output is masked: the Aho-Corasick automaton finds all of them in a single linear pass. Many values never reach the manifest, and much output never reaches the scan: see [known limits](#known-limits).
|
||||
This layer looks at values, not at how they reached the output: file reads, shell command output, log files. If a value such as `fake-db-pass-1` (the `DB_PASSWORD` of a parsed `.env`) made it into the manifest, every occurrence in a string of a successful tool's output is masked: the Aho-Corasick automaton finds all of them in a single linear pass. Many values never reach the manifest, and much output never reaches the scan: see [Known failures](known-failures.md).
|
||||
|
||||
### Layer 2: Heuristic Detection (Scanner + gitleaks patterns)
|
||||
|
||||
@@ -44,27 +44,16 @@ Its false-positive rate is higher than Layer 1's, which is why it warns: masking
|
||||
|
||||
### Layer 3: Access Control (.botignore / .botsecrets [policy])
|
||||
|
||||
Stop the tool calls your rules name, and a Read of a secret file that fermata cannot mask. With `[policy.write]` on `.claude/**`, `Write .claude/settings.json` is denied. With `[policy.bash] deny = ["rm -rf /"]`, `Bash: rm -rf /` is denied. Without rules nothing is stopped, apart from the two gates below. Path patterns apply to the Read, Write and Edit tools (and Grep with a `path`, which counts as a Read), and command patterns match the text of a command.
|
||||
Stop the tool calls your rules name, and a Read of a secret file that fermata cannot mask. With `[policy.write]` on `.claude/**`, `Write .claude/settings.json` is denied. With `[policy.bash] deny = ["rm -rf /"]`, `Bash: rm -rf /` is denied. Without rules nothing is stopped, apart from the two gates below. Path patterns apply to the Read, Write and Edit tools (and Grep with a `path`, which counts as a Read), and command patterns match the text of a command. A `~/` in a tool's path is the home directory.
|
||||
|
||||
- **Commands that name a file.** A command is split into segments, and each word that names an existing file, an existing path with a separator, a path with `$`, `*` or `?` in it, or a redirect's target is checked. So `composer require vendor/package` and `git checkout build/fix` name nothing under a rule on `vendor/` or `build/`. The argument of `bash -c`, `sh -c`, `zsh -c` and `eval` is read as a command line of its own, and `sudo env time nohup command exec timeout nice ionice stdbuf xargs busybox` before a verb do not hide it. Which check depends on the segment's verb. 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 the path rules and the read gate. Any other verb (`source`, `cp`, `rm`, `python`) meets the path rules only. A metadata verb (`ls stat file test [ du which echo printf`, and `git status`, `git check-ignore`, `git ls-files`, `git commit`) meets nothing. So with `.env` in `.botignore`, `cat .env`, `cat ./.env; false` and `source .env` are denied, while `env`, `grep -r TOKEN .` and `git commit -m ".env loading"` pass.
|
||||
- **Commands that name a file.** A command is split into segments, and each word that names an existing file, an existing path with a separator, a path with `$`, `*` or `?` in it, or a file the command writes is checked. So `composer require vendor/package` and `git checkout build/fix` name nothing under a rule on `vendor/` or `build/`. The argument of a shell's `-c` (`bash sh zsh dash ksh mksh ash yash fish csh tcsh pwsh powershell`, also PowerShell's `-Command` and `cmd /c`) and of `eval` is read as a command line of its own, and `sudo env time nohup command exec timeout nice ionice stdbuf xargs busybox` before a verb do not hide it. A wrapper counts by its file name only as a bare word or an absolute path, so `./do .env` is a script called on the file. After an absolute path (`/home/me/env .env`) the next word still counts as a path, because that may be a script too. Which check depends on the segment's verb. 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 the path rules and the read gate. A writing verb meets `.botignore`, `[policy.write]` and `[policy.read]`, also for a file that is not there yet, and not the read gate: a redirect's target, every path of `mv rm rmdir touch mkdir tee truncate shred set-content add-content out-file new-item remove-item move-item` and of `sed -i`, the last path of `cp ln install rsync scp copy-item`, `dd of=`, and the value of `-o` or `--output` (`wget -O`). Any other verb (`source`, `python`, `chmod`) meets `.botignore` and `[policy.read]`. A metadata verb (`ls stat file test [ du which echo printf`, and `git status`, `git check-ignore`, `git ls-files`, `git commit`) given as a bare word meets nothing. So with `.env` in `.botignore`, `cat .env`, `cat ./.env; false` and `source .env` are denied, while `env`, `grep -r TOKEN .` and `git commit -m ".env loading"` pass.
|
||||
- **Read gate.** A Read (or a Grep with a `path`, or a printing command that names the file) of a file on the secret list that fermata cannot mask is stopped under every `on_parse_error`. The reason names the file and the setting `[enforcement] on_unparsed_read` and says to ask the user. The files are: a file with no parser (`.netrc`, `.htpasswd`, `.p12`, `.pfx`), a key file that is a secret as a whole (`*.pem`, `*.key`, `id_rsa`, `id_ed25519`, `id_ecdsa`, unless it holds only certificates), `*.tfstate` (its secrets sit by position, not by key), and a file that cannot be parsed (a broken file, a UTF-16 or Latin-1 file, JSON with comments, text with a NUL). `on_unparsed_read = "allow"` turns the gate off.
|
||||
- **Write guard.** A Write, Edit or MultiEdit that adds a mask to a file is stopped, because the mask stands for a value fermata hid and writing it back corrupts the file. `[enforcement] on_mask_write = "allow"` turns it off.
|
||||
- **`.botignore` and relative paths.** A directory pattern such as `vendor/` matches the files below it, 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 what it points at.
|
||||
|
||||
Reading `.env` is allowed by default, and only Layer 1 stands between its values and the model. On the default configuration a parseable `.env` is not stopped at all, by any route.
|
||||
|
||||
**Limitations of the command check.** It sees the command's text, not what the shell makes of it. These pass:
|
||||
|
||||
- A substitution that builds the file name (`cat $(printf '.e%s' nv)`), and `echo "$(cat .env)"`: a substitution inside double quotes is one word.
|
||||
- A script that opens the file (`sh run.sh`, `python -c "print(open('.env').read())"`), a heredoc fed to a shell (`bash <<EOF` with `cat .env` in its body), and a printing verb that is not on the list (`dd`, `perl`, `python -c`).
|
||||
- A shell other than `bash`, `sh` and `zsh` (`dash -c 'cat .env'`, `ksh -c`), `bash -c -- 'cat .env'`, `eval` past its first argument (`eval 'true' 'cat .env'`), and a shell behind a wrapper's flag value (`sudo -u root bash -c 'cat .env'`). `sudo bash -c`, `X=1 bash -c`, `timeout 5 bash -c` and `/bin/bash -c` are read.
|
||||
- `find . -name .env -exec cat {} \;`, `curl -d @.env`, `curl -F file=@.env`, `git show HEAD:.env`, `git show :.env` and `cat .{env,x}`: the name is not a word of its own.
|
||||
- `cd ../other && cat .env`, and a command run in one project under another project's rules. A secret file outside every project has no rules at all.
|
||||
- A file a command is about to make (`cp a.txt vendor/new`, `touch vendor/new`) is not there to check. A redirect's target is.
|
||||
|
||||
The read gate also misses `sudo -u root cat id_rsa`, where the flag's value `root` becomes the verb; `eval cat id_rsa`, where only the first argument is read as a command line; `cat <&3 id_rsa`, where `<&` ends the segment; and `cat */id_rsa` and `cat ./s*/a.key`, a glob over directories, which is no file. A rule on the file's name still stops each of them.
|
||||
|
||||
**Harmless commands it stops.** Under a rule on `.env`: `grep -A 2 .env a.txt`, `grep -m 1 .env a.txt` and `rg -t py .env`, where a flag's value takes the pattern's place; `grep -r TOKEN --exclude=.env .`, `tar --exclude=.env -cf x.tar .`, `rsync --exclude=.env a b` and `npm test -- --grep=.env`, where the text after `=` counts as a path; and `git --no-pager status .env`, where a flag before `status` loses the metadata class.
|
||||
Where the command check fails, in both directions: [Known failures](known-failures.md).
|
||||
|
||||
### Layer 4: Structural Containment (External)
|
||||
|
||||
@@ -78,7 +67,7 @@ fermata does not own this layer. It would come from a container runtime, VM, or
|
||||
|
||||
**Not a permission approver.** PreToolUse can stop a call or ask, and otherwise says nothing. It never answers `allow`, because Claude Code would then skip its own permission prompt, and installing a guard must not remove one. `allow_prefixes` only skips fermata's own `ask` rules.
|
||||
|
||||
**Every occurrence of a value in the manifest.** If a value made it into the secret manifest (loaded from files matched by `.botsecrets`), it is masked in every string of a successful tool's output, or the output is refused. The [known limits](#known-limits) say what never reaches the manifest or the scan.
|
||||
**Every occurrence of a value in the manifest.** If a value made it into the secret manifest (loaded from files matched by `.botsecrets`), it is masked in every string of a successful tool's output, or the output is refused. [Known failures](known-failures.md) says what never reaches the manifest or the scan.
|
||||
|
||||
**Speed.** Hooks fire on every tool call, and each call loads the config and parses the secret files again. Measured with a release build of this branch (commit e493fb4d, `cargo build --release`, an Intel i7-12700H laptop, a throwaway project), the whole hook process, including start-up: PreToolUse 2 ms; PostToolUse with a two-line `.env` 5 to 9 ms; PostToolUse with a 2.3 MB `secrets.json` of 35000 keys 0.13 s. Before the parser used hash lookups, a 1.7 MB file of the same shape took 6.6 s in the same kind of release build, and the time grew quadratically with the size. A hook that times out lets the original output through.
|
||||
|
||||
@@ -86,39 +75,11 @@ fermata does not own this layer. It would come from a container runtime, VM, or
|
||||
|
||||
**Single policy file.** `.botsecrets` is the unified configuration interface. One file declares both what to redact (`[files]`, `[keys]`, `[heuristic]`) and what to restrict (`[policy]`).
|
||||
|
||||
## Known limits
|
||||
## What masking covers
|
||||
|
||||
The PostToolUse hook redacts what Claude Code hands it and accepts back. These are the edges. They were read from Claude Code's documentation and the output schemas bundled in v2.1.314, and have not yet been checked in a live session.
|
||||
The PostToolUse hook redacts what Claude Code hands it and accepts back. This was read from Claude Code's documentation and the output schemas bundled in v2.1.314, and has not yet been checked in a live session.
|
||||
|
||||
**Covered:** a value in the manifest that appears whole in any string of a successful tool's output, for every built-in tool and MCP tool, nested at any depth. The output comes back in the same shape, with only the values masked. This is a narrow promise: the list below is long and not complete. Each limit marked "test" is shown through the binary by `tests/known_limits.rs`, which asserts that the failure happens; the others come from Claude Code's documentation and bundled code.
|
||||
|
||||
**Not covered:**
|
||||
|
||||
- **A tool that fails. This is the largest limit for values in the manifest.** Claude Code sends a failed tool's text through `PostToolUseFailure`, whose hooks can only add a note. That includes a Bash command with a non-zero exit code, whose error text holds the command's output, and an MCP error result. `cat .env; false` reaches the model unredacted, and so does a failing `npm test` that prints its environment, `curl -v -f` with a token header on a 500, or any failing `set -x` script. This is from Claude Code's documentation and bundle; fermata does not hook the event (test: the event is no hook event here). Only a rule stops such a command, and only for what names the file. With `.env` in `.botignore` or `[policy.read]`, `cat .env; false`, `cat ./.env; false` and `source .env; false` are denied, while `env; false`, `grep -r TOKEN .; false`, `printenv; false` and a failing `npm test` pass. On the default configuration a parseable `.env` is not stopped at all (test).
|
||||
- **Commands are checked only for the files they name, in the forms the check reads.** Every form listed under Layer 3 has a test, as do the read gate's misses and the harmless commands it stops.
|
||||
- **Secret files that cannot be masked, reached by a route that does not name them.** `.p12`, `.pfx`, `.netrc`, `.htpasswd` and a text `.key` are stopped when a Read, a Grep with that `path` or a printing command names them, but `grep -r TOKEN .`, `ls -R` and `tar cf x.tar .` pass, and so does a printing command off the verb list (test). A `~` in Grep's `path` is not expanded, so `path = "~/.ssh/id_rsa"` passes (test). The read gate stands in a PreToolUse hook only: without PreToolUse wired, a Read of such a file reaches the model, and PostToolUse has nothing to mask in it (test).
|
||||
- **A template that holds a literal value.** Text with `{{` or `{%` that fails to parse passes a Read as a template, with a note that the file was skipped. A literal value in it reaches the model (test).
|
||||
- **A key file holding only certificate labels.** A `.pem` is judged by its armor labels: only `CERTIFICATE` and `PUBLIC KEY` blocks and it passes a Read and `cat`, whatever other text it holds, such as `API_TOKEN=x`, a lowercase `-----begin private key-----` or a raw key with no armor (test). Real PEMs carry text such as `Bag Attributes`, so a stricter check would stop those.
|
||||
- **Files that cannot be parsed, reached by a route that does not name them.** A UTF-16 or Latin-1 `.env`, and JSON with comments, are stopped on a Read but their values are not masked in the output of other commands (test). A UTF-8 byte order mark is read, and does not count here.
|
||||
- **A secret file outside the working project.** Values in `../other/.env` are not in the manifest, and a Read, a `cat ../other/.env` and `cd ../other && cat .env` pass (test).
|
||||
- **Values that never enter the manifest.**
|
||||
- A key the key filter does not match, in a parsed file (test); a `.tfvars` heredoc (test); a `*.tfvars` other than `terraform.tfvars` and `*.auto.tfvars` (test); a comment in a TOML or YAML secret file (test).
|
||||
- The first value of a duplicate JSON key (test).
|
||||
- A `.env` value inside a quoted value that spans several lines, when a program prints it alone: with `API_TOKEN="abc` over a line `DB_PASSWORD=fake-pass` and a closing quote on a later line, `echo $DB_PASSWORD` prints the second value, which has no entry of its own (test).
|
||||
- Python triple quotes, on one line or over several (test), and shell-quoted spellings such as `'a'\''b-x` and `abc"def"-x`, when a program prints the decoded value (test).
|
||||
- A number under 6 characters (test), and a secret number that an MCP tool returns as a JSON number (test).
|
||||
- A secret equal to a plain setting word (`true`, `3600`, a short duration): it makes no entry. Values equal to a schema's fixed enum word are not masked in that field (test).
|
||||
- **A short password's word is masked everywhere.** `DB_PASSWORD=postgres` masks `postgres` in every output (test). An Edit copied from such masked text fails, since Claude Code's Edit needs the real text (Claude Code's documentation).
|
||||
- **Short lines of a multi-line value.** A line of fewer than 8 characters of a multi-line value passes when printed alone, by a grep or a line range (test).
|
||||
- **Monitor's output.** Each line of a Monitor's command goes to the model as an event, and PostToolUse only sees `{taskId, timeoutMs}`. `tail -f server.log` passes logged tokens straight through (Claude Code's documentation). `[policy.bash]` and the path rules apply to Monitor's and PowerShell's commands, with the limits above. A WebSocket Monitor (`ws`, no `command`) has no rule and no output: the hook leaves it alone.
|
||||
- **A changed file's attachment.** After a Read, a file that changes on disk comes back to the model as an attachment with a snippet, which no tool call and no hook handles. Read `.env`, rotate the token, and the next turn carries the new value (Claude Code's bundle). `@`-mentions likely take the same route; that has not been traced.
|
||||
- **A hook that times out lets the output through** (Claude Code's documentation). See Speed above.
|
||||
- **A value split across strings, or encoded.** Each string is scanned on its own. A value divided between `stdout` and `stderr`, between two MCP content blocks, or across the lines of a diff does not match. Base64, URL encoding, a reversed string or a value cut short does not match (test). Spellings the value has in its own file are known: see [Spellings](#spellings). See the [threat model](threat-model.md).
|
||||
- **Binary data.** `base64` in a built-in's output, `data` of 64 or more base64 characters beside `type: image`, `audio` or `base64` in a content block at the top of a result, and Bash's image `stdout` stay as they are (test). A mask there would break the image and the next API request, and a short value can match inside base64 by chance.
|
||||
- **Undeclared secrets.** The heuristic scanner warns beside the output and leaves the match in place (test).
|
||||
- **The write guard is narrow.** A shell command that writes a mask (`sed -i`, `echo '*****' > f`) is not checked (test); with `style = "absent"` there is nothing to count (test); a real run of exactly five asterisks in a Write is stopped as if it were a mask (test).
|
||||
- **Artifact, Workflow and a later Claude Code's enums.** A secret equal to a schema's fixed word stays (test); a later release's new enums are not known (Claude Code's bundle).
|
||||
- **A run outside a project.** With no `.botsecrets` or `.botignore` above the working directory, there is nothing to load and the output passes.
|
||||
**Covered:** a value in the manifest that appears whole in any string of a successful tool's output, for every built-in tool and MCP tool, nested at any depth. The output comes back in the same shape, with only the values masked. This is a narrow promise. Everything else, and every failure the tests show, is in [Known failures](known-failures.md).
|
||||
|
||||
### Spellings
|
||||
|
||||
@@ -131,7 +92,7 @@ A value has one manifest entry per spelling, so that a file read and a program's
|
||||
|
||||
**Plain settings make no entry.** Before an entry is made, a value is dropped when it is a boolean or null word (`true false yes no on off null none nil enabled disabled`, any case, quoted or not), a number or a duration under 6 characters (`3600`, `0.5`, `30s`, `15m`, `2d`). This holds for a `.env` too, and also for a key named in `keys.include` or a `[[file]]` override. Without such a naming, a value is also dropped when the key's last word (split at `.`, `_` or `-`) is a setting word: `ENABLED`, `TTL`, `TIMEOUT`, `LIMIT`, `MODE`, `PORT`, `HOST`, `POLICY`, `NAME`, `USER` and similar (the list is in `core/secrets/value_class.rs`). So `AUTH_ENABLED=true` and `API_TOKEN_TTL=604800` mask nothing, while `DB_PASSWORD=postgres` does, as it is no setting word. The built-in key pattern `*AUTH*` is three patterns (`*AUTH`, `*AUTH[!O]*`, `*AUTHORIZATION*`), so `AUTHOR`, `AUTHORITY` and `AUTHORIZED_*` no longer match; `exclude = ["*AUTH*"]` removes all three.
|
||||
|
||||
Overlapping matches become one mask, named after the longest. A multi-line value in a `.env` needs its closing quote at the end of a line. An opening quote without one is read as the plain value of that line, and the next assignment is still read. A closing quote that does come later swallows the assignments in between: see Known limits.
|
||||
Overlapping matches become one mask, named after the longest. A multi-line value in a `.env` needs its closing quote at the end of a line. An opening quote without one is read as the plain value of that line, and the next assignment is still read. A closing quote that does come later swallows the assignments in between: see [Known failures](known-failures.md).
|
||||
|
||||
**Places a mask cannot go.** Claude Code validates a replacement for a built-in tool and, if it fails, uses the original output. So:
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Fermata Threat Model
|
||||
|
||||
> **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](security-model.md#known-limits) for where it fails.
|
||||
> **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 failures](known-failures.md) for where it fails.
|
||||
|
||||
What fermata tries to catch, and where it stops.
|
||||
|
||||
@@ -16,7 +16,7 @@ Fermata does nothing against a deliberate, optimising adversary trying to escape
|
||||
|
||||
This shifts the design centre from "what can a smart attacker hide?" to "what does an unguided LLM commonly do, and how do we catch the dangerous fraction of that?" Static analysis becomes tractable when grounded in **what is usual**, not what is adversarially possible.
|
||||
|
||||
Most of what fermata tries rests on **value masking**, not on path checks. When a command reaches a file no rule looks at, a value in the manifest can still be masked in the output of a tool that succeeds. Many values never reach the manifest: see [Known limits](security-model.md#known-limits).
|
||||
Most of what fermata tries rests on **value masking**, not on path checks. When a command reaches a file no rule looks at, a value in the manifest can still be masked in the output of a tool that succeeds. Many values never reach the manifest: see [Known failures](known-failures.md).
|
||||
|
||||
---
|
||||
|
||||
@@ -28,7 +28,7 @@ Fermata works on two independent tracks: **value-level masking** and **rules for
|
||||
|
||||
Independent of path-level detection, fermata filters tool output before it enters the LLM context:
|
||||
|
||||
- **Known-value redaction** -- `.botsecrets` declares which files contain secrets. Fermata parses those files that it has a parser for, extracts the secret values, and replaces them in every string of a successful tool's output using an Aho-Corasick automaton. See [Known limits](security-model.md#known-limits).
|
||||
- **Known-value redaction** -- `.botsecrets` declares which files contain secrets. Fermata parses those files that it has a parser for, extracts the secret values, and replaces them in every string of a successful tool's output using an Aho-Corasick automaton. See [Known failures](known-failures.md).
|
||||
- **Heuristic scanning** -- regex patterns (derived from gitleaks) detect undeclared secrets in tool output: AWS access keys, JWTs, GitHub PATs, database connection strings, and similar tokens. It warns beside the output and does not mask them, so they reach the model.
|
||||
|
||||
### Rules for tool calls (PreToolUse)
|
||||
@@ -49,7 +49,7 @@ The agent runs a shell command that mentions a full path -- one containing a dir
|
||||
|
||||
> `cat /home/user/.env`, `type C:\Users\me\secret.toml`
|
||||
|
||||
**Checked, by the verb.** The command is split into segments, and a word that names an existing file, an existing path with a separator or a path with `$`, `*` or `?` in it is checked against the path rules (and, for a printing verb such as `cat`, the read gate). A metadata verb (`ls`, `echo`, `git commit`) is not checked. Only the session's own project's rules apply to a command: a rule in another project, or a secret file in no project, does not.
|
||||
**Checked, by the verb.** The command is split into segments, and a word that names an existing file, an existing path with a separator, a path with `$`, `*` or `?` in it, or a file the command writes is checked against the path rules (and, for a printing verb such as `cat`, the read gate). A metadata verb (`ls`, `echo`, `git commit`) given as a bare word is not checked. Only the session's own project's rules apply to a command: a rule in another project, or a secret file in no project, does not.
|
||||
|
||||
### L2: Bare filenames resolvable in the working directory
|
||||
|
||||
@@ -99,7 +99,7 @@ This is the network-firewall analogy: **you cannot block exfiltration over an al
|
||||
|
||||
| Level | Description | Detection | Confidence |
|
||||
|-------|-------------|-----------|------------|
|
||||
| Secret masking | Known-value masking + heuristic warning | Aho-Corasick + regex | Only for values in the manifest, whole in a string of a successful tool. See [Known limits](security-model.md#known-limits) |
|
||||
| Secret masking | Known-value masking + heuristic warning | Aho-Corasick + regex | Only for values in the manifest, whole in a string of a successful tool. See [Known failures](known-failures.md) |
|
||||
| L0 | Direct path argument | Policy check on Read, Write, Edit, Grep with a path; read gate; write guard | Only if a rule matches, a listed file cannot be masked, or a Write adds a mask |
|
||||
| L1 | Absolute path in Bash | Path rules and read gate, by the verb | Only for a path a rule or the gate covers, and a verb on the lists |
|
||||
| L2 | Bare filename in CWD | The same, in the session's directory | The same; `cd` elsewhere is not followed |
|
||||
@@ -116,7 +116,7 @@ Do not use fermata on a real project. If you try it anyway, this is what it atte
|
||||
|
||||
### What fermata attempts
|
||||
|
||||
- **Masking known secrets.** Values in the manifest are masked in the strings of successful tools' output. A failed tool's error text is out of reach, and many values never enter the manifest: see [Known limits](security-model.md#known-limits).
|
||||
- **Masking known secrets.** Values in the manifest are masked in the strings of successful tools' output. A failed tool's error text is out of reach, and many values never enter the manifest: see [Known failures](known-failures.md).
|
||||
- **Heuristic warnings.** Undeclared secrets matching common formats (AWS keys, tokens, connection strings) get a warning beside the output, and stay in it.
|
||||
- **Command rules.** Shell patterns you list (`rm -rf /`, `curl * | sh`) stop a command whose text matches.
|
||||
- **Path rules.** `.botignore` and `.botsecrets [policy]` stop the Read, Write and Edit tools at L0, and commands that name a matching file at L1 to L3.
|
||||
|
||||
Reference in New Issue
Block a user