Repository navigation
Commit 5b9b6ae
fix: whole-phrase keyword allowlist + non-vacuous consumer tests
- `isSqlStatementType` now requires EVERY word of the preserved phrase to
come from the SQL keyword vocabulary (statement keywords first, auxiliary
words like TABLE/INDEX/IF/EXISTS after) — checking only the first word
preserved attacker tails such as "SET SECRET PASSWORD" verbatim. Since
preserved text is a subset of the fixed vocabulary, no attacker-specific
content can survive. Tests cover keyword-prefixed tails and compound
types ("DROP INDEX IF EXISTS" stays useful).
- `sql.analyze` test asserts non-empty safety issues + the redaction marker
(was vacuous if the scan produced nothing).
- Grade test corrected to the REAL EvalResult shape: its `safety` section is
`{ method, score }` — there are no nested threats to echo (the handler
redaction stays as defense-in-depth). The test now asserts the whole
result is echo-free minus the by-contract input-echo fields (`sql`,
`lint.sql`), which the CLI never renders.
Co-Authored-By: Claude Fable 5 <[email protected]>1 parent 7b39204 commit 5b9b6ae
2 files changed
Lines changed: 40 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
84 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
85 | 97 | | |
86 | 98 | | |
87 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
38 | 49 | | |
39 | 50 | | |
40 | 51 | | |
| |||
103 | 114 | | |
104 | 115 | | |
105 | 116 | | |
106 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
107 | 122 | | |
| 123 | + | |
108 | 124 | | |
109 | 125 | | |
110 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
111 | 131 | | |
112 | 132 | | |
113 | | - | |
114 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
115 | 138 | | |
116 | 139 | | |
117 | 140 | | |
| |||
0 commit comments