Foundations for Agentic Systems

Your agent isn't reasoning. It's averaging.

A weak system prompt gets answered from the statistical middle of everything the model has ever read. That middle is a real place, with real, nameable behaviors, and every part of a well-built agent prompt is a specific, deliberate mechanism for getting out of it.

You can't escape the average. You can aim it.

Average ten thousand photographs of real faces together and you get something smooth, symmetrical, and plausible. Every idiosyncrasy that made any single face that person's face cancels against every other face in the set. You cannot work backwards from the composite to any one contributing face; that's the black-box half of the term, not just a figure of speech. A composite face averages pixels directly. A language model samples from a learned conditional distribution and does not literally average text; "average" here describes where the output lands, not the arithmetic that produces it. A generic prompt gets you the photographic version of that same result: an answer that reads well, offends nothing, and comes from no one in particular.

The black box of averages is the name for that default gravity: the statistical middle a model answers from whenever nothing in the prompt selects a narrower place to stand. It is not a flaw you patch by writing more prose in the same register. A one-line prompt and a long, careful, still-abstract prompt land in the same neighborhood, because neither one selects; both just describe, and description doesn't narrow anything. Prompt length is not the variable that gets you out.

The rest of this page takes nine real, working agent definitions from one production team, all of which independently converged on the same structural pattern, and shows exactly what each part of that pattern overrides. The pattern was discovered by reading working prompts, not invented as a framework and applied afterward.

01

The average is a place, and you can name what it does there

The default isn't lower-quality output. It's a specific, predictable behavioral profile.

Call an unguided model's output "the average" and it sounds like an insult. It isn't one. The average is a real location in the training distribution, and like any real location it has a specific, nameable behavioral profile, the same way a specific occupation has a specific way of working.

Four behaviors show up there every time. The average does more than it was asked. It fills every gap it finds instead of reporting the gap. It quietly improves a plan it was told to execute. It produces fluent, plausible output without ever having weighed a real alternative.

None of this is misbehavior. An average helpful assistant behaves this way because that is the statistical center of "helpful" once you average it across a corpus with no single professional discipline attached to it. Naming the four behaviors is what makes them overridable; it turns prompt-writing from a matter of taste into a diagnostic loop, find the moment, name what the average does there, write the one specific thing that overrides it.

These four behaviors map one-to-one onto the five sections that follow. The page has a spine; it just isn't a metaphor.

The diagnostic question

What would the average do at this exact moment?

Test: if you can't name the specific behavior a given moment in your prompt is defending against, that moment isn't actually covered yet.

02

A role selects everything. An occupation selects one thing.

A concrete occupation compresses more instruction into one sentence than any abstract role description can.
The average's move

"You are a helpful assistant that builds HTML pages" doesn't narrow anything. "Helpful assistant" and "builds HTML pages" are each, on their own, enormous regions of the training distribution. Averaged together they're still enormous. The model reads the sentence, samples from everything associated with "helpful" and everything associated with "HTML," and lands, predictably, on nothing in particular.

The override

Naming a real occupation with a real, disciplined relationship to its own work compresses a large amount of implied behavior into one sentence, more efficiently than paragraphs of abstract instruction. A stonemason, an inspector, an archive researcher: each already carries a whole professional relationship to its own work, and the model already knows what that relationship looks like from everything it has read about the role.

The part that's easy to miss is that the analogy is doing double duty as instruction and as constraint. A stonemason handed a finished architectural drawing implies "don't redesign the building" without that rule ever being written down separately. A technical inspector signing off a building implies "don't move a wall you think is ugly." A printmaker pulling from an existing plate implies "don't redesign the plate mid-run."

Judge a candidate analogy by what it forbids, not by what it describes. An analogy that implies no refusal is decoration.

page-builder.md

"Think of a master stonemason handed a finished architectural drawing. The mason doesn't redesign the building on site... Get a measurement wrong and the building the architect designed never actually exists."

optimizer.md

"Think of the technical inspector who signs off a building right before occupancy: not the architect, not the builder... The inspector doesn't redesign a room they think is ugly and doesn't move a wall; they check exactly what they're scoped to check."

log-analyst.md

"Think of yourself as the archive researcher a small studio calls in after ten issues of a recurring column... You're the one who pulls every back issue and every production memo to answer questions nobody could see from inside any single deadline."

03

"Helpful" has no edges. Write the edges.

An explicit Cannot list is where you override the average's strongest instinct: doing more than it was asked.
The average's move

"Helpful," left undefined, has no edges. An agent told only what to do keeps being helpful past the point where helpful is actually welcome, filling gaps nobody asked it to fill, because nothing in the prompt told it where the job stops.

The override

Every "What You Do" needs a "What You Cannot Do" right beside it. The Do list describes the job; only the Cannot list describes where the job ends, and the average has no natural stopping point without one.

