← ~/pillars / deterministic-policy/

Deterministic guardrails

Why hooks, permission policy, linters, and CI gates beat prompt-pleading, and how to layer them so the model can't forget.

by Paul Grycuk

updated 2026-07-01 6 artifacts 6 patterns

~/playbook/deterministic-policy stage · govern

How do we stop the agent skipping the rule when it matters?

standard
If a rule must always hold, enforce it in code, not prose: hook > check > prompt.
check
A PreToolUse hook that exits 2 blocks the action before it runs.
skill
Permission-policy design across the four enforcement surfaces: hook, permission, sandbox, CI.
metric
Rule-compliance under session pressure, code-graded: prose ~70–90% vs hooks 100%.
failure mode
A model under pressure eventually skips the step you asked it nicely to remember.
~/pillars/deterministic-policy/artifacts 6

Copy-paste-complete files, each verified against the primary docs on the date shown.

// patterns

The reading behind the artifacts, one pattern per page.

❯ read the full guide ~2 min · why this pillar exists and how the pieces fit →