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

Outsourcing Thinking vs. Understanding

The speaker opens with a quote about how you can outsource thinking but not understanding, framing the core problem: AI agents excel at producing text and code but fail to inherit a team's tacit judgment, taste, and standards. This sets up the talk's thesis that making 'understanding' explicit and accessible to models is essential for reliable agentic work.

Real-World Demo: PR Walkthrough Workflow from rp1.run

The speaker shows a screenshot from rp1.run, an open source project he maintains, demonstrating a multi-step, multi-agent workflow that turns a PR into a 3D walkthrough map for orientation before code review. He highlights that the workflow runs autonomously and consistently produces reliable, hallucination-free output, arguing this consistency comes from deliberate policy design rather than luck.

The Only Lever You Control: Prompts, Not Models or Harnesses

The speaker explains that of the three components of any agentic stack—model, harness, and prompts—only prompts are truly within most practitioners' control since models and harnesses are built by others. He distinguishes between 'level one' prompt engineering techniques (like chain of thought and few-shot examples) and a deeper 'level two' layer of policies that govern all prompts across workflows.

Introducing Constitutional and Epistemological Prompting

The speaker introduces the two core techniques of the talk: constitutional prompting (behavioral rules defining allowed/forbidden actions and workflow/output contracts) and epistemological prompting (rules for gathering evidence, managing conflicting information, and evaluating uncertainty). He emphasizes that if these policies aren't explicitly defined, the model or harness will silently fill in with its own defaults, leading to unpredictable agent decisions.

Consequences of Implicit Agent Decisions

The speaker details how agents make invisible decisions about scope, evidence, escalation, and output shape, and how failing to control these leads to real costs like 'iteration tax,' unreproducible runs, and inconsistent outputs. He stresses that every agent already operates under some constitution—just not one the user deliberately provided.

Anatomy of a Constitutional Prompt

Using a side-by-side comparison, the speaker contrasts a well-written but request-like prompt with a true policy-style constitutional prompt that has clear scope, authority framing, and defined input/output schemas for composability. He argues the goal isn't complexity but well-constructed policies that shift accountability from the model's instruction-following ability to the quality of the policies themselves.

Case Study: The Claude Code Leak and Constitutional Activation Rules

The speaker analyzes a real example from the leaked Claude Code system prompt, showing how it uses a clear activation function (checking an environment variable for Anthropic employee status) to gate certain behaviors. This illustrates constitutional prompting in production, with explicit conditional rules rather than vague requests.

The Five Layers of a Complete Constitution

The speaker outlines the five layers of a complete agent constitution: rules and boundaries, input/output schemas, a workflow body with numbered phases, state machines (often via mermaid diagrams), and output contracts. He notes that teams often write strong rules but skip workflow and output specification, causing agents to drift and fill gaps with defaults.

Introducing Epistemological Prompting

The speaker shifts to the second technique, epistemological prompting, defining epistemology as the theory of how we know what we know and noting that every agent claim rests on an invisible justification rooted in training data. He explains that while constitutional prompting makes behavior predictable, it doesn't make reasoning predictable, and lists key decision points (evidence conflicts, missing information, escalation) where agents need explicit epistemological guidance, recommending David Deutsch's 'The Beginning of Infinity' as further reading.

Analytical Lenses: Positivist vs. Pragmatic Approaches

Drawing on Matt Art's research, the speaker explains epistemological prompting as configuring an agent's analytical commitments rather than just task instructions. He contrasts a default positivist lens (choosing a database purely on benchmark performance) with a pragmatic lens (considering whether a team can realistically support that choice in production), showing how the chosen lens dramatically changes agent outcomes.

Bayesian Prompting in Practice: A 42% Drop in False Information

The speaker presents a condensed real workflow from RP1 where agents research a codebase and build a report, now enhanced with a Bayesian epistemological stance that forces agents to update beliefs based on evidence and articulate what would overturn their own conclusions. This change led to a measured 42% drop in false information written into their knowledge base, demonstrating the practical impact of epistemological prompting.

