Summary
The PowerShell guard's mutation-spelling regex only catches delete/recycle spellings, so on Windows
— where the PowerShell lane is the real deletion/handoff path — common destructive operations get
no ask gate and pass silently.
Details
destructive_guard.py:217-223 (_POWERSHELL_MUTATION_WORDS) covers remove-item, rm, rmdir,
del, erase, rd, ri, clear-content, rimraf, unlink, recycle-bin/::delete spellings.
- It does not cover:
Move-Item/move/mv, Rename-Item, Set-Content/Out-File/>
redirection (overwrite), Remove-ItemProperty, Clear-Disk/Format-Volume, or New-Item -Force
(which truncates an existing file).
The lane is documented as "raised bar, not fail-closed" (safety-model.md:63-66), which is a
deliberate design choice — but a silent move/overwrite of an approved-adjacent path during a manual
handoff is exactly the kind of destructive slip the lane is meant to surface.
Suggested fix
Extend the mutation-spelling set to include move/rename/overwrite/format spellings (at least
Move-Item/mv, Rename-Item, Out-File/Set-Content, New-Item -Force, Format-Volume/
Clear-Disk), surfacing the same ask bar. Document the covered set.
Severity
MEDIUM (security) on Windows; LOW elsewhere.
Summary
The PowerShell guard's mutation-spelling regex only catches delete/recycle spellings, so on Windows
— where the PowerShell lane is the real deletion/handoff path — common destructive operations get
no
askgate and pass silently.Details
destructive_guard.py:217-223(_POWERSHELL_MUTATION_WORDS) coversremove-item,rm,rmdir,del,erase,rd,ri,clear-content,rimraf,unlink, recycle-bin/::deletespellings.Move-Item/move/mv,Rename-Item,Set-Content/Out-File/>redirection (overwrite),
Remove-ItemProperty,Clear-Disk/Format-Volume, orNew-Item -Force(which truncates an existing file).
The lane is documented as "raised bar, not fail-closed" (
safety-model.md:63-66), which is adeliberate design choice — but a silent move/overwrite of an approved-adjacent path during a manual
handoff is exactly the kind of destructive slip the lane is meant to surface.
Suggested fix
Extend the mutation-spelling set to include move/rename/overwrite/format spellings (at least
Move-Item/mv,Rename-Item,Out-File/Set-Content,New-Item -Force,Format-Volume/Clear-Disk), surfacing the sameaskbar. Document the covered set.Severity
MEDIUM (security) on Windows; LOW elsewhere.