You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To prevent leaking sensitive information when sending diffs/user descriptions to model providers, fastcommit includes a built-in secret sanitization mechanism. This mechanism replaces matched sensitive content with placeholders before generating commit messages or branch names, for example:
-`name`: Identifier in the placeholder; recommended to use uppercase underscore style.
51
+
-`regex`: Rust regex (ECMAScript-like, but without backtracking support); please escape backslashes appropriately.
52
+
- All custom rules are executed after built-in rules.
53
+
- If a regex is invalid, it will be skipped and a warning will be output in the logs.
54
+
55
+
## 4. Viewing Sanitization Statistics
56
+
The current version outputs the following when running with `RUST_LOG=debug`:
57
+
```
58
+
Sanitized N potential secrets from diff/prompt
59
+
```
60
+
In the future, `--show-redactions` can be added to display more detailed tables (planned feature).
61
+
62
+
## 5. Performance and Notes
63
+
- There may be minor performance overhead for very large diffs (multiple find-replace passes). If performance is sensitive, reduce the number of custom rules.
64
+
- Custom regex should not be overly broad, otherwise it may falsely match normal code context, affecting model understanding.
65
+
- The model cannot see the original replaced content. If context hints are needed, design semantically expressive tags with `name`, for example: `DB_PASSWORD`/`INTERNAL_ENDPOINT`.
0 commit comments