Commit 0c510e1
committed
Route the probe's four shell calls through one audited chokepoint
Promotion into src/ put four pre-existing shell=True calls under
agentseam-no-shell-true for the first time: security.yml scans src/ and tests/,
never tools/, so the rule had not seen this code. On main, src/ has no shell=True
and tools/ has exactly these four. The rule is working; the code is not new.
Its prescribed fix -- pass an argv list -- would be wrong here. reference_agent
is Claude Code's protocol made executable, and Claude Code runs a hook by handing
a command string to a shell; an argv list would emulate a vendor that does not
exist, and every tested-basis row is measured against this driver. The transform
trial runs the command as the hook rewrote it, so measuring the rewrite means
running the rewrite.
So the exception is real, and now lives in one place instead of four: _shell.py's
run_shell() carries the single nosemgrep and the trust-boundary rationale beside
it. The rule stays global and unmodified. Verified narrow: a canary shell=True
added elsewhere in the same package still fails semgrep, and passes again once
removed.
semgrep exit 0 on CI's own invocation; 1615 passed, 4 skipped; ruff and
ruff format clean. Probe re-checked end to end: agreement exits 0, a forced
disagreement prints DISAGREES and exits 1.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>1 parent c59bce6 commit 0c510e1
3 files changed
Lines changed: 37 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| |||
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
30 | | - | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
149 | 151 | | |
150 | | - | |
151 | 152 | | |
152 | | - | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
| |||
200 | 199 | | |
201 | 200 | | |
202 | 201 | | |
203 | | - | |
| 202 | + | |
204 | 203 | | |
205 | 204 | | |
206 | 205 | | |
| |||
234 | 233 | | |
235 | 234 | | |
236 | 235 | | |
237 | | - | |
| 236 | + | |
238 | 237 | | |
239 | 238 | | |
240 | 239 | | |
| |||
0 commit comments