---
id: guard-deletion
track: coding
version: 0.0.3
label: blocks
keyword: block
where: write turn-end
sha256: 9955f34396a5f1c110af91f17bda349e71f431beb9156f9dc1c856b77f9e47f8
source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/guard-deletion
catalog_ref: 1e60d211c1bb767152c6ab0167932da06ab3a10f
---

# Guard Deletion and Mitigation Removal

guard-deletion · version 0.0.3

Blocks — Blocks on an agent's file writes and at turn end. Chock adds friction. It is not a security boundary. 

In a git repo: at commit (Chock refuses the commit, locally and in CI.)



## What it does

Trigger: a change that removes a check, auth decorator, middleware registration, sanitizer call or path check with none of its kind in the same hunk (ask), or removes a hardening flag, security header, cookie attribute, TLS check or row-level security, or swaps one of those or a narrow file mode for a weakened form (block). Hunk-local: misses a guard moved across hunks or files, one neutralised in place, added insecure settings, a deletion-only commit.

## Its label on each agent

- Claude Code (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=claude-code&p=guard-deletion
- Cursor (tested): Blocks — Blocks on an agent's file writes and at turn end. Where its description says it asks, it refuses at both points, because this client cannot prompt at either point. Builder: /coding/builder/#client=cursor&p=guard-deletion
- Codex (tested): Blocks — Blocks on an agent's file writes and at turn end. Where its description says it asks, it refuses at both points, because this client cannot prompt at either point. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=codex&p=guard-deletion
- GitHub Copilot (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. Where its description says it asks, it refuses at turn end, because this client cannot prompt there. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run). Builder: /coding/builder/#client=copilot&p=guard-deletion
- Devin (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. Where its description says it asks, it refuses at turn end, because this client cannot prompt there. If the hook errors, the action goes through (vendor docs only, not witnessed). Builder: /coding/builder/#client=devin&p=guard-deletion
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=guard-deletion
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=guard-deletion
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=guard-deletion
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=guard-deletion
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=guard-deletion
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=guard-deletion

## What it misses

This policy does not state what it misses.

## Examples

- Asks: The agent deletes \`if not user.is_admin: raise PermissionDenied\` from a view and puts nothing in its place.
- Allowed: The agent rewrites the admin check as a role comparison that raises in the same place.

## Latest change

0.0.3 · 2026-10-25 — Behaviour change, added coverage for quoted file names. The rename and copy header names are now unquoted the way git quotes them (\\a \\b \\f \\n \\r \\t \\v \\\\ \\" and octal bytes), so a move into or out of a judged scope is recognised for a name that holds a quote, backslash or control character.

## Provenance

- Tested by 22 of 23 cases run automatically
- SHA-256: `9955f34396a5f1c110af91f17bda349e71f431beb9156f9dc1c856b77f9e47f8`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/1e60d211c1bb767152c6ab0167932da06ab3a10f
- Source: https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/guard-deletion (catalog path `base/guard-deletion`)
- Presets: Code hardening
- JSON: `/api/coding/policies/guard-deletion.json`
- Report a problem: https://chock.sh/report/?policy=guard-deletion&version=0.0.3&page=%2Fcoding%2Fpolicies%2Fguard-deletion%2F
