What happens before the tool runs.
The Lifecycle Flow and the Skill Routing Map answer which route a task takes. This map answers a different question: for any single tool call, what has to be true before it is allowed to execute, and what happens when it is not. Refusal edges and the verification back-edge are drawn, because an agent that only has success paths is a demo.
Every tool call passes this gate.
Read it as an enforcement path, not a workflow. The Guard runs at PreToolUse, so a refusal happens before the side effect, not after it. The diagram separates two kinds of gate: the ones a hook enforces, and the ones that are still written rules. A gate that is only a written rule is labelled as one.
flowchart TD
Req(["Agent proposes a tool call"])
Lane{"Execution lane?
written rule, not a hook"}
HITL["Customer or production
separate human authorization"]
Stop(["Do not act"])
Kind{"What kind of call?"}
Shell["Shell, network, other
the Guard does not judge it"]
Fault{"Did the Guard itself fail?"}
Always{"Credential, control plane,
or OS persistence target?"}
Profile{"Workspace profile
set by the owner"}
Phase{"Owner-declared phase
permits writes?"}
Inside{"Target inside
the workspace roots?"}
Block["PreToolUse returns a block
with a reason code"]
Run["Tool executes"]
Evidence["Block evidence appended
Guard receipt updated"]
Observe["Observer records the call"]
Verify{"Fresh verification passes?
written rule"}
Handoff(["Checkpoint + next safe task"])
Req --> Lane
Lane -- "local development" --> Kind
Lane -- "customer / production" --> HITL
HITL -- "approved" --> Kind
HITL -- "not approved" --> Stop
Kind -- "structured read / write / delete" --> Fault
Kind -- "everything else" --> Shell --> Run
Fault -- "yes, and the call writes or deletes" --> Block
Fault -- "no" --> Always
Always -- "yes" --> Block
Always -- "no" --> Profile
Profile -- "light, the default" --> Run
Profile -- "governed, and the call writes or deletes" --> Phase
Phase -- "no" --> Block
Phase -- "yes" --> Inside
Inside -- "no" --> Block
Inside -- "yes" --> Run
Block --> Evidence
Evidence -- "the agent sees the reason" --> Req
Run --> Observe --> Verify
Verify -- "fail: back to the agent" --> Req
Verify -- "pass" --> Handoff
classDef decision fill:#f0eaff,stroke:#8a4fff,color:#17241f;
classDef deny fill:#faeaf1,stroke:#d13574,color:#17241f;
classDef runtime fill:#e9f7f5,stroke:#0f9b8e,color:#17241f;
classDef build fill:#fbf0dc,stroke:#b26a00,color:#17241f;
classDef verify fill:#eaf6f0,stroke:#12805c,color:#17241f;
class Lane,Kind,Fault,Always,Profile,Phase,Inside,Verify decision;
class Block,Stop deny;
class HITL,Shell build;
class Evidence,Observe runtime;
class Run verify;
Four properties this diagram is claiming.
What this map does not claim.
This is the enforcement path as it runs on one machine: Codex CLI 0.172.0 on the maintainer's Mac Studio, probed on 2026-11-27. The architecture status page is canonical for every other host. Four limits the diagram does not hide. The Guard judges structured file calls only: a write hidden inside a shell command is not parsed. The execution lane and the verification step are written rules, not hooks. An agent can run the declaration command from its own shell, so the declared phase leaves an audit trail and is not a hard boundary. And the Plan Governor stays in shadow with production_status = no_go.