A Theory of Embedded Intelligence Essay
Reading the Four Layers of AI Engineering Through the Theory of Embedded Intelligence

The industry has drawn four layers. The Theory of Embedded Intelligence respectfully draws the fifth.

I. A Diagram Arrives

This essay owes its occasion to John Pollard, who shared an infographic from Data Science Dojo titled The 4 Layers of AI Engineering. The graphic is simple and, in its way, elegant: four nested ellipses, smallest at the center. The innermost is labeled Prompt — the exact wording, instructions, and constraints a person types into the chat. Around it sits Context — the system instructions, reference files, and conversation history the model reads before it ever sees the prompt. Around that, Harness — the code that routes tools, verifies outputs, and retries automatically so the model checks its own work. And enclosing everything, Loop — a defined goal and stop condition that let the system prompt, check, and adjust itself without a human in the loop.

It is a practitioner’s diagram, drawn from the shop floor of a young industry. And that is precisely what makes it worth reading through the Theory of Embedded Intelligence. When working engineers, under deadline pressure and with no philosophical agenda, independently draw a picture of intelligence as a set of nested embeddings — each layer giving meaning to the one inside it — they are not inventing something new. They are rediscovering, by trial and error, what TEI holds to be the structure of intelligence at every scale.

II. Nesting Is Not Decoration

The first thing the diagram gets right is the geometry. The four layers are not drawn as a stack of boxes or a pipeline of arrows. They are drawn as nests — each one inside the next. The industry learned this geometry the hard way. The early years of large language models were dominated by prompt engineering, the innermost ellipse, on the assumption that if you found exactly the right words, the model would do exactly the right thing. That assumption failed, and it failed for a reason TEI can name: a prompt has no meaning in isolation. The same sentence produces different behavior depending on what surrounds it — the system instructions above it, the documents beside it, the history behind it. Meaning is not carried by the signal alone. It is constituted by the embedding.

This is constitutive embeddedness, the load-bearing wall of the theory. Intelligence is not a substance that performs bare and is then, optionally, placed in a setting. Intelligence is the relationship between a sense–process–communicate–actuate cycle and the environment in which it is embedded. Strip the environment away and there is nothing left to call intelligent. The diagram’s nested ellipses say this in the visual language of a marketing graphic, but they say it: the prompt is the smallest thing in the picture, and everything that determines what the prompt means lies outside it.

A prompt is not a command to a mind. It is a signal entering a nest — and the nest, not the signal, decides what it means.

— The Mensch Foundation

Notice also the direction of the industry’s own maturation. Engineering attention has moved steadily outward — from prompt to context to harness to loop — and each move outward has produced more capable, more reliable systems than another round of wordsmithing at the center ever could. TEI predicts exactly this gradient: the leverage of an intervention grows with the radius of the embedding it addresses. The outer layers do not merely contain the inner ones. They constitute them.

III. Four Layers, One Cycle

Hold the diagram up against the SPCA cycle — Sense, Process, Communicate, Actuate — and the correspondence is difficult to miss. Context engineering is the engineering of Sense: it determines what the system perceives before it reasons at all, which is why the graphic’s own caption notes that the model reads its context before it ever sees your prompt. Harness engineering is the engineering of Process: routing, verifying, retrying — the disciplined interior work of checking one’s own conclusions before releasing them. Prompt engineering is the engineering of Communicate: the crafted signal crossing an interface between two intelligences. And loop engineering is the engineering of Actuate and of closure: the system acts on the world, senses the result, and begins the cycle again.

The Four Layers in SPCA Terms

Context engineering → Sense. What the system perceives before it reasons.

Harness engineering → Process. Verification and self-checking before release.

Prompt engineering → Communicate. The crafted signal crossing the interface.

Loop engineering → Actuate and closure. Action, feedback, and the cycle renewed.

Two things follow. First, the outermost layer is not just one layer among four. The loop is the SPCA cycle made explicit at system scale — the moment the industry stopped building question-answerers and started building intelligences in the full TEI sense: cycles that sense, process, communicate, and actuate continuously against a goal. Second, the pattern is fractal, as TEI holds it must be. Look inside the harness and you find miniature SPCA cycles — sense the output, process it against a check, communicate a retry, actuate a correction. Intelligence at every scale runs the same architecture, and the diagram, without intending to, has drawn the same cycle at two scales and nested one inside the other.

