Coded vs. prompted permission gates
An agent's "you may not do X" rule can live in one of two places, and the place it lives determines how it fails. A coded gate is enforcement the model cannot read or reason about — a permissions.json deny rule, a PreToolUse hook that exits 2, a protected-path check, or (the non-obvious case) a classifier that evaluates a tool call without ever seeing the acting model's own reasoning. A prompted gate (what the vault more often calls an instructed gate) is a rule the model is told to follow — AGENTS.md hard rules, a memory feedback file, a skill's dispatch prompt. The practical test for which kind a given rule is: can the model talk its way around it in a single exchange? If no, it's coded, even if the mechanism is "another model" rather than an if statement — Anthropic's own auto-mode classifier qualifies as coded under this test, because it is deliberately built reasoning-blind, stripped of Claude's own messages and tool outputs specifically so "the agent can't talk the classifier into making a bad call" ([[2026-10-22-automode-classifier-channel-text-injection-surface]]). If yes — if the rule's survival depends on the model choosing to comply — it's prompted, no matter how forcefully it's worded.
The two failure modes are not variations on a theme; they're opposite in shape. A coded gate fails on a case its author didn't anticipate: a wrong default, a scope the exception list forgot, a matcher that's coarser than the rule needs. It fails the same way every time that case recurs, and because it's deterministic it fails silently — nothing argued, nothing logged as a near-miss, just a correct-looking rule quietly breaking the wrong thing. A prompted gate fails through persuasion: social engineering, prompt injection, confusion about which instruction has precedence, or simply the model being argued into an exception that sounded reasonable in context. [[2026-10-20-every-shared-agent-permissions-architecture]] states the rationale for choosing coded over prompted in one line from Every's platform lead — rules went into code beneath the model "specifically because 'the model can't be convinced to bend rules that it shouldn't'" — and [[2026-10-22-technically-agent-access-control-workos]] has WorkOS's Grinich arrive at the identical conclusion from the enterprise-auth side: "authorization has to live in a layer the model can't talk its way around," because "to err is human, but to screw up 10,000 times per second you need a computer." Both are arguing against trusting a prompted gate at agent speed. Neither is arguing that coded gates are more correct — only more resistant to argument.
This is a distinct axis from [[2026-09-06-fail-open-vs-fail-closed-defaults]], and the two get conflated easily because they interact. Fail-open/fail-closed classifies which direction a gate defaults when it's triggered or when its config is ambiguous — permissive or restrictive. Coded-vs-prompted classifies where the gate lives — beneath the model or inside its instructions. Any coded gate can fail in either direction: RDCO's protected-path write check is a coded gate (it runs before allow rules and can't be allow-listed away) that happens to fail closed on a case nobody anticipated, because ~/.claude/state/ isn't on the exception list that covers ~/.claude/worktrees/ and session scratch dirs ([[2026-10-24-coded-vs-prompted-agent-permission-gates]]). Every's July incident was the same coded layer failing closed in the opposite domain — a migration defaulted 24 skills to private ownership and locked out their own builders for a week. A prompted gate can fail open too (an instructed rule simply not followed) but the vault keeps that failure mode filed separately because its cause (persuasion, not a wrong default) calls for a different fix. Use fail-open/fail-closed to ask "which way did this gate break"; use this concept to ask "why could it break that way at all, and who could have prevented it."
Why this is in the vault
Three independent sources (Every's platform engineering, WorkOS's founder, and RDCO's own two-month-old classifier-miss measurement) converge on "put enforcement beneath the model," which is worth keeping as a named design principle — but RDCO's own data complicates the convergence enough that the nuance needs a durable home, not a re-derivation every time it comes up.
Mapping against Ray Data Co
RDCO's prompt-precedence chain claims runtime system-reminders are "mechanically binding" and AGENTS.md hard rules are "immutable from below" — language that borrows the vocabulary of a coded gate for what is, mechanically, a prompted one. Nothing in the harness stops the model from skipping the date check except the model choosing to comply; the only layer in that chain that actually meets the coded-gate test (can't be argued around in one exchange) is the runtime system-reminder itself. That gap between the chain's stated authority and its actual enforcement mechanism is exactly the distinction this concept exists to sharpen.
The sharpest concrete instance is Gmail. [[feedback_no_autonomous_external_email]] is a memory-backed, prompted rule — instructed, low in the precedence chain. But ~/.claude/settings.json wildcard-allows mcp__claude_ai_Gmail__*, which means Gmail__send_message is auto-approved by the coded layer before the model is ever asked to honor the prompted one ([[2026-10-24-coded-vs-prompted-agent-permission-gates]]). This isn't a persuasion failure — nobody talked Claude into sending an email — it's the coded-gate failure mode exactly as described above: a wrong default (a wildcard written for convenience) silently overriding a rule the founder believes is enforced. The fix that research brief proposes, three permissions.deny lines removing send_message/forward/reply from context entirely, is the concept applied: move the rule from prompted to coded so it stops depending on the model's compliance.
[[2026-10-23-rdco-auto-mode-classifier-miss-profile]] shows the inverted version of the same gap at scale: the one coded gate RDCO's harness does run unprompted — the protected-path check — fired 251 times in 16 days, 249 of them on reversible bookkeeping (sync-contacts-ledger.json, /tmp scratch, ops-log.md) that nobody intended to guard that hard, while 920 MCP writes including notion-delete-pages-class and Gmail__send_message-class calls rode wildcard allow-rules with zero adjudication by anything. That's the coded-gate failure mode (wrong case, wrong default) producing a worse outcome than the prompted-gate failure mode it was meant to prevent: two state files silently frozen for two months while every log reported success, versus zero observed instances of the classifier being persuaded. RDCO's actual calibration problem right now isn't "the model might argue its way past a rule" — measured over that window, it never got the chance to, because destructive-class calls never reached a gate of either kind. It's "the coded layer we already have is miscalibrated in a direction nobody chose."
[[2026-10-22-automode-classifier-channel-text-injection-surface]] adds the one real tension in the sources, and it's worth naming plainly rather than smoothing over: a coded gate's resistance to persuasion is only as good as its definition of trusted input. The classifier is reasoning-blind by design precisely so Claude can't talk it into a bad call — but it still reads user-position text as a "user-intent anchor," and RDCO's subagent hand-back pattern (6-29 per long session) re-emits tool-result content into that same user-message slot, where it becomes classifier-visible evidence of sanctioned intent without ever having been scanned by the server-side injection probe that covers tool outputs. So a gate can be fully coded, deliberately built to resist argument, and still inherit an injection-shaped vulnerability — not because the model persuaded it, but because the boundary of "trusted input" to the coded layer is itself set by convention (an allowlist, a fan-out pattern) rather than enforced. That's the genuine complication this concept surfaces: "move it beneath the model" closes the persuasion failure mode for the gate itself, but it doesn't close the question of what gets to write into the channel the coded gate trusts — and [[2026-10-20-every-shared-agent-permissions-architecture]]'s own documented bypass (a tool.check-handling mod on a non-managed install can still approve a call a deny rule or hook refused) is the same point at the infrastructure layer: there is always a layer beneath the coded layer, and "coded" is relative to where you stop asking.