Repository navigation
fix(security)!: treat common credential files as sensitive - #698
Merged
Merged
Conversation
read_file, the git diff filter and cora_search hits now redact *.env, *.env.*, credentials, .git-credentials, .pgpass, .htpasswd, .pypirc, .dockercfg, .docker/config.json, *.p12, *.pfx, *.jks, *.keystore, *.tfvars, kubeconfig and secrets.y*ml. A new sensitive_files config list adds name globs; the project layer can only add to the user layer's.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #683
What
The sensitive-file name rule now covers the common credential files that
read_file, the git diff filter andcora_searchhits missed, and the list is configurable.Why
read_fileis read-only (no approval). A file such asdeploy/production.envor~/.git-credentialswas returned verbatim, and its values are usually not in the secret set, so they reached the provider and the session log.Changes
crates/tole-core/src/sensitive.rs: new names*.env,*.env.*,credentials,.git-credentials,.pgpass,.htpasswd,.pypirc,.dockercfg,.docker/config.json,*.tfvars,kubeconfig,secrets.y*ml.*.p12,*.pfx,*.jks,*.keystoreare key material, shown as one marker like*.pem. The diff filter and search-hit redaction use the same file rule.sensitive_filesconfig list of name globs (*wildcards, no directory part, validated). The user layer's list is used and the project layer's list is added to it; a project can never remove a name. The host installs it withsensitive::set_extra.read_file_raw).nlink > 1) check, and running the shape detector overread_fileoutput (waits on feat: shared shape-detector ruleset with uteke for unknown secrets #597).Testing
tests/sensitive_files.rs(name list plus an end-to-endread_fileredaction ofprod.env) fails ondevelopand passes here.*.envsuffix rule, the.dockerparent check, the user-layer union, or the extra-glob lookup each makes a test fail.--workspace --all-targets --all-features -D warnings,cargo test --workspaceandtole-core --no-default-featurespass. A few e2e tests (agents,session_effort_e2e,wire_size_missions) were flaky on the shared build machine;agents::parent_spawns_child_polls_until_settledalso failed on a cleandevelopin one run.