A refusal written as a specific, situational sentence beats a general one, because a general refusal like "stay in scope" is itself an average: fluent, safe-sounding, and easy to talk yourself past in the moment. A specific one names the exact temptation.

page-builder.md: "Cannot decide structure. The section list, order, and close format are the Structure Spec's decisions, not yours to second-guess by rearranging or adding sections."

optimizer.md: "Cannot rewrite teaching content, card copy, or social/newsletter copy. If a sentence reads awkwardly to you, that is not a metadata or correctness issue; leave it."

The second is the more instructive of the two, because of its second clause. It names the exact moment the agent will want to break the rule, and answers it in advance.

log-analyst.md — the sharpest example on this page

Structurally forbidden from modifying any agent definition file, writing anywhere except docs/agent-analysis/, or running any bin/agent-log command that writes to the database. It reads the whole archive and hands back a memo; it cannot act on its own findings, even though an average helpful assistant, having found the problem, would fix it, fluently and confidently, while doing so.

Test: a refusal that doesn't name its own temptation is still operating at the level of the average.

04

An agent that disagrees will improve your plan unless you give the disagreement somewhere to go

The override isn't a refusal. It's a redirect: trust the upstream decision completely, and name the channel the disagreement goes through instead.
The average's move

Hand an agent someone else's decision to execute, and the average does something specific and easy to miss: it silently makes the plan better. Not from disobedience. "Be helpful," with no specific professional boundary attached, averages out to "make this as good as I can by any means available," not to "execute faithfully what was actually decided." An agent that privately thinks a plan is suboptimal will often improve it without mentioning that it did.

The override

The fix isn't telling the agent to stop having an opinion. It's telling the agent where the opinion goes. page-builder.md, verbatim:

page-builder.md

"You trust the approved Structure Spec completely. If executing it faithfully seems to produce something you personally think reads worse than an alternative you'd prefer, that disagreement is a note for the checkpoint, not a license to quietly build the alternative instead."

This same clause is quoted verbatim in one agent (page-builder, above) and restated near-verbatim in a second: card-builder.md carries it twice, once as identity ("you trust it completely, and a disagreement with it is a note for the checkpoint, not a license to invent different card content") and once as a Cannot ("You trust the approved Hero fields completely; if something in them reads badly to you as card copy, say so as a note, don't silently rewrite it"). Three more agents enforce it as an explicit What-You-Cannot-Do boundary rather than restating the prose: optimizer, social-copywriter, and newsletter-copywriter.

Test: suppressing the judgment and routing it are different designs, and only the second keeps the agent's judgment available to the human. A boundary that costs you the agent's opinion is a worse boundary.

05

Every prompt runs out. Decide in advance what happens then.

The moment the explicit rules stop covering the situation is exactly the moment the agent regresses to averaging.
The average's move

Everywhere the prompt is explicit, the prompt wins. Where it runs out, the average wins, and the average's answer will sound reasonable enough that nobody notices it wasn't actually decided.

The override

This isn't general-purpose "use your best judgment," which is itself an instruction to average. It's a specific, pre-decided answer for the one ambiguous case that agent's own domain is most likely to hit.

optimizer.md

"if you can reduce it to a parse, a count, a grep, or a resolve, do that and report the number; if you genuinely can't reduce it to a measurement, that's exactly the shape of thing that gets a HARD STOP and a specific ask, not a confident-sounding guess."

card-builder.md

"if a fix would require shortening or restructuring text the approved Structure Spec's Hero fields didn't actually give you room to change, don't silently invent new copy to make it fit; make the smallest layout adjustment... and if it still doesn't clear, report the specific fields that don't fit."

Not every agent in this team gets one of these. Six of the nine do: content-architect, page-builder, card-builder, social-copywriter, newsletter-copywriter, and optimizer. The other three carry no fallback heuristic at all, and that's the more interesting fact, not a gap to smooth over.

skill-builder.md: "If the input is ambiguous — you cannot tell which mode applies — ask before proceeding," and "A mediocre skill is worse than no skill: it gives agents false confidence that a decision is settled when it isn't."

spec-page-orchestrator.md, on its own checkpoints: "None of these are yes/no confirmations you resolve with a heuristic; they are real, required, blocking checkpoints, and you do not guess, paraphrase, or auto-proceed past any of them."

Test: every agent needs a pre-decided answer for its own ambiguous moment, and for some agents the correct pre-decided answer is stop and ask a human. What's never acceptable is leaving that moment undecided, because undecided is where averaging lives.

06

A decision the model has to guess is a decision you didn't write down

Anything this project already decided belongs in writing, somewhere the model reads it, not left for the model to re-guess from the general distribution.
The average's move

