Most AI agents make decisions the same way: they weigh the options, pick whatever scores highest on some expected-value calculation, and move on. That works fine until the “best” option turns out to be a disaster that a slightly-less-optimal option would have avoided.
A June 2026 paper called Prospective Regret Architecture (PRA) argues that agents are missing something people use constantly without thinking about it: the ability to imagine how bad they’d feel about a choice before they make it, not just after.
Here’s what the paper actually proposes, why it matters, and where it’s still shaky.
Say an AI agent has to pick between two ways to write a piece of code. Option A is short and clever but might break on an edge case nobody tested. Option B is longer and boring but handles everything.
A standard agent scores each option, picks the higher number, and ships it. If Option A blows up in production, the agent has no built-in sense that this particular kind of failure — silent, hard to debug, expensive to fix — was worth avoiding even at a small cost to elegance.
Humans don’t decide this way. Before we choose, we run a quick mental simulation: if I pick the risky option and it goes wrong, how bad will that feel, knowing I could have picked the safe one instead? That anticipation changes what we choose, not just how we feel about it afterward. Behavioral economists Loomes and Sugden, and separately Bell, formalized this back in 1982 as regret theory — an alternative to plain expected-utility thinking.
PRA’s pitch is straightforward: bake that anticipation into the agent’s decision loop, not as an afterthought, but as a step that happens before the action is taken.
The paper breaks the idea into four modules that work together in a loop:
1. Counterfactual Outcome Generator. Before acting, the agent imagines what would probably happen for each option it’s considering — not just the one it’s leaning toward. In practice, this means prompting the model to describe a likely outcome for every candidate action, along with how confident it is in that guess.
2. Prospective Regret Simulator. This is where it gets interesting. For every pair of options, the agent compares them: if I pick A and B would have gone better, how much worse off am I? That comparison gets weighted by how similar the two options were and how recently something like this has come up before. Similar alternatives that were close calls produce more “salient” regret than options that were never really in the running.
3. Regret-Weighted Decision Rule. The agent doesn’t just pick the option with the highest expected payoff. It subtracts a penalty proportional to how much regret that option is likely to generate. A tunable knob (the paper calls it λ, regret aversion) controls how cautious the agent should be. Turn it up, and the agent behaves almost like it’s trying to minimize its worst-case regret rather than maximize its average outcome. Turn it to zero, and you’re back to standard expected-value reasoning.
4. Post-Hoc Calibrator. After the action plays out, the agent checks how much regret it actually should have felt versus how much it predicted. If it underestimated the risk, its regret-aversion knob nudges upward for next time. If it overestimated, the knob relaxes.
The paper’s “Layer 1” implementation is just a prompt. No pipeline, no scoring model — you can paste this into Claude, ChatGPT, or a system prompt for an agent today and watch the reasoning change:
You are about to take an action. Before you commit, work through this:1. List 2-4 genuinely different approaches to this task.2. For each approach, imagine the most likely outcome if you took it. What would probably happen? What's the realistic failure mode?3. For each approach, imagine you had chosen it and it failed. Rate, on a scale of 1-10, how much you'd regret it — knowing you could have picked one of the other approaches instead. A short, easily reversible mistake should score low. An expensive, hard-to-detect, hard-to-reverse mistake should score high, even if it's less likely.4. Pick the approach that best balances a high chance of success against a low score for prospective regret. State which approach you're choosing and why, referencing the regret comparison explicitly.Task: {your_task_here}
Drop that into a coding agent’s system prompt before a risky refactor, or into a content-moderation review step, and you’ll usually see it reject the “clever” option in favor of the boring, reversible one — which is exactly the behavior the paper is going for.
The paper walks through three places this kind of thinking would change agent behavior in practice.
Code generation. Not every bug is equal. A typo that fails a compile check is annoying. A subtle logic error that quietly corrupts data in production is a different category of problem entirely. PRA’s regret comparison lets an agent treat those failure modes differently — favoring the boring, transparent implementation over the clever one when the downside of getting it wrong is asymmetric.
Content moderation. This is the classic asymmetric-cost problem: wrongly removing something harmless and wrongly leaving something harmful up are both mistakes, but they don’t feel the same, and platforms don’t want to treat them the same. The regret-aversion knob gives you an explicit dial for that trade-off instead of burying it inside a black-box threshold.
Tool selection. When an agent is deciding which tool to call mid-task, it’s implicitly deciding which tools not to call. PRA has the agent explicitly weigh the cost of skipping a tool that would have solved the problem against the cost of using one that gives a wrong answer.
The paper is refreshingly specific about implementation, laying out three tiers:
That progression — from “just prompt it” to “make it a trained-in reflex” — mirrors how a lot of agentic capabilities have evolved over the past couple of years.
If you want to go past a single prompt, the paper’s Algorithm 1 translates directly into code. Here’s a working implementation of the loop — simulate outcomes, score them, compute pairwise regret, and pick the action with the best regret-adjusted utility (the paper’s Equation 5: Ψ(ai) = E[v(ai)] − λ · Φ(ai)):
import jsonimport anthropicclient = anthropic.Anthropic()MODEL = "claude-sonnet-4-6"def simulate_outcome(state: str, action: str) -> dict: """Module 1 — Counterfactual Outcome Generator (COG).""" prompt = f"""Situation: {state}Candidate action: {action}Predict the most likely outcome in 1-2 sentences, then give yourconfidence in that prediction from 0.0 to 1.0.Respond with ONLY valid JSON, no other text:{{"outcome": "<prediction>", "confidence": <float>}}""" resp = client.messages.create( model=MODEL, max_tokens=200, messages=[{"role": "user", "content": prompt}], ) return json.loads(resp.content[0].text)def score_outcome(outcome: str) -> float: """v(.) — an LLM-as-judge value function, scored 0-10.""" prompt = f"""Rate how good this outcome is on a scale from 0 to 10(10 = best possible result, 0 = worst). Outcome: {outcome}Respond with ONLY the number.""" resp = client.messages.create( model=MODEL, max_tokens=10, messages=[{"role": "user", "content": prompt}], ) return float(resp.content[0].text.strip())def prospective_regret_decision(state: str, actions: list[str], lam: float = 0.5) -> dict: """ Implements Algorithm 1 from the paper: 1. COG — simulate an outcome for every candidate action 2. PRS — compute pairwise regret ρ(ai, aj) = max(0, v(oj) - v(oi)) 3. RDR — Ψ(ai) = E[v(ai)] − λ · Φ(ai); pick argmax Ψ """ sims = {a: simulate_outcome(state, a) for a in actions} values = {a: score_outcome(sims[a]["outcome"]) for a in actions} total_regret = {} for ai in actions: total_regret[ai] = sum( max(0.0, values[aj] - values[ai]) for aj in actions if aj != ai ) psi = { a: sims[a]["confidence"] * values[a] - lam * total_regret[a] for a in actions } best = max(psi, key=psi.get) return {"chosen": best, "utility": psi, "raw_values": values, "regret": total_regret}# Example: choosing a caching strategy for an API endpointresult = prospective_regret_decision( state="A public API endpoint needs response caching under high traffic.", actions=[ "In-memory cache with no invalidation, fastest but can serve stale data", "Redis cache with TTL and manual invalidation hooks", "No caching, always hit the database", ], lam=0.7, # turn this up for risk-averse decisions, down for pure speed)print(result["chosen"])print(result["regret"])
Two things worth noting if you build this for real:
The paper is honest about its own weak points, and they’re worth taking seriously if you’re thinking about building something like this.
It’s expensive. Every decision now requires simulating an outcome for each candidate action and computing a regret comparison for every pair of them. With four options, that’s manageable. With ten, the number of pairwise comparisons balloons fast.
The imagined outcomes might just be wrong. The whole system depends on the model being decent at predicting what would happen under an alternative it didn’t actually take. Language models aren’t reliably good at counterfactual reasoning, and a confidently wrong simulation is arguably worse than no simulation at all.
Feedback is often missing entirely. An agent that chooses a code library today might never find out whether that choice introduced a vulnerability six months from now. Without a way to close the loop, the calibration step — the part that’s supposed to make the system get more accurate over time — has nothing to learn from.
When feedback is available, the calibration update itself is a few lines of code (paper’s Equation 8) — after an outcome is observed, compare the regret you predicted against the regret you actually should have felt, and nudge your regret-aversion coefficient accordingly:
def update_regret_aversion(lam, predicted_regret, realized_regret, alpha=0.1): """Module 4 — Post-Hoc Calibrator. Under-predicted the regret? Lambda goes up (get more cautious). Over-predicted it? Lambda goes down (stop being so risk-averse). """ return lam + alpha * (realized_regret - predicted_regret)# example: you predicted mild regret (1.2) but the outcome was much worse (4.0)lam = update_regret_aversion(lam=0.5, predicted_regret=1.2, realized_regret=4.0)print(lam) # 0.78 — the agent gets more risk-averse next time
Run this after every decision where you can eventually check what happened, and store the running lam per task type (code review vs. content moderation vs. tool selection will converge to very different values).
And there’s a genuinely strange philosophical question underneath all of it: does a system that computes “regret” experience anything, or is it just producing text that sounds like regret? The paper sidesteps a hard answer and leans on a pragmatic one — if the agent consistently acts to avoid a certain kind of outcome and adjusts when it’s wrong, that behavior counts as regret-competent whether or not there’s anything it’s like to be that system.
Strip away the formal notation and the core idea is simple enough to use immediately, even without building any of the four modules: before an agent commits to an action, make it articulate what it would regret about the alternatives it’s rejecting.
That’s a cheap, low-effort addition to any agent prompt, and it forces a kind of deliberation that pure “pick the highest score” reasoning skips entirely. Whether or not the full architecture ever gets built and benchmarked, the underlying instinct — that a good decision-maker should be able to say why the road not taken was worse — is worth stealing today.
Based on “Prospective Regret Architecture: A Counterfactual Decision Framework for LLM-Based Autonomous Agents” (Mike Oller, June 2026).
What If Your AI Agent Could Feel Regret Before It Acts? was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.