Closing Thoughts: Externalizing the Program in Your Head

The speaker ties together constitution (the body/workflow) and epistemology (the mind/analytical framework) as the two pillars of reliable agentic systems, closing with Peter Naur's idea that code is just an artifact of the real program living in an engineer's head. He argues that agents become truly useful only when this internal understanding is externalized into constitutions, epistemologies, and workflows, and points listeners to rp1.run and its Discord community for further exploration.

Awesome. Great. Yeah. So I was saying, this is one of my favorite quotes recently on x. It says, you can outsource your thinking, but you cannot outsource your understanding. And this nicely captures the boundary of useful agentic work that is that is being produced today.

Right. As we all know, agents are extremely good at producing text, writing code, producing detailed plans and reviews, doing deep analysis, etcetera. But where they fail woofly short is when they have to inherit your understanding. And that's what this quote is articulating here.

The models are unaware of your team's judgment, your taste, the team standards. The argument here is that if that knowledge stays locked in your head, the agent is forced to fill in these defaults by stepping in. And in in a lot of cases, that's not what you want. So this talk will hopefully argue for a case to make that understanding more explicit and accessible to the models.

So in the session, we're going to talk about two simple but powerful ideas to solve for this. Let's go. So I wanna motivate this talk with a real life example. This is I apologize for the for the small text. This is a screenshot. I was told explicitly not to do live demos, so you have to bear with this.

So this is actually a real life workflow from rp1.run, which is an open source product that I maintain. So in this scenario, the workflow is actually taking PR as an input. So it takes a PR URL or a number as an input and produces this three d walk through map. So this is not a not a replacement for your p r reviews. This is more about orienting yourself before you jump in and and review the code.

So two things will stand out when you run this yourself for the first time and you can. First is that this is under the hood a fairly complex multi step, multi agent workflow that runs flawlessly, completely autonomously without any manual intervention after the after the first prompt. Second is that it consistently produces useful three walk throughs every single time. So the point I wanna make here is that the con this consistency that you see is not accidental.

And and this is the output we want from AI agents. We want the AI agents to produce work that is free of bogus claims and hallucinations. So let let's look at how this works under the hood. This is an extremely condensed version of that workflow that you just saw. This is what r p one uses.

But it serves as a good illustration to to make the point. As you can already see here, we we we enforce some constraints and analytical policies on the agents in this little prompt here. The policies instruct the agents to collect an index evidence and then generate that report based on that evidence, not based on what it saw just now.

So you might be wondering what levers can you pull in your own agentic stack to enforce policies like this. It turns out there's just one lever that you can pull. As you all know, there are three main components of any agentic workflow or or stack. There's a model, there's a harness, there's the prompts that you can control. The models are obviously extremely capital intensive.

No one's no one's really training these models except for the frontier labs. And we just consume them using the APIs. And harnesses are kind of similar in the sense not everyone here is gonna build a harness themselves. There's enough choice that you can pick from. So again, harnesses are also something that you don't control that often. It finally leaves us with prompts.

And again, with prompts, I will argue that there are two levels of control that you can exert. One is what I say is a level one control which is, you know, your regular prompt engineering techniques. You know, techniques like chain of thought chain of thought or a few short examples. And these are all great patterns, these are all techniques that we should all learn and we should definitely apply.

But I wanted to spend some some time talking about the level two control, which is essentially the policies that govern all of these prompts. Not just a not just a single prompt, but the policies that you can enforce across all your workflows. So the two techniques we're gonna talk about today, that one is called the constitutional prompting technique, which is essentially behavioral rules that you enforce on agents, which includes, you know, what actions are allowed, what's forbidden, what is an workflow contract, what is output contract certain.

And the second one is called epistemological prompting technique which essentially enforces analytical policies or rules which allow agents to you know gather evidence properly, you know, manage conflicting information or evaluating uncertainty, etcetera. Again, as I mentioned before, if we are not deliberate at this layer, the model or the harness will step in and enforce its defaults. And again, not something what we want all the time.

