## memory-write-refused **What you see.** The agent says memory refused something: its `memory` call was answered `memory refused this entry: it contains …` (what looks like a GitHub token, an invisible or direction-changing character, and so on), and `memoryd` logged `memoryd: a memory write from session was refused by the rule ; see docs/runbook.md#memory-write-refused`. Nothing was written to `memory/`, staged for review or journalled. **Why.** Every text a memory write would store is checked against the sanitizer's refuse rules (M5b spec, section 6.1): control characters other than line feed and tab, invisible and direction-changing characters, private-use characters, noncharacters, secrets known by their prefix (GitHub, GitLab, `sk-` keys, Slack, AWS, private-key blocks), and the model's chat-template tags. Such text is only ever an attack or a leaked secret, and identity goes into every prompt. The log names the rule, never the text. **Confirm.** The rule in the log line. `bxctl sanitize check` with the text (as an argument or on standard input) names each rule that fires and writes nothing. The session's log holds the call's arguments. **Fix.** A real secret: rotate it, since it has been in the conversation; keep it out of memory. Ordinary text refused by mistake: add it to the code-work corpus and narrow the rule, as the M5b spec's section 6.5 says; the change reaches the agent when it is rebuilt. **Check.** `bxctl sanitize check` with the text prints nothing and exits 0, and the agent's next write of it is answered `… updated` or `saved in notes.md`.