Structural backpressure — using deterministic gates like type checkers, compilers, and formal specs — is argued to be more reliable than relying on AI agents to remember security invariants. The author introduces Shen-Backpressure, a tool that uses the Shen language's sequent-calculus type system to encode authorization rules (e.g., multi-tenant access control) into guard types generated for Go or TypeScript. These guard types make it structurally impossible to bypass the proof chain by accident: a handler can only receive a value representing an already-verified access chain, and skipping the chain causes a build failure. The tool integrates into an AI coding loop (the 'Ralph loop') where gate failures feed back as concrete context into the next model prompt. The core thesis is that for LLM-generated code, better backpressure — deterministic refusal surfaces — matters more than waiting for smarter models.

10m read timeFrom reubenbrooks.dev
Post cover image
Table of contents
Behavioral Gates And Structural GatesThe Substrate MoveA Proof Chain For Multi-Tenant AuthFrom Spec To Guard TypesAuthorization Without The Hand-Written CheckTry ItCosts And LimitsThe Thesis
3.3K Impressions