So every agent, as you know, is making a series of decisions while it's working. Right? It decides to often do things like what's allowed, what's not allowed, what's forbidden, which input counts as evidence, and when should I escalate or what's how should I interpret them? And what is the workflow order of operation?

Sometimes you you give it a few things it needs to do and it needs to figure out how to sequence them properly. And finally, the output shape. So these are all decisions that the agent does automatically. And and it's great. It does it. But you sometimes need need to see that control back to yourself. And and these these decisions have consequences, obviously, in your agent workflow.

And you don't see these decisions being made by the model. All you see is the consequences. And some of the consequences include things like the iteration tax, where you're spending multiple iterations explaining your point of view to the agent. Or you have a complex workflow, and then you end up with unreproducible runs or inconsistent outputs. So the key thing to take away here is that the agent is already using some form of constitution.

It's just not the one that you provided. So constitutional prompting is about making that very, very deliberate. So what does a constitutional prompt look like? On the left side, see it's not a lazy prompt. It's a fairly well written prompt. It says, just a security review on this PR.

It does have some steps that it's suggesting to do. But again, if you look look at it, it clearly tells you that it's it it looks like a request as opposed to a policy document. Right? And the agents are trained to look at it as a request, not as a policy. So what makes the the prompt on the right more powerful is the fact that, you know, there's a clear scope which you defined.

And there is authority in framing. There's also composition where the input and output are clearly clearly use a schema, which means you can chain these workflows together and have multiple a workflow execution happen. Again, the key point here is not to write complex instructions. That's not what I'm saying. But well constructed policies that you can pass on to agents.

And by doing this, the accountability shifts from the model's ability to follow instructions to how can we make make it follow better by using better policies. This is a real life example from the recent infamous Cloud Code leak that happened a couple of months ago.

And again, this is you know, this is this is a clear example of how they're using constitutional prompting. Again, there's a lot of stuff you can read on the Internet about how Cloud Code works internally. But as an example, you can see there's a clear activation function which is looking for, I think, user underscore type, is an environment variable. If it's not equal to ant, ant, I'm guessing is the demonym of Anthropic employees.

So if you're not an Anthropic employee, you cannot do all of these things. That's what the instruction means here. And it's very clear. There's a clear activation function, as opposed to saying, please don't run this. Okay. So, take a step back and let's look at what an idea of of a constitution looks like.

So, a complete constitution, in my opinion, has about five layers. There's clear rules and boundaries where you define who the agent is, what's what's off limits, when does a spec activate, etcetera. And there's clear input and output schemas, hopefully, where you're using enums and validations and failure conditions very clearly to the agent.

And then there is a body, which is the workflow itself, which has clear numbered phases of how the agent should sequence the work. And I often end up introducing state machines within that workflow using just something like a mermaid diagram, where the agent knows how to navigate the sequence of workflows that you're proposing. And and this is generally the layer that people skip.

They've spent spent a lot of time writing great roles and boundaries, but they forget to either specify a clear workflow or or the output contract. And that ends up being a thing that the agent usually misses and fills the gap with defaults and ends up drifting. So again, if you skip any of these steps, the model will step in and fill it fill in with defaults.

So I wanna switch gears here and talk about the second part of this prompting technique, is epistemological prompting. So a quick definition. Epistemology is essentially how we know what we know. It's more concretely, it's a branch of philosophy where we deal with theory of knowledge. So every claim that an agent makes usually has a theory behind it.

Right? So why is it justified? And usually that theory is invisible to us, because it comes from the model's own training data. Constitutional prompting, as we as we saw before, makes behavior very predictable, but it does not, however, automatically make reasoning or justification more predictable. And that's what we wanna tackle next.

So at every decision point, agent has to agent usually ask themselves. I have a new message versus this old instruction, which one wins? Or I just found this conflicting evidence. Should I update my beliefs? Or should I rationalize further? Should I research more? Should I escalate? There's some missing evidence.

Should I use my training data to fill in? Or should I, again, escalate to the user? So these are questions that the agent would, again, just by nature of its own training, fill in with defaults. So in facing decisions such as these, you want to you want to steer the model to your own epistemology.