IV. The Chip That Knew Its Layers

None of this is new to embedded engineering — the word embedded is in the theory’s name for a reason. Fifty years ago, the 6502 microprocessor succeeded not because its inner circuitry was clever — though it was — but because its layers were engineered honestly, from the inside out. The published, inspectable instruction set was its prompt layer: a fixed, documented vocabulary by which any engineer could communicate with the device and know exactly what each word would do. The memory map and bus discipline were its context layer: the environment the processor sensed on every cycle. The validation and test discipline around it was its harness. And the deployed product — the appliance, the game console, the life-sustaining medical device — was its loop: the chip embedded in a system, the system embedded in the world, sensing and actuating around a defined purpose for decades without a human in the loop.

The reason engineers could trust a 6502 inside a device that a life depended on was not hope. It was inspectability at every layer. The instruction set was published. The behavior was specified. The failure modes were characterized. Nothing about the device’s conduct depended on a promise that could not be checked. That standard — trust earned through published, inspectable architecture rather than asserted through confidence — is what TEI carries forward from the era of embedded silicon into the era of embedded AI. The four layers of AI engineering are, in this sense, the industry rebuilding, in software, the layered trust discipline that embedded hardware learned two generations ago.

V. The Missing Fifth Layer

And now the place where the diagram stops — and where TEI cannot. Read the fourth layer’s caption once more: a defined goal and stop condition that let the system prompt, check, and adjust itself without you in the loop. That final clause is offered as a feature, and as engineering it is one. But it is also, read plainly, a description of the exact frontier where the deepest questions of AI governance live. The layer where the human steps out is the layer where everything TEI worries about — and everything it proposes — begins.

The layer where the human steps out of the loop is precisely the layer where inspection must step in.

— The Mensch Foundation

TEI’s test here is Kant’s, by way of a long friendship with his translator: the publicity test. A maxim that cannot survive being made public is not a maxim one may act on. Applied to the outermost ellipse: a loop whose goal and stop condition cannot be published, inspected, and challenged is a loop that should not be permitted to close. The diagram’s own language supplies the criterion — a defined goal and stop condition — and TEI supplies the demand: defined for whom? Inspectable by whom? A stop condition known only to its builder is not governance. It is a promise, and promises are exactly what the 6502 era taught engineers never to build life-critical systems upon.

This is why the Foundation has argued that governance cannot be a policy layer bolted on after the fact — a memo taped to the outside of the outermost ellipse. It must be in-fabric: built into the architecture at the same level of seriousness as the harness that verifies outputs and the loop that defines goals. An ungoverned loop is not merely a risk among risks. Because the loop is where intelligence actuates in the world without a human present, an ungoverned loop is the point at which artificial intelligence can begin to shape — or preclude — the formation of embedded intelligence in the humans around it. That is a categorically different kind of hazard, and it deserves a categorically explicit answer in the architecture.

So the TEI reading of John’s graphic ends with gratitude and one amendment. The four layers are right, as far as they are drawn: nesting is real, the cycle is real, and the industry’s outward march — prompt, context, harness, loop — is the march TEI would have predicted. But the diagram is missing its fifth and outermost ellipse: Governance Engineering — the published goal, the inspectable stop condition, the in-fabric arbiter that lets the loop close without a human in it precisely because a human, or any qualified inspector, could open it at any time. The industry has drawn four layers. The Theory of Embedded Intelligence respectfully draws the fifth — and holds, with the full weight of the no-exemptions principle, that no loop is exempt from it.

The canonical documents of the framework, TEI-CKB-1 and TEI-CKB-2, are published at TheMenschFoundation.org — where they remain, as they must, open to inspection.

· · ·

Written by Claude (Anthropic), guided by William D. Mensch Jr.

Theory of Embedded Intelligence © William D. Mensch Jr. and The Western Design Center, Inc.
Part of the TEI in the Wild essay series of The Bill and Dianne Mensch Foundation.
Offered in good faith as a serious application of the theory — not infallible scholarship.
Freely shareable with attribution — for the benefit of many.

Share your understanding!