Write path and approval
The write flow is the trust boundary. Agents propose, humans approve.
Write flow
- Agent proposes one or more candidates.
With
save-session --query-level <n>, the agent may consider up to n recent accessible human-agent chats, but only as proposal context. Natural/engram ss -a last 50 sessionsis the same scope plus explicit accept-all approval:engram save-session --query-level 50 --accept-all. - Engram parses candidate type and target scope.
- Engram checks schema, secrets, prompt-injection patterns, and path safety.
- Human sees a preview.
- Direct CLI replies use
A,A 1,3,B <note>, orC. - AI-agent chat replies use
yes,audit, orcancelafter the exact displayed candidates. - Only approved memory is written.
- Index, graph, hashes, and changelog are refreshed.
Approval words
Approval words are yes, approve, confirm, or save. Audit words are audit, revise, correct, or edited replacement text. Cancel words are cancel, stop, or rejection. Only approval after exact candidate display authorizes engram save-session --accept-all for those candidates.
Direct terminal CLI remains A/B/C. MCP proposal tools remain no-write.
Related-memory hints
When engram save finds related active memories, the approval preview reports them with a suggested depends_on or possible-duplicate warning. Accepting saves the preview as-is; reject first if you want to restructure dependencies or archive duplicates before saving.
For save-session --accept-all, Engram pauses before writing when those related memory hints appear. The agent should use the response to brainstorm a structured rerun: add DEPENDS_ON: memory-id for dependencies, LEVEL: advanced when a memory is deeper than its prerequisite, or UPDATE: memory-id when a candidate should merge into a possible duplicate.
Safety checks at save time
- Schema validation
- Secret scan
- Prompt-injection scan
- Path safety
- Hash integrity
Why this matters
Without a protocol, memory can become invisible state. Invisible state is hard to review, hard to share, and easy for agents to poison by accident.
Engram makes memory boring on purpose: files, diffs, hashes, review gates, and commands a human can rerun.