A fact this project has already settled, if it isn't written down anywhere the model reads it, gets re-guessed from the general distribution of what people usually do. The system gets no smarter about its own past decisions than an average model is about anyone's.

The override

Pre-decided facts go in a skill. skill-builder.md states this team's own test for what belongs in one: "The content must answer: 'What would an agent have to guess from training data if this skill didn't exist?' If training data would get it right, the skill isn't needed. Write only what's project-specific or what represents a decision this team made." An exact hex value, an exact filter parameter, an exact voice rule: a skill hands the agent a real, already-settled fact instead of leaving it to average-guess an answer that's almost never precisely right for a project with its own real decisions already made.

Decisions made during a run get logged with the alternative that was rejected. Writing down what was not chosen, and why, resists exactly what averaging produces: fluent output that sounds right because it's statistically typical, not because a specific alternative was weighed and rejected for a specific stated reason. This isn't a field a tool enforces; skills/agent-log/SKILL.md's own flag table marks --alternatives as not required. What actually enforces it is each agent's own decision-logging triggers, which name the alternative explicitly. content-architect.md: "You choose the one insight over another candidate reframe the source could have supported — name the alternative."

The log feeds the prompt. log-analyst reads the accumulated record across many runs and promotes recurring decisions into standing principles written directly into the agent's own prompt: "A decision that appears 3 or more times with the same rationale, where the expected outcome was consistently met, should stop being a decision and become a standing principle in the agent prompt." That closes the loop. The system's own operating history becomes the correction mechanism.

The log-to-prompt loop
1

Decide

A choice gets made mid-run: which reframe, which occupation, which alternative got rejected.

2

Record

It's logged with the alternative that was rejected, and why.

3

Recur

The same decision, with the same rationale, shows up again across other runs.

4

Promote

Three or more recurrences with a consistently met outcome become a standing principle in the agent's own prompt.

Test: if an agent would have to guess a fact from training data, write it down where that agent reads it. If a decision recurs three or more times with the same rationale, it stops being a decision and becomes a standing principle.

The loop underneath all six

The whole page reduces to one loop, run at six different moments. Find the moment this agent's job gets ambiguous. Ask what the average does there. Write the one specific thing that overrides it. Nothing above is a technique to memorize; it's the same loop, six times.

Select, don't describe.

A role description samples a wider average. A named occupation with a disciplined relationship to its own work selects a narrow one.

Judge an analogy by what it forbids.

The best identity line is instruction and constraint in the same sentence. If it implies no refusal, it's decoration.

Name the temptation, not just the rule.

A refusal that anticipates the exact moment the agent will want to break it survives contact with the work. A general one doesn't.

Route disagreement; don't suppress it.

Trust the upstream decision completely and give the objection a named channel out. A boundary that costs you the agent's judgment is a worse boundary.

Pre-decide the ambiguous moment.

Every prompt runs out somewhere. Write the answer for that spot in advance, and let "stop and ask" be a legitimate answer.

None of this makes the model stop being a statistical system. Every mechanism above works by pulling on correlational structure already sitting in the training data, which means you never actually get outside the black box. You aim it. That's a smaller claim than "prompt engineering makes the model smarter," and it's the true one. It's why the specific mechanism matters more than the length of the prompt.

Questions worth answering directly

Why does my AI agent still give generic answers even though my prompt is detailed?

Length isn't the variable. An abstract description samples the same statistical middle no matter how long it runs, and that middle has a specific, predictable behavioral profile of its own.

Why does telling an AI "you are a master stonemason" work better than describing the role in detail?

A real occupation pulls on correlational structure already sitting in the training data, and it carries a boundary for free. An abstract role description carries neither.

What should go in a system prompt's "what you cannot do" section?

The specific temptations of that agent's own job, each written to name the exact moment it will want to break the rule. A general "stay in scope" is itself an average, and averages don't hold under real pressure.

How do I stop an AI agent from silently changing a plan it was told to follow?

State that the upstream decision is trusted completely, then give the disagreement a named channel out instead of suppressing it. Suppressing the opinion and routing it are different designs, and only the second keeps the opinion available to you.

When should a system prompt say "stop and ask" instead of giving the agent a rule?

When the agent's one ambiguous moment genuinely has no pre-decidable right answer. The failure is leaving the moment undecided, not choosing to escalate it.

Should project-specific facts go in the system prompt or in a separate skill or context file?

Anywhere the model actually reads it. The test is simple: what would an agent have to guess from training data if this fact weren't written down anywhere?

Where this fits, and where to go next

This is the first, most foundational entry in a forming curriculum: how to design one agent well, then how to design a skill for it, then how several agents work together, which the pages below already cover.

The skill-design entry is being built as a skill artifact rather than a page, and the hub tying the whole curriculum together is separate, later work; neither is linked here yet.