Again, on a side side note, if you're interested in epistemology, I highly recommend this book by David Deutsch. It's called The Beginning of Infinity. It's it's an excellent read and full of ideas worth stealing. So, what is epistemological prompting? It's same as same pattern as constitutional prompting.

It's all about making implicit stuff more explicit to the agents. Right? This time, instead of specifying how to do things, we specify the agent's analytical framework, something that it can use to reason about evidence. I would be remiss if I didn't mention Matt Art's research here.

His work on epistemological prompting frames frames is that configuring an agent's analytical commitments, not just giving it task instructions. And in his paper, he argues how to use a few lens that you can apply to to the research agents to to get the optimal output.

A concrete example would be a positivist model, which is, in my opinion, the general model. If any model that you work with usually takes takes to tend a positivist approach, would just pick a database based on, you know, the best of the fast fastest benchmark. However, if you apply the pragmatic lens, the the model might actually kind of try to understand your team situation and figure out, given the team composition, can this even be safely run-in production, this this database, because you don't have the skills to run-in your team.

So, and hence, applying the right lens would usually change the outcome and sometimes dramatically. Okay. That was a lot of philosophy. And I do want to move on to some practical examples. This is this is again a condensed version of an actual research workflow in RP one. So in this con in this workflow, the agent reads the corpus, usually code and documentation from your repo, builds a position and reports it.

And and there are a bunch of epistemological prompting that's that's being added here. But the main the main distinction here is that I've taken a Bayesian stance here. So essentially, I've used the Bayesian thinking as as the main epistemological stance here to ensure that the models actually follow the evidence and they update their beliefs as opposed to just throwing them away.

And one of my favorite parts of this is to actually make the agents spell out what would overturn its own conclusion. So that makes it think more. That makes it, you know, find more evidence before it actually comes back with the report. Again, I think the the biggest the proof for this is that when we when we change the prompt to use a a Bayesian thinking, we suddenly saw 42% drop in false information being written into our knowledge base, which is which is actually the foundation of all the other workflows that we use.

So that was a big win. Again, tying it all together, there's there's usually two things that you wanna focus on. One is the constitution and second is epistemology. You can think of constitution as a body where the work is being done. The agents have agents are actually doing the work. Epistemology is is the mind or how it applies an analytical framework while it's working. And I want to leave you all with with this quote from Peter Noor.

It's it's it's basically says, code is artifact. So code is just a shadow of what is the actual program which lives inside the head of the engineer. And I think it's a beautiful code which kind of captures it captures our current current state of things. Agents only become useful when we can actually externalize the program that's in our head.

So externalizing this program into constitution epistemologies and useful workflows, and that's where I think the real leverage lies. So if any of this landed to you, on you, there are a couple of places you can go and explore more. Rp1.run, it's an open source Apache two point o licensed project.

It was built and it's heavily used at block, but it's not an official block project. It's an open source community project. The QR code will take you to Discord. Come out come and hang out with us. And, yeah, thank you for your time and attention.

You can outsource your thinking but you cannot outsource your understanding

Source: @kache https://x.com/yacinemtb/status/2018886083120153046

Registry long-form plugin sections + SBOM / lastUpdated display

pr-1253-walkthrough-001.json

3/5

File-ref resolution and the path-escape guard

  • `translate.ts` / `validate.ts` / `publish.ts`
  • `resolveSections` reads `{ file }` refs and re-checks the caps once the bytes are known
  • Verify the path-escape guard rejects `../` absolute refs so publish cannot embed arbitrary local files
  • Confirm `validate` runs this offline so failures match the documented fails locally contract

Hide Details

Publisher CLI

  • CLI section resolution & guards
  • `resolveSections` reads `{ file }` refs relative to the manifest and re-checks the caps once bytes are known
  • A path-escape guard rejects `../` absolute refs so publish can't embed arbitrary files off the publisher machine
  • Wired into publish, run offline in validate, and made editable via update-package with `omit-equals-preserve`

