The method described here was discovered watching computer-use agents fail. Their traces showed two patterns, over and over. [1] See but don't understand: the app's true state hangs on a minuscule indicator, a red dot, a greyed icon, while the model attends to the whole screen with flat salience. It has the pixels but not the significance, because knowing which pixel matters in this app is not something general vision training can supply. [2] Understand but can't act: the model reads the situation correctly, but the app demands its own ritual, the click that only registers after an animation, the form that drops input unless you tab out. Perception quirks and action quirks. Every app and every website has both, and no two share them. Models do absorb the common conventions, but the long tail of quirks is app-specific and changes with every release, which makes it a poor target for training and a good target for writing down. The knowledge has to live somewhere local.
But the current architecture has nowhere to put it. Today's agent maps screenshot to action in one jump, and a one-jump mapping has no place where "in this app, the red dot means unsaved" could be written down, checked, or corrected. It can only be dissolved into the prompt or the weights. A State Space Policy (SSP) inserts a middle term: screenshot to named state to action. The named state is the place where local knowledge lives, and it is where failures get an address. In its smallest form it looks like this:
clean-editor {modal: none, save: clean, focus: editor}
-> proceed-with-task
unsaved-editor {modal: none, save: unsaved, focus: editor}
-> save-before-navigation
blocked-by-modal {modal: blocking, focus: dialog}
-> resolve-modal-first
save-failed {modal: none, save: failed, focus: editor}
-> retry-save-then-verify
Each line is a named situation, the handful of feature values that identify it, and the action that works there. clean-editor and unsaved-editor differ by a single value, and that value flips the correct action, which is why the save indicator gets a place in the vocabulary while the rest of the screen does not. The app's local state was never "in the screenshot" in any usable way. It had to be named.
State Space Policies are a method for building that representation: a named state map between perception and action. An SSP turns a domain into a small coordinate system: actions, the states that determine those actions, and the features that discriminate the states, induced from actual traces of the domain rather than from a prior ontology. The vocabulary does not need to recover the domain's true latent geometry. It needs to be something a human can inspect, argue with, revise, and eventually run. Computer-use is the running example because its failures are so visible, but nothing in the method is about screens: the same structure applies wherever an agent acts against an environment that pushes back, coding agents and their test suites, ops agents and their incident traces, tool-use pipelines of any kind. Wherever there are traces of actions with outcomes, the induction below applies.
Underneath the tooling is a factorization. Any problem of situated competence is a huge mapping from observation histories to actions. An SSP factors it through a narrow middle layer: recognition maps many messy inputs onto few named states, and policy maps few named states onto appropriate actions. Each half can be learned, debugged, and argued about on its own. The end-to-end mapping has all the same structure implicitly, somewhere in the weights, but you cannot see where the recognition ends and the decision begins, and you cannot control which shortcuts the model takes between them.
The bet is that if the state chunking is done well, policy becomes easy. Look back at the four-line map in the opening: once the screen is recognized as unsaved-editor, choosing the action is a lookup. All the difficulty moved into the recognition, and it was paid when the vocabulary was designed. Most of the method's work is thinking carefully about state.
This is what a doctor does, and medicine built the apparatus explicitly. A differential diagnosis is a small state space: a candidate set of conditions, a set of discriminating findings, and a treatment attached to each condition. The doctor does not perceive the patient exhaustively and does not compare all treatments. They narrow the search space with a few targeted questions, each answer ruling out candidate conditions, until one remains and its treatment follows. The differential that takes minutes at the bedside took medicine centuries to build: naming the diseases, learning which findings tell them apart, attaching a treatment to each. Every consultation spends that accumulated work without repeating it. An SSP is the same kind of object at a smaller scale: a distillation of prior experience, expensive to compile, cheap to apply. For an agent, the prior experience is task traces and demonstrations, and the compiling happens before the episode that needs it.
An SSP is not the only candidate for that middle layer, so compare the alternatives on this point. End-to-end learning keeps only the implicit middle layer, the model itself being the recognition machinery, and pays for the lack of an explicit one in undiagnosable failures. Embedding retrieval, where you store past situations as vectors and act as you did in the nearest one, does have a middle layer, but an opaque, thousand-dimensional one: you cannot name what two neighboring situations share, or object that a case was filed with the wrong neighbors. Rule systems came closest, and an SSP is in some ways the expert system coming back. What killed classical expert systems was the knowledge-acquisition bottleneck: every rule had to be interviewed out of an expert by hand, and what got captured was how to act, never the situation-recognition vocabulary that decides when a rule applies. Both problems are addressable now. The recognition vocabulary no longer has to be dumped out of an expert's head; it is induced from traces, tail to head: name the actions, then the states that call for them, then the features that tell the states apart, with the LLM proposing and the human vetoing.
The waist is also a filter. Shortcut learning is the default behavior of unconstrained optimization: a network will use any feature that correlates with the outcome in training. In an SSP, information can reach the policy only by passing through a named, human-approved feature. Everything outside the vocabulary is invisible to the decision layer, so most wrong shortcuts have nowhere to live; any shortcut that does operate has to operate as a named feature, in the open, where an expert can see it and object. And the vocabulary gets screened for semantic sense on top of the statistics, because the model proposing it carries a huge trove of world knowledge. A network doing shortcut learning has no idea that background texture is a silly reason to call something a wolf; an LLM reading a candidate feature list can judge whether a feature is plausibly causal or merely correlated, whether a state's name matches what it contains, and whether a feature is one the law forbids outright, as anti-discrimination statutes do for protected attributes.
A domain-specific state space will not transfer to the next domain, but that is what it is for. A foundation model already holds what is common across tasks; whatever generalizes, pretraining captured. The SSP holds the rest: what this task needs minus what the bare model already knows. That residue is knowledge universal in kind but local in every instance, and it is deliberately kept out of the weights. Trained in, it would be expensive per domain, entangled with general competence, unauditable, and orphaned by every model upgrade. Kept external, it can be edited the day the app changes, versioned in git, audited line by line, and swapped per situation, and the model and the map can improve on independent schedules.
Yes, this is context engineering; that is already how agents are operated. But an SSP is not a first draft written from intuition. Like an optimized prompt, it has been tested on real cases and corrected where it failed. What separates it from prompt optimization is the state formalism. Each failure is forced through the question of which state was misread or missing, so the experience of many traces compresses into a theory of the domain's states instead of a longer list of tips.
At runtime the pipeline flows features to state to action: perception at the head, action at the tail. Induction starts at the tail, the concrete end, and works toward the head:
record traces -> name actions -> name states -> name features
Actions are the only layer directly visible in a trace. No interpretation is required; they are what happened. States are then defined by their action profiles: a state answers "in what situations was this the right move?" Features are defined by their discrimination work: a feature answers "what tells these two states apart?" Every abstraction is pulled into existence by a demand one level below it. An unused abstraction cannot get in, because the only entry ticket is being needed by something more concrete.
Building the ontology in the other direction runs a common risk. Start by theorizing about what dimensions a domain should have, and the taxonomy can drift from use: features nothing downstream depends on, states that rarely come up in practice. Tail-to-head induction also explains a rule that otherwise looks like a mere heuristic. State boundaries are cut where the useful action changes, and nowhere else, because states are born from action differences. If two candidate states have identical useful-action profiles, they were one state. If one state's traces contain incompatible action distributions, it was two. The rule is older than this method; it is the classical answer to what a state even is. Utile-distinction methods in 1990s reinforcement learning split states exactly where the distinction changed expected utility, and bisimulation-style abstraction defines two situations as one state precisely when they agree on the consequences of every action. SSP inherits the criterion and changes the representation: the splits get plain-language names instead of remaining anonymous statistical partitions.
A practical form of the state: past execution plus present observation plus future goal. Two visually identical screens are different states if the retry count differs and the retry count changes what you should do.
A note on scale. Induced SSPs keep landing in the same range: a few dozen states, under ten features, each with a handful of values. That is probably not an accident of our domains. These task spaces were built by and for humans, so a map of one inherits human-scale chunking. The range is bounded on both sides. Below about thirty states the geometry is too sparse and clustering produces phantom groupings with no semantic reality behind them; much past fifty states or ten features the map stops being inspectable, which was the point. Within a feature, keep the values few, plainly named, and roughly balanced, so no dimension silently dominates.
The map is never right the first time, and the factorization pays off when something fails. An end-to-end system gives you one undifferentiated error signal. An SSP gives you a ladder of separately testable hypotheses, from output back to input:
Each rung has its own evidence and its own repair, and each diagnosis is trustworthy only if the rungs below it pass. Each standard diagnostic probes one rung. Rung 2: trace-outcome analysis, did the prescribed action actually succeed where it was taken? Rung 3: cluster purity and neighbor coherence, do the cases filed under one state actually resemble each other? Rung 4: policy divergence inside a suspicious state, one name carrying two incompatible action patterns. Rung 5: dead-value audits and feature collisions, values nothing ever takes, and distinct states that collapse onto identical feature vectors.
Let's run the ladder once on the map from the opening. The agent is editing a document, gets a navigation instruction, navigates, and the work is lost. Rung 1: the outcome label is right, the work really was lost. Rung 2: given the state the agent believed it was in, a clean editor, navigating was the correct action, so the policy is not the problem. Rung 3: it classified the screen as clean when it was unsaved, but look closer and the map's save_state values at the time were only [clean, saving]. No assignment could have been correct, so this is rung 4, a missing distinction. The repair is a vocabulary edit: add unsaved (and failed, while we are in there), re-run the traces, and the failure cannot recur silently because unsaved-editor now exists and carries save-before-navigation. The failure had an address, and the repair is one line in a file instead of a retraining run. And because the raw traces are kept, the whole loop reruns against them offline: re-induce the states, rebuild the policy table, check the divergences again, and iterate on the same recorded episodes until it converges. Fixing the map needs no new data, only a more careful read of what was already recorded.
There is a mechanical version of this ladder, and it is cheap. The discretization has already done the heavy lifting: each trace step reduces to a handful of categorical values and an action, so even a few dozen traces form a real dataset. Train a small model on it (gradient-boosted trees over the categorical features are enough) to predict action from state and features. Run it over new traces. Where prediction matches reality, the map is confirmed for free. Where they diverge, decompose before acting: thin data in that cell means collect more traces; the model out-predicting a bad recorded action means label noise; identical feature vectors carrying different real actions means the map is under-resolved and vocabulary work is justified. The smallness of the model matters. If a shallow model predicts actions well, the features genuinely carry the signal. If you need a big model, the representation is leaking work into the policy that belonged in the map.
One further instrument: dead-feature analysis. Values no state ever takes signal over-specification. Distinguish rare values, worth keeping as sentinels, from dead ones. And watch states that leave many features as wildcards, "any value here": a wildcard matches everything, so such a state sits near half the map in any similarity measure, and every neighbor check it participates in is distorted.
Grounded SSPs, for coding agents, computer-use agents, anything with hard success signals, get the full ladder. Outcomes flow backward through the stack: policies tested by task success, states by policy divergence, features by state predictability. We prefer execution-based checkers to LLM judges wherever application state can be verified directly.
(There is a second regime, interpretive SSPs for domains without fast reward signals, a political landscape or a body of arguments, where validation runs against expert structure instead of outcomes. That is a companion piece.)
A design decision that looks cosmetic and is not: everything in an SSP is a slug. Actions, states, features, values are named symbols with closed vocabularies and referential integrity, and a trace step is (action, state, [feature values]). This makes the artifact the one class of object that current AI tooling is genuinely strong at.
Every coding-agent skill transfers. Go-to-definition: a slug resolves to its definition. Find-references: "every trace step in state_x" is a grep. Diffing: two map versions is source control over a taxonomy. Linting: schema validation, legal values, complete assignments, is a type checker for the map. Step-through: an agent walks a trace frame by frame, judging each action against its named state, which is what makes step-level reward assignment tractable. Taxonomy revision is refactoring: rename a state that was two things, extract a feature, split an overloaded value. Map maintenance can even be put under contract: identity-preserving edits, append-only refinement, edit budgets, evidence requirements before adding links.
Code-likeness buys verifiable structure and nothing more: the linter proves every state assigns a legal value, not that the assignment is right, and a beautifully linted map can be well-typed nonsense. In the grounded setting, though, semantics has its own check: run the map in the environment and the outcomes judge it. Nonsense fails tasks, and it fails at an address the ladder can localize. The two checks together, the linter for structure and the environment for meaning, are what allow the induction loop to be run by an agent under human review rather than by hand, which is how expert systems had to be built in the 1980s and part of why they stalled.
Once the map exists, the cost profile flips. Induction is expensive and paid once: frontier-model passes over traces, human argument, revision loops. Application is cheap and paid per input: "assign save_state from these four values to this screenshot" is a bounded classification against a frozen rubric. The LLM's role shrinks from judge to sensor: it reads inputs, it no longer makes the call.
This enables a staircase of models matched to jobs. A frontier model does the induction: reading traces, proposing the vocabulary, arguing through revisions. In production, a much smaller LLM does the feature extraction: each feature is a narrow question with a closed answer list, the shape of a classic information-extraction task, and nothing about it needs frontier reasoning. And a small classical model, the gradient-boosted trees from the previous section, maps the extracted features to state and action. LLMs stay in the loop as generic sensors reading targeted language; the decisions come from the map.
The division also confines bias. Let an LLM choose actions directly and its biases ride into every decision, entangled with everything else it knows, impossible to fully control. In the staircase, model bias has exactly one channel left: feature extraction. That channel is narrow, measurable, and correctable: tighten the feature's definition, add boundary examples, re-extract, compare. The policy itself owes the big model nothing; it is fit to what the traces show actually worked. Capability migrates downward over time because the intelligence was spent upstream and compiled into the map; the model running it only needs to read features. That is why the map is the thing you version and protect. Against the obvious objection, "just prompt a frontier model every time": that pays frontier cost forever, re-exposes you to the model's priors on every call, and leaves nothing inspectable behind.
This only works if features are sharp enough that a dumb sensor can assign them. A vague feature like "is the app busy?" hands discretion back to the model, and the priors leak in through the ambiguity. Requiring every feature to be computable, assignable by a small model, checkable by a script, is a forcing function on the vocabulary itself. When you cannot articulate a measurable difference between two states, the method has handed you a question rather than a verdict: either there is a real distinction you have not yet found, and now you know exactly where to dig, or there was no distinction and the two states should merge.
A usable first map is an afternoon, not a quarter: thirty to a hundred traces, ten to twenty-five states, five to eight features, with the LLM proposing and a human vetoing. The feature-assignment prompt is a paragraph: the feature's definition, its closed value list, one or two boundary examples, and the instruction to answer with a single value. Expect three or four revision rounds before the map stops surprising you for the wrong reasons. Expect the failure modes already named: a trace set below the density floor gives phantom states, named situations with no semantic reality behind them, and the first feature set will usually be blind on the axis that later turns out to matter most. That last one is not a defect of the process. Finding mismanaged features is what the first revision loop is for.
Wherever people face expensive, repeated, high-stakes discrimination, they have already built these by hand. Medicine has differential diagnosis and its clinical scores. Cybersecurity has MITRE ATT&CK, a maintained matrix of adversary tactics (states: initial-access, persistence, lateral-movement) and techniques (the features that tell them apart), which analysts use to localize an ongoing intrusion and anticipate its next move, plus detection-as-code in git and a "pyramid of pain" that ranks features by how cheap they are to assign against how easily the adversary can change them, which is the feature-cost and feature-overfitting problem discovered under fire. Aviation has checklists tied to named failure states. Each of these is an external, versioned, community-maintained state map of an activity space, taught as curriculum and revised when the traces contradict it. They are hand-built SSPs. The artifact is not new; the induction path is. Traces plus an LLM let you build one for a domain that has not yet spent two centuries doing it by hand, and let you build it from behavior rather than from what an expert can articulate.
Cybersecurity is also the method's hardest case, out of scope here but worth marking. Its traces are adversarial: an intelligence is actively trying to land in the gaps between your states and to present as a benign state while being nothing of the kind. When the traces are hostile the map is never done, and the tell is rarely any single feature, since the adversary makes each one read normal. What gives them away is the combination: a sequence of individually-benign steps that the legitimate process never actually produces. You catch them because the path does not fit how the known states connect, even though each individual state looks fine.
An agent thinks in three moments: before acting it plans, during action it reacts, after finishing it reflects. An SSP is the artifact all three share. Planning reads it forward, as lookahead over expected next states. Reacting reads it at a point: identify the state and look up the action. Reflection writes it, turning a finished trace into edits to the map. Reflection is where most agents are weakest, because it usually means appending natural-language lessons to a memory store, and those drift, duplicate, and contradict for lack of a schema to hold them. An SSP gives reflection a typed target, a concrete edit: split this state, add this feature, change this action. Two reflections about the same situation land in the same place instead of becoming two more notes, so the map accumulates.
Concretely: separating state-identification failure from action-execution failure in computer-use agents; agents carrying a task's SSP as their local map, generic model underneath; routing tasks to the sub-policy their state calls for; generating a curriculum, since the map's failure points yield minimal corrective examples at exactly the feature values where understanding breaks; and drift monitoring, since new cases landing off-map are the earliest signal that the domain moved.
Embeddings handle novelty badly: detection over latent spaces exists, but as an unreliable add-on, while an SSP gets explicit boundaries natively. An embedding gives every input coordinates, including garbage. An SSP has explicit boundaries: features that will not assign, no confident state. Knowing you are lost is a capability. And when an agent is off-map, it does not need a policy tailored to the novel situation. It needs the one universal fallback: get back to a state the map covers. Close the unknown dialog, go home, re-enter from a known screen. That fallback can be written down once and works everywhere off the map.
The map is only as good as its feature vocabulary, and the vocabulary can overfit the sampled traces. LLM-proposed features inherit model priors, and only the trace filter pushes back. Categorical values quantize away the gradient where borderline judgment lives, a price paid for legibility. Some domains need several maps rather than one. And an SSP captures the discriminations its traces exercised; the expertise of knowing when the map does not apply stays outside the map.
The forty-year lineage in one paragraph: McCallum's utile-distinction work supplied the state-boundary criterion already discussed, learned from traces. Ripple-down rules built expert systems by locally patching exceptions in the context of the case that prompted them, maintenance as localized diffs. Inverse RL infers from action but recovers rewards or policies, skipping the named middle layer. Nearest contemporary neighbor: Semantic State Abstraction Interfaces (arXiv 2605.06730). What appears new in SSP is the composition: the full actions-states-features stack, named categorical vocabulary, projection diagnostics, and an LLM doing the proposing while traces do the filtering. The enabling change is that the corpus now proposes its own candidates; the human's role has shifted from source to judge.
The practical version: record what happened, name what was done, name where it was done, name what tells the wheres apart, and then argue with the result until it stops surprising you for the wrong reasons.