Repository navigation
Commit d9e7458
fix(hooks): add rtk run to wrappers; never assert for wrapped invocations
Round-4 review fixes on the rtk-ai#3195 adoption:
- COMMAND_WRAPPERS missed 'run' — the one subcommand that shells out its
argument via sh -c — so 'rtk run rm -rf /' evaded a Bash(rm:*) deny
while Bash(rtk:*) allow-asserted it. 'run' is now stripped like proxy,
and the exhaustiveness doc is corrected ('check' lives under rtk hook,
not top-level).
- Adding the token is not sufficient: wrapper arguments are arbitrary
text ('rtk run -c "rm -rf /"', quoted args in any wrapper) that
token-literal matching cannot decompose. New total rule: wrapped
invocations are matched best-effort for deny/ask (over-firing is
fail-safe) but are excluded from the hook's assert gates entirely
(is_wrapped_invocation) — RTK never speaks for text it cannot attest.
- The unattestable-construct branch pre-empted the already-rtk ask
assertion: 'rtk git push > f' silently deferred into a host-native
rtk:* allowlist. Already-rtk unattestables now assert ask (forced
prompt); plain ones keep the silent defer.
- test_claude_already_rtk_passthrough migrated to injected rules — since
rtk-ai#3152 its outcome depends on permission rules, and reading the real
on-disk settings made it environment-dependent.
- tests: run-wrapper deny, never-assert sweep across wrapper shapes,
unattestable ask assertion, is_wrapped_invocation contract.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 505e355 commit d9e7458
2 files changed
Lines changed: 138 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
282 | 291 | | |
283 | 292 | | |
284 | 293 | | |
| |||
703 | 712 | | |
704 | 713 | | |
705 | 714 | | |
706 | | - | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
707 | 719 | | |
708 | 720 | | |
709 | 721 | | |
| |||
712 | 724 | | |
713 | 725 | | |
714 | 726 | | |
715 | | - | |
| 727 | + | |
716 | 728 | | |
717 | 729 | | |
718 | 730 | | |
| |||
1671 | 1683 | | |
1672 | 1684 | | |
1673 | 1685 | | |
1674 | | - | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
| 1689 | + | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
| 1693 | + | |
| 1694 | + | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
1675 | 1704 | | |
1676 | 1705 | | |
1677 | 1706 | | |
| |||
2210 | 2239 | | |
2211 | 2240 | | |
2212 | 2241 | | |
| 2242 | + | |
2213 | 2243 | | |
2214 | 2244 | | |
2215 | 2245 | | |
| |||
2225 | 2255 | | |
2226 | 2256 | | |
2227 | 2257 | | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
| 2262 | + | |
| 2263 | + | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
| 2271 | + | |
| 2272 | + | |
| 2273 | + | |
| 2274 | + | |
| 2275 | + | |
| 2276 | + | |
| 2277 | + | |
| 2278 | + | |
| 2279 | + | |
| 2280 | + | |
| 2281 | + | |
| 2282 | + | |
| 2283 | + | |
| 2284 | + | |
| 2285 | + | |
| 2286 | + | |
| 2287 | + | |
| 2288 | + | |
| 2289 | + | |
| 2290 | + | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
2228 | 2300 | | |
2229 | 2301 | | |
2230 | 2302 | | |
2231 | 2303 | | |
2232 | 2304 | | |
2233 | 2305 | | |
| 2306 | + | |
| 2307 | + | |
| 2308 | + | |
2234 | 2309 | | |
2235 | 2310 | | |
2236 | | - | |
| 2311 | + | |
2237 | 2312 | | |
2238 | 2313 | | |
2239 | 2314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
422 | 448 | | |
423 | 449 | | |
424 | 450 | | |
| |||
1318 | 1344 | | |
1319 | 1345 | | |
1320 | 1346 | | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
1321 | 1371 | | |
1322 | 1372 | | |
1323 | 1373 | | |
| |||
0 commit comments