A thread you can test
Governance and Loops
5 notes move from the word to a real choice at work — understand it first, then decide whether to use it.
Each note stands alone, or becomes the next step in this thread.
THE QUESTION THIS PAGE ANSWERS
ANSWER FIRSTWhat is Governance and Loops, and which AI decisions does it change?
Begin a source-led exploration of context, turns, tools, approvals, and sandboxing. The goal is to see how a coding agent earns trust through explicit boundaries rather than through a friendly interface. This page keeps the related concepts, common mistakes, and practical notes in one reading thread.
First decide whether you are blocked by a definition, a choice, or verification; then choose the closest of the 5 notes below.
Start with “Read a coding agent as a system of boundaries,” then restate the conclusion using your own task.
Do not treat every method in a topic as interchangeable. The answer changes with the input, risk, and acceptance bar.
THIS QUESTION THREAD
Put the word back inside the choice it changes.
Read a coding agent as a system of boundaries
Begin a source-led exploration of context, turns, tools, approvals, and sandboxing. The goal is to see how a coding agent earns trust through explicit boundaries rather than through a friendly interface.
Three-layer Turn Loop: who gets to say continue
Codex splits one conversation into a task shell, a turn, and sampling: each layer answers only its own question, and control sits in one layer at a time.
The stream is still going. Tools already started.
The model is still streaming words, and a tool call is already recognized. Codex writes history on OutputItemDone, then pins exec — every stream exit drains first.
Mid-turn interrupt: this turn, next turn, or refused
The Agent is editing a file when you add a constraint. Codex uses one entry, three modes, and a two-stage mailbox to decide start, steer, or refuse on the spot.
After You Hit Cancel, How Each Layer Stands Down
Tool failures go back to the model; only Esc stops the turn. A cancel token travels from the task to sampling to tools, finished results stay in history, and a hard abort after 100 ms cannot be undone