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
Critical:
- _filter._before: non-blocking NEEDS_HUMAN_REVIEW now also writes to
stderr so the warning surfaces even if _after is skipped (handle()
raised, earlier filter set is_continue=False, or non-dict tool return).
Warning:
- _rules.DangerousFilesRule: os.remove/os.unlink/Path.unlink on
sensitive/forbidden/system paths now triggers R001 (previously only
recursive delete was flagged, so os.remove("/etc/passwd") was missed
while bash "rm /etc/passwd" was caught).
- _rules._DD_WRITE: tighten regex from \bdd\b to (?:^|\s|;|&&|\|\|)\s*dd
so adduser/findd/xdd no longer false-positive HIGH/DENY.
- _rules._matches_forbidden/_matches_system_dir: switch from substring
to path-boundary matching so '/etc' no longer matches '/etcetera' and
'.env' no longer matches 'my.envrc'.
- _rules decode-exec: extract pipe_to_shell/decoder locals to make the
or/and precedence explicit and avoid the nested-paren yapf ambiguity.
- test_tool_filter.test_filter_block_on_review: rename to
test_filter_block_on_review_deny_still_blocks and tighten assertion to
== "TOOL_SAFETY_DENY" (was loose `in (DENY, NEEDS_REVIEW)` that never
exercised the review-block path).
Suggestion:
- safety.__init__: add _WRAPPER_AVAILABLE flag so callers can tell
whether the wrap_tool/safety_wrapper group loaded independently of
_SDK_AVAILABLE (ToolSafetyFilter).
Tests:
- 7 regression tests for os.remove/os.unlink sensitive delete, dd
false-positive on adduser, dd real command still caught, forbidden
path boundary (.env vs my.envrc), system dir boundary (/etc vs
/etcetera).
- test_filter_sleep_at_threshold_is_allowed, test_filter_contextvar_
does_not_leak_across_calls.
0 commit comments