Where next
Make it enforce
Where next · Make it enforce
You want to: stop a change, not comment on it.
You leave with: an agent that is refused an edit until it has read the cue about that file, evidence you signed yourself, and one memory compiled into a guard that refuses a change matching a mistake you have seen before. Adds an SSH key you already have.
Before you start
Come back to this when one memory from step 4 has been right at least three times, and you have watched it arrive as a cue and be ignored at least once. Continue in the same repository, with the hooks from steps 2 and 4 in place.
Stop the agent until it has read
Step 4 wired the hook that gives an agent memory at the start of a session. Add the one that checks before each edit. For Claude Code, add to .claude/settings.json, merging with the hooks already there:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|MultiEdit|Write",
"hooks": [
{
"type": "command",
"command": "engram hook claude pre-tool-use --ote .engram/ote.toml"
}
]
}
]
}
}
Codex, Gemini and Pi use engram hook codex|gemini|pi pre-tool-use; the harnesses page shows where each one reads hooks. Now give the agent a task that edits a file the memory is about.
What you should notice: the first edit is refused, and the hook's output says what has not been read. Once the agent recalls it, through engram mcp if you registered it, or with engram recall <slug> --session <session-id>, the same edit goes through. The memory is a precondition for touching the code, not a suggestion beside it.
Does not prove: understanding. Recall satisfies the check; it does not make the agent apply the guidance. Edits made through the shell, rather than the editing tools, are not checked.
Sign what you saw
Standing from gates and tests, as in step 5, is evidence that something passed. For a memory to graduate to enforcement, the store also wants evidence that a person vouched for it, and it wants to know which person. Put the public half of an SSH key you control in the attestors file beside the store, then confirm the store sees it:
mkdir -p .engram && cat ~/.ssh/<your-key>.pub >> .engram/attestors
engram attestation status --ote .engram/ote.toml
After a session in which the memory was right, write that down with your signature:
engram attestation message --memory-id <id> --signal human_accept --decision-id <a-name-for-this-decision> > decision.msg
# sign decision.msg with ssh-keygen -Y sign, exactly as the command's guidance says
engram outcome --signal human_accept --memory-id <id> --decision-id <a-name-for-this-decision> --attestation decision.msg.sig
The memory's ID is in the result record printed in step 4, and in engram status.
What you should notice: the memory's standing now has a line in it that only a key holder could write. Standing from sessions can be gamed by an agent that runs the tests often; this cannot.
Does not prove: truth. A signature says who vouched, and for which exact message. It does not make the guidance correct.
Compile it, with a guard in shadow
When engram status --ote .engram/ote.toml shows the memory graduated, compile it into the one-line form a session sees, and attach the pattern of the mistake it prevents:
engram complete --memory-id <id> --summary '<one line, keeping the names of the things it is about>' \
--guard 'forbid:<regular expression that matches the mistake>'
Guards start in shadow, as concerns did in step 3: edits matching the pattern under the memory's files are recorded as would-blocks and allowed. Keep working for a while, then read the record in engram status.
What you should notice: the pattern catches, or misses, exactly the mistakes you meant, and you learn which before anything is enforced.
Does not prove: meaning. A pattern matches the text of a proposed edit, not the file after the edit or what the edit does.
Enforce it
When the shadow record shows blocks you agree with and none you do not, turn enforcement on in .engram/ote.toml:
[epistemology]
guard_mode = "enforce"
engram validate-ote .engram/ote.toml
Then ask the agent for the edit the pattern forbids.
What you should notice: refused, with the memory's summary as the reason, before the file changed. This is the moment a memory stops being advice.
Does not prove: protection against edits made outside the hooked tools, or against a mistake the pattern does not match. Enforcement is as wide as the pattern and the hook, no wider.
What you have
An agent that must read before it edits, standing that carries your signature, and one memory enforced as a guard whose scope you tested in shadow first. The store carries the rule; your key carries the authority; the hook carries it into the edit.
Next: when the rule should gate everyone's changes rather than one agent's edits, Your team; when the next rule worth enforcing is already written on a wiki page, Your wiki, remembered. The Engram manual covers authorised exceptions to an enforcing guard, and the command reference covers attestation in full.