`resolveSections` + `path-...` ? `validate` resolves section... ? `publish` resolves section... ?

`packages/plugin-cli/src/manifest/translate.ts:168-211`

resolveSections + path-escape guard

188 + export async function resolveSections(sections, manifestDir) {
189   for (const key of SECTION_KEYS) {
190     const content = typeof value === "string" ? await readSectionFile(manifestD
191     const capError = sectionCapError(content);
192     if (capError) throw new sectionError("SECTION_TOO_LARGE", ...);

RELATIONSHIPS

  • validated & resolved by
    • sections manifest contract -> CLI section resolution & guards
  • produces profile sections read by
    • CLI section resolution & guards -> Admin section & SBOM helpers
A diagram featuring several interconnected hexagonal nodes representing components in a workflow. Key nodes include "SHARED MARKDOWN SANITIZER", "SECTIONS MANIFEST CONTRACT", and "CLI SECTION RESOLUTION & GUARDS". Arrows and labels illustrate relationships, such as "EXISTS TO SAFELY SHOW", "VALIDATED & RESOLVED BY", and "RENDERS SECTIONS THROUGH". A navigation control at the bottom right indicates "3 of 5" pages.

rp1: 3D Walkthrough of a Pull request

/pr-walkthrough

PR Walkthrough

Input: PR number / URL / branch / current branch

Goal: reviewer-orientation Code Tour, not a verdict

  1. Resolve target → GitHub PR or local diff
  2. Collect evidence → metadata, files, patch, commits
  3. Index evidence → E-PR, E-FILE, E-DIFF, E-COMMIT
  4. Dispatch reporter with EVIDENCE_JSON
  5. Generate evidence-grounded Code Tour JSON
  6. Validate path, JSON, and Code Tour contract
  7. Register exactly one walkthrough artifact

An icon resembling a stylized game controller with a plus sign, a dash, and a small circle is displayed next to "rp1".

The one lever you actually control

model

harness

prompts

An abstract icon with four interconnected 3D cubes arranged in a circular pattern, positioned at the top left of the slide. Below the text 'model', an icon of a globe with interconnected nodes and lines. Below the text 'harness', an icon of three interconnected 3D cubes within a circular outline. Below the text 'prompts', an icon of a chat bubble with three dots and a number '1' notification badge, with a yellow pointing finger emoji directly above it.

Your agent is already making these decisions

  1. what it's allowed (and not allowed) to do
  2. which inputs it accepts and how to interpret them
  3. which steps to take, and in what order
  4. what its output should look like

The agent is already using a constitution. It's just not the one you'd write.

An icon depicting two overlapping speech bubbles, each containing a smiling face.

What is constitutional prompting?

Review this PR for security issues.

Focus on auth, data exposure, injection, unsafe defaults, and missing tests.

Be specific, cite files/lines, and separate blockers from nice-to-haves.

ROLE: security reviewer for code changes

MUST: trace changed data flows before judging risk

MUST: cite exact evidence for every finding

MUST NOT: approve if auth, secrets, or PII handling is unclear

WORKFLOW: map surfaces → test exploitability → check tests

OUTPUT: [{severity, claim, evidence, required_fix}]

FAIL: mark INSUFFICIENT_CONTEXT, never guess

you can debug a spec; you cannot debug vibes
A white logo in the top left corner of the slide shows a stylized 'L' shape with a checkmark inside.

Example of a Constitutional Prompt

Found in Claude code leak

Undercover Mode

You are operating UNDERCOVER in a PUBLIC or OPEN-SOURCE repository.

This mode is ACTIVE because USER_TYPE !== 'ant' and the current repository has been classified as non-internal.

Rules 1.

Your commit messages, PR titles, PR descriptions, and code comments MUST NOT contain ANY internal information, including:

  • Internal project codenames (e.g., "Capybara", "Tengu", "Moonshot")
  • Internal Slack channels or mailing lists
  • Internal repository or service names
  • References to internal tools, dashboards, or endpoints
  • The phrase "Claude Code" or any product name not yet public

A white stylized asterisk or starburst symbol is displayed on the left side of the slide.

Anatomy of a constitution

  • 01 Role & boundaries — who the agent is, what's off-limits, when it activates
  • 02 Inputs — typed params, validation, defaults
  • 03 Workflow — numbered phases, with failure branches
  • 04 Outputs — typed schema, unambiguous pass/fail
  • 05 Grounding — your team's patterns, not the internet's defaults

skip one step and the agent improvises in that gap

An icon resembling a clipboard with a checklist is displayed at the top left.

Instruction vs. interpretation

  • Prompts specify action. Reasoning is left to chance.
  • Every agent has an epistemology. Most are accidents.

every claim that the agent makes has a theory of why it is justified.

An icon resembling a globe with an orbit and a diagonal line across it. A book cover titled "The Beginning of Infinity" by David Deutsch, with the subtitle "EXPLANATIONS THAT TRANSFORM THE WORLD" and "THE FABRIC OF REALITY".

What is epistemological prompting

  1. what counts as evidence
  2. which analytical lens to apply
  3. how to interpret conflict
  4. what makes a claim justified
  5. how to report uncertainty

Constitution: What does the Agent do?

Epistemology: What may the Agent claim, and by what standard?

Write down the agent's analytical policy, not just what to do.

Diagram illustrating an iceberg, where a small tip is visible above water and a much larger mass is submerged. An arrow points from the text "Constitution: What does the Agent do?" to the visible tip of the iceberg. Another arrow points from the text "Epistemology: What may the Agent claim, and by what standard?" to the submerged portion of the iceberg.

Picking the right lens

  • 01 positivism — what can be measured?
  • 02 interpretivism — what does this mean in context?
  • 04 critical — who has power, risk, or cost?
  • 05 pragmatism — what action does this support?

Paper by Matt Artz:
https://vbn.aau.dk/en/publications/multi-agent-ethnography-post-conventional-anthro-pological-practic/

If you don't pick the lens, the model picks one for you

A stylized icon resembling a document with a checkmark and pixelated details is displayed in the top left corner.

Epistemological stance (Bayesian)

  1. Treat all prior beliefs as provisional.
  2. When new evidence arrives:
    • quantify how much it should shift confidence
    • distinguish "this contradicts X" from "this is irrelevant to X"
    • preserve the prior belief alongside the update; do not overwrite it
  3. When you reach a conclusion, output:
    • the conclusion
    • the confidence level
    • the top two pieces of evidence that would overturn it

rp1

example of an epistemological prompt

/knowledge-build in rp1

42% drop in false information being written into the knowledge base

An icon depicting a stylized game controller with a plus sign on the left and a minus sign on the right, next to the text "rp1".

Two layers, one agent

Constitution - the body. What the agent does.

Epistemology - the mind. How it justifies claims.

Pick only one, get a familiar failure:

  • constitution-only: predictable behaviour, sloppy analysis
  • epistemology-only: careful analysis, nothing to act on

Constitution is the body; epistemology is the head

An icon illustrating "Two layers, one agent" with two intertwined circular arrows, one pointing clockwise and the other counter-clockwise, within a larger circle.
code is just a shadow of what is the actual programme which lives inside the head of the engineer

Source: Peter Naur https://pages.cs.wisc.edu/~remzi/Naur.pdf

stop prompting; start shipping

https://rp1.run

QR code linking to https://rp1.run.

Discord logo.

People

  • David Deutsch
  • Matt Art
  • Peter Naur

Technologies & Tools

  • Mermaid Diagram

Standards & Specs

  • Apache 2.0 License

Concepts & Methods

  • Bayesian Thinking
  • Chain of Thought
  • Constitutional Prompting
  • Epistemological Prompting
  • Epistemology
  • Few-shot Prompting
  • Positivism
  • Pragmatism
  • Prompt Engineering
  • State Machines

Organisations & Products

  • Anthropic
  • Block
  • Claude Code
  • Discord
  • rp1.run

Works

  • The Beginning of Infinity