Skip to content

disk-hygiene: disk_hygiene_enabled kill switch does not gate the PowerShell lane and is inert under the env-injection failure #382

Description

@kyle-sexton

Summary

The disk_hygiene_enabled=false kill switch ("audit-only mode") does not actually prevent deletions
on the platforms where it matters, for two independent reasons.

B2 — the enabled flag never gates the PowerShell lane

  • skills/clean/scripts/destructive_guard.py:296-300 routes tool_name == "PowerShell" to
    powershell_decision() and returns before the enabled flag is computed.
  • The enabled = ... CLAUDE_PLUGIN_OPTION_DISK_HYGIENE_ENABLED ... computation at :303 is only
    reached on the Bash branch.

So with execution disabled, Remove-Item / del / ::Delete / recycle-bin spellings still return
ask and can be approved. On Windows/macOS the PowerShell lane is the deletion/handoff path, so
"audit-only mode" is not audit-only there.

Fix: when disabled, powershell_decision should deny (not ask) the mutation spellings.

D3 — the kill switch is inert under the #376 injection failure anyway

Fix: move kill-switch enforcement to a point that actually receives the value — pass it as a
hook arg alongside the ${CLAUDE_PLUGIN_DATA} fix from #376, or have the engine read/enforce it.

Severity

HIGH — a disabled kill switch that does not disable execution is a safety-contract violation.
Related: #376 (same env-injection root cause for D3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: securitySecurity-relevant: vulnerability, hardening, or disclosure follow-up.priority: highSignificant impact, or blocks an imminent release; staff this cycle.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions