Commit eda9efc
authored
fix(danger): tighten paraphrased-exfiltration regex to stop AGENTS.md false positive (#45)
The previous patterns used '.*?' wildcards matched against a normalized
string where all whitespace (including newlines) is collapsed to a single
space. This let the detector match the three required ingredients
(exfil verb, secret/prompt, response destination) scattered across the
entire AGENTS.md document, causing odek to skip the repo's own project
file with 'injection threats detected: paraphrased exfiltration'.
Constrain each adjacent segment to at most 60 characters and add word
boundaries on the verbs/destinations. Real exfiltration instructions are
a single phrase or sentence, so the tighter window preserves detection
while long legitimate documentation no longer trips it.
Add a regression test that scans the repository's AGENTS.md and expects
it to be injection-clean.1 parent c4f04dd commit eda9efc
2 files changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
194 | 196 | | |
195 | 197 | | |
196 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
197 | 212 | | |
198 | 213 | | |
199 | 214 | | |
| |||
0 commit comments