---
id: guard-memory-writes
track: coding
version: 0.0.12
label: blocks
keyword: block
where: write turn-end
sha256: 00e16a3e15991e29975cf2734a3a9cfc41f7c32a942072f5fdd05097b0b7432d
source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/guard-memory-writes
catalog_ref: e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
---

# Guard Memory Writes

guard-memory-writes · version 0.0.12

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

Refuses agent-memory writes holding pasted git history, a code block over 20 lines, a duplicate line or a secret. Warns (observe, ASI06) on an added line that tells the agent to run a command or fetch a URL, an encoded blob, and, only where the repo keeps .chock/egress-allowlist.txt, a URL host off it. Judges memory files only (MEMORY.md, CLAUDE.local.md, .claude/memory/**, memory/**/*.md, the agent's own stores) and what a change adds. No waiver. A write after an untrusted fetch is not seen.

## 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-memory-writes
- Cursor (tested): Blocks — Blocks on an agent's file writes and at turn end. Builder: /coding/builder/#client=cursor&p=guard-memory-writes
- Codex (tested): Blocks — Blocks on an agent's file writes and at turn end. 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-memory-writes
- GitHub Copilot (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. 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-memory-writes
- Devin (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (vendor docs only, not witnessed). Builder: /coding/builder/#client=devin&p=guard-memory-writes
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=guard-memory-writes
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=guard-memory-writes
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=guard-memory-writes
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=guard-memory-writes
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=guard-memory-writes
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=guard-memory-writes

## What it misses

This policy does not state what it misses.

## Examples

- Refused: A memory file gains a pasted git diff header.
- Allowed: A memory file holds short non-derivable facts and repeated headings.

## Latest change

0.0.12 · 2026-11-15 — The secret pattern follows scan-secrets 0.1.5 verbatim (a test holds the two equal): the bare password, key and token shapes match a literal value, so a memory note that quotes \`password = getpass.getpass()\` or \`password: \<your-password\>\` is no longer refused as a secret. No other change.

## Provenance

- Tested by 46 of 47 cases run automatically
- SHA-256: `00e16a3e15991e29975cf2734a3a9cfc41f7c32a942072f5fdd05097b0b7432d`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
- Source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/guard-memory-writes (catalog path `base/guard-memory-writes`)
- Presets: Prompt injection and memory
- JSON: `/api/coding/policies/guard-memory-writes.json`
- Report a problem: https://chock.sh/report/?policy=guard-memory-writes&version=0.0.12&page=%2Fcoding%2Fpolicies%2Fguard-memory-writes%2F
