Prem Pillai

Prem Pillai

Sr. AI Engineer

Block Inc

Constitutional Prompting: Making AI Coding Agents Reliable Without the Iteration Tax

explore the program

Constitutional Prompting: Making AI Coding Agents Reliable Without the Iteration Tax

Every engineering team trying to automate developer workflows with AI agents hits the same wall: the iteration tax. You ask an agent to review a PR, scaffold a feature, or audit code quality — it does something almost right, you correct it, it overcorrects, you add guardrails, it gets confused. Four round-trips later you have acceptable output and a prompt that’s fragile, opaque, and impossible to hand off to another engineer on your team.

Constitutional prompting is a pattern that eliminates this loop for developer tooling. Instead of iterating toward correctness at runtime, you encode your team’s engineering standards, workflow constraints, and output contracts directly into structured agent specifications - upfront, before the agent ever runs. Think of it as writing a constitution for how an agent should behave within your development workflow: parameter schemas, numbered workflow phases, anti-loop directives that prevent the agent from second-guessing itself, and typed JSON output contracts that make success or failure unambiguous.

I’ve used this pattern to build [rp1](https://rp1.run), an open-source framework with 36 specialised agents that automate real developer workflows - review, feature development, code auditing, autonomous research - executing in a single pass without human intervention mid-workflow. Hundreds of engineers at Block use these agents daily, and the results have been striking: fewer iteration cycles, higher first-pass code quality, and agents that consistently follow team conventions without drift. The same pattern powers a map-reduce PR review pipeline that splits diffs across parallel sub-reviewers and a builder-reviewer loop where adversarial agents verify code against seven quality dimensions before it ever reaches a human.

This talk breaks down the anatomy of a constitutional agent for developer workflows, walks through the failure modes it prevents, and shares hard numbers on iteration reduction and first-pass success rates. You’ll leave with a concrete framework you can apply to your own engineering automation immediately.

Prem Pillai

Prem is a Senior AI Engineer at Block, where he builds developer tooling on the AI Engineering team. His current focus is rp1, an open-source multi-agent plugin system used daily by hundreds of engineers across Block to automate PR reviews, feature development, code auditing, and codebase documentation. Before Block, he led data engineering teams at REA Group and co-founded Adepto Solutions, building applications for social networks. Across 22 years in the industry - from startups to multi-billion-dollar enterprises - common thread has been building systems that make engineering teams more productive. He writes about AI engineering and developer tools at blog.pre.ms.