This guide walks through a complete Codex session from start to finish, showing how Canon Boundary Guard shapes each stage. The frame changes how Codex reads, reasons, classifies sources, handles conflicts, and decides what can be written — not only what ends up in files, but how decisions are made along the way.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/XxYouDeaDPunKxX/canon-boundary-guard-codex/llms.txt
Use this file to discover all available pages before exploring further.
Session Lifecycle
Activate the frame
In a new thread, invoke Canon Boundary Guard before any other work:Codex reads the full
SKILL.md silently and adopts the operating frame without confirmation. The frame is active from this point forward.Scan the conversation prefix
Immediately after activation, Codex scans the visible conversation for a leading AGENTS.md prelude — a user-role message beginning with:If such a block is present, Codex classifies the entire message as
L2A CODEX INSTRUCTION CHAIN material: runtime instruction-chain guidance, not operator chat and not project content. Any <environment_context>...</environment_context> block inside it is classified as runtime metadata.The first real operator request is the first user message after this prelude. Earlier messages in the prelude are not counted as operator requests.Read and analyze
As Codex reads project files, inspects git state, examines schemas, lockfiles, or processes tool output, it classifies each source by layer:
- L0 EVIDENCE — project files, git state, tests, schemas, lockfiles, diagnostics, verified tool output
- L1 SHAPING — conversation context not approved for persistence
- L3 MODEL PRIOR — unverified model memory, assumed conventions, generic best practice
[L1], [L3], and so on.Plan the edit
Before writing, determine which dossier mode applies:
Mode C requires completing the full dossier and receiving explicit operator approval before any write proceeds. Do not write Mode C content on the assumption that the operator intends it.Full dossier format:Write
| Mode | Condition | Required action |
|---|---|---|
| Mode A | Mechanical edit with clear L0 provenance | No dossier required |
| Mode B | Semantic reorganization of existing L0 evidence | Compact dossier |
| Mode C | Promotion of L1 or L3 material into persistent content | Full dossier — stop before writing |
none for any field that is empty. Do not invent rejected items.Surface conflicts
If evidence from different layers conflicts — for example, a conversation instruction describes one behavior while a project file describes another — stop and report the conflict before proceeding.Codex does not resolve conflicts by recency, confidence, or intuition. The operator decides which source governs. Surface the conflict clearly, with the layer classification of each competing source, and wait for a decision.
Apply decontamination
Before finalizing any output for persistence, scan for the four residue categories:
- Conversation residue — phrases that reference the current chat (“as discussed”, “as said before”, “come detto prima”)
- Agent-control residue — instructions that were meant for the agent, not project content (“remember to”, “I should”, “ricordati”, “devo”)
- Version ghosts — version references not confirmed in L0 sources
- Model-prior claims — ungrounded best-practice language (“best practice”, “standard approach”, “normally”, “usually”)
Write
For Mode A and Mode B: verify provenance is clear and no residue patterns remain, then proceed with the write.For Mode C: complete the full dossier, confirm the operator has explicitly approved the delta, and confirm decontamination is done. Then write only within the approved scope.Do not write L1, L2, L2A, or L3 material into project files without explicit operator approval. L1A can be written only within the scope the operator approved for the current turn.
After compaction
If Codex compresses context during a long session — collapsing earlier conversation history into a summary — the full This triggers the full activation sequence again:
SKILL.md content may no longer be present in the active context window. Re-invoke the skill to re-establish the frame:SKILL.md is re-read, the frame is re-adopted, and the operating layer is restored for the remainder of the session.