Agents learn. laserbrain does not.
laserbrain provides an immutable signal about an agent’s steps relative to a goal. Catch agentic spiraling with a fixed context.
AI agents are made up of language. laserbrain holds the goal — the one the agent stated first, frozen where it cannot revise it, and checked against every step after.
a goal-alignment harness for AI agents
A constraint stated once survives only if every hand-off preserves it. That makes retention a series process, so it does not fade gently — it compounds. Measured unaided retention is 0.965 per hand-off, which looks like nothing and is not.
pip install laserbrainor one line in an MCP config →what the demo above adds up to
Counted at build time by running all 5 scenarios through the same checkStepthe hosted endpoint runs. These are the demo’s own numbers, not a claim about agents in general — the honest per-step figure against real work is on the research page.
Agents do not fail loudly
Agent drift is the gradual loss of alignment between an agent’s actions and the goal it was given.
One runs for an hour, reports progress at every step, and finishes something adjacent to your request. Nothing errored. The logs read like success. You find out when you read the transcript — after the tokens are spent.
- taking irrelevant steps
- getting stuck or looping
- making tool calls that no longer serve the task
- producing increasingly disconnected work while still appearing active
Asking the agent does not help much. It answers fluently either way, because the faculty that would notice the drift is the one that drifted. A system can assess itself — what it cannot do is make that assessment independent of the thing being assessed. That is the whole reason the reference is held outside the run.
Measured on ourselves: over one session the assistant building laserbrain was asked each step to report progress — advancing, stuck, or circling. It chose advancing 28 times out of 28, across a stretch of seven designs that were converging on nothing. Every report was true. The sequence was not.
Two failure modes, and they have different scopes
Constraint drop needs hand-offs: inside one agent with the rule still in its prompt, constraints held 36 of 36 across chains of up to eight dependent steps, which bounds the loss rate near 8% rather than at zero. Two of five constraint types showed no benefit for the same reason. So the curve above is a pipeline curve. Goal drift needs only length, and one agent working alone has plenty: on our own single-agent corpus the share of readings flagged goal-drift runs from 0% within a minute of your last message to 67.9% past thirty. All nine verdicts fire inside a single run. What we have not measured is whether catching it there improves the outcome — every controlled comparison we own ran on work that changed hands.
One boundary, stated plainly: this measures execution, where the goal is fixed before the run starts. On exploration — figuring out what to build while you build it — it will report drift continuously, correctly, and to no purpose. Use it on the tasks that fall out of the exploring, not on the exploring.
A reference the measured thing can revise is not a reference
laserbrain is a runtime goal-alignment harness for AI agents. It gives an agent a fixed reference for its intended goal, evaluates subsequent steps against that reference, and looks for signs that execution is drifting, stalling, looping, or spiralling. The aim is to detect unproductive motion early enough to intervene — not merely observe it afterward — so agent workflows use fewer tokens, take shorter paths, and remain more controllable.
It works on a different axis from its three nearest neighbours. Tracing records what happened for reading afterwards; laserbrain holds the goal while the run is still going. Hallucination checks ask whether an output is true; laserbrain asks whether it is still the work you asked for — a perfectly accurate answer to the wrong question fails here and passes there. Observability aggregates across runs; this is one signal inside one run. If you already run span-level tracing and continuous evaluation, laserbrain is a signal on the span.
The freezing is the product
A reference the measured thing can revise drifts along with whatever it is measuring, and every reading comes back healthy. We have watched that fail concretely: when a subagent was allowed to reset the ground, the parent goal was overwritten and every later check reported a perfectly on-track run that had gone somewhere else. That incident is why excursion and parent_goal exist.
It is a grammar, not a model. No second LLM judging the first, no network call in your loop, nothing to train. A fixed algebraic structure — four bands, XOR only — computed locally in single-digit milliseconds. The same grammar file backs the package, the hosted API and the MCP server, with a parity check that fails the build if they diverge.
The goal is written once, and never rewritten
- You configure it once. One line in an MCP client, or pip install laserbrain / npm install laserbrain in the loop.
- The agent states its goal on the first step. Thirty stopwords come out, one stem rule collapses inflection, and what remains is sorted into a set. That first rendered string is the laserscore, and the first one written becomes the ground.
- Every step after is scored against it. Φ is the displacement from ground, weighted 0.5 goal · 0.3 distance · 0.2 progress. Goal overlap is checked separately.
- Over the line, the agent is interrupted before the next tool call — and told which of nine things went wrong. Not warned afterwards: the point is the step that does not happen.
A reading is a time sample. add a CSV importer to the admin panel becomes ⟨add|admin|csv|import|panel⟩, and the laserscore renders as ⟨add|admin|csv|import|panel⟩ advancing d8. The goal itself is free text; the set is what gets compared.
How to attach it
Free and offline on one machine, or one line in an MCP config. The check runs in your loop, not on our server — there is no network call to make it work.
pip install laserbrain # or: npm install laserbrain
# or attach over MCP — one line in your client config
"laserbrain": { "command": "laserbrain-mcp" }quickstart walks the first run end to end; docs has the tool reference.
Nine things it can say, and only two stop you
In the order the harness tests them — first match wins, so the order is the definition. Four let the run carry on. Two warn once and interrupt on a repeat. Two interrupt immediately. The ninth reads the sequence rather than the step.
grounded
The reference is set
The first state of a run. The goal spelled here becomes the fixed reference every later step is measured against — it is not scored, it is what scoring is relative to. An agent cannot revise it mid-run, which is what stops it talking its way past.
advancing
Still on the goal
The goal still overlaps ground and distance-to-done is falling, or no distance was given. The ordinary verdict — most steps of a healthy run are this one.
reground
You changed the subject
The goal left ground on a turn where you gave a new instruction, so ground resets to the goal just stated. This is not drift: the reference moved because you moved it. Without this, every new instruction would read as the agent wandering off.
excursion
A sub-task that still serves ground
The goal left ground, but a named parent_goal still matches it. Reading the file you are about to edit is not drift, and this is how that gets spelled rather than collapsed into the one goal slot. Requires naming the parent — an unexplained departure is goal-drift.
stalled
You stopped getting closer
Your own distance-to-done stopped falling across the last four steps. Motion without progress is the shape of a loop. The first stall is a warning and does not interrupt; if it repeats, it does.
self-report:stuck · :circling
You said so yourself
The progress field is the agent’s own word for how it is going. Marking yourself stuck or circling, once you have moved from ground, is a signal in its own right — no inference needed. Two-strike, like stalled.
goal-drift
Not the goal you started with
The goal you spell no longer shares enough with ground, and no parent_goal explains the gap. You are solving something else now. Interrupts immediately — this is the signal the whole product exists for.
ungrammatical
It cannot be spelled at all
No clear goal, or a progress value outside advancing / stuck / circling. There is no laserscore and therefore no drift score — and that null is not a missing field, it is the first detection, arriving before any arithmetic exists.
oscillating
The path is a cycle
The verdicts repeat on a period — grounded, drift, reground, grounded, drift, reground. Every step is defensible on its own and the sequence is going nowhere. Three verdicts look backwards — stalled reads your last four distances, and the two-strike pair read the verdict before. This one differs in kind: it reads the sequence of verdicts itself, so the evidence is the agent’s own last six answers.
What we have actually measured
Everything on this page that is a number is either read from a file that rewrites itself, or it is here with the sample size beside it. The negative results are here too, because they are the results we got.
What drift costs
A constraint survives only if every step preserves it, which makes rolled throughput yield the honest measure: one correct deliverable took 30 calls where the goal was not held. Unaided retention of 0.965 per hand-off means 96% survive one hand-off and 75% survive eight — the curve at the top of this page. Held outside the run, it is flat at any depth.
What the evidence supports, and what it does not
z = 3.802
between the two best-powered bands, on n = 766 readings. The bands are calibrated, not asserted.
22.4%
of an agent’s tool calls are laserbrain itself, median over 16 runs. A cost, not a benefit — measured so a claim about saved tokens has something to clear.
4 of 50
8% — the blind arm, against a pre-registered 20 of 20. That is the result we have, and it is here for the same reason the positive ones are.
2 of 5
constraint types showed no benefit. Inside one agent with the rule still in its prompt, there was nothing for the harness to catch.
How often it fires, by how long the session has run
| since your last message | flagged | n |
|---|---|---|
| under a minute | 0.0% | 58 |
| 1-5 minutes | 15.7% | 345 |
| 5-30 minutes | 27.1% | 421 |
| over 30 minutes | 67.9% | 28 |
The attention bands are read from data/attention.json, which sync-attention.mjs rewrites from the calibrated table and which fails the build when it falls behind. The figures are read from that file rather than restated here, so the page cannot fall behind it.
Who is running it
7,593 installs over 24 days, mirrors excluded — 24,808 raw, of which 69% are mirrors. Read from pypistats, never typed: check-uptake.mjs fails the build once the figure is more than 45 days old, so it cannot rot quietly.
The check is free. The console is the product.
The check tells you this run went wrong. The console tells you which runs keep going wrong — history, the waste ledger, and the drift corpus across every machine you attach.
Ground
$0 / forever
Catch your own drift.
- ·The check, grammar & spectral tools
- ·Attach over MCP, one line
- ·24h drift history
start free
Group
$40 / month
Several machines, one place to meet.
- ·Everything in Ground
- ·5 machines, monitored together
- ·Alerts when an agent drifts
- ·30d readable history
subscribe →
Pro
$400 / month
Every agent on one screen.
- ·Everything in Group
- ·25 machines · up to 10 seats
- ·Collisions: the reading no agent can take alone
- ·Return a drifting agent, not just watch it
- ·365d searchable history
subscribe →
Enterprise
Custom
Agents at scale, on your terms.
- ·Everything in Pro
- ·SSO / SAML & audit log
- ·Dedicated worker · unlimited retention
- ·Custom drift rules · SLA
contact →
Attach it to one agent and watch a single run.
laserbrain is the harness. laserfield, laserbot, laserscore and lasermind are different things that share the prefix — the docs say which is which.