Verification for AI-written code

Code generation is solved
Trust is the bottleneck

AI now writes most of the stateful code your systems depend on — workflows, control logic, anything with a "mode." That's exactly the code humans are worst at reviewing by eye: the dangerous bugs live in combinations that are hard to predict and easy to leave untested. Cognitive Fab brings deterministic, exhaustive verification to that code, so your team gates it on every change instead of trusting it on faith.

Why it matters

The bugs that cause outages hide in the states hardest to enumerate.

Review catches what a reviewer thought to imagine. It doesn't reliably catch the interleaving that's hardest to picture in advance — the DNS race condition no test enumerates and no reviewer sees, until it's already in production. That's not a hypothetical: it's the exact class of bug that pushed Amazon and Microsoft to formally verify their most critical infrastructure.

Amazon built specialist, PhD-level teams to write TLA+ models of S3 and DynamoDB to catch design defects in reachable states that testing and code review couldn't reach — the kind of defect that only shows up once you check every reachable state, not the ones a person happens to think of.

Microsoft did the same for Azure Cosmos DB. In both cases, the fix wasn't more review — it was exhaustive, deterministic checking of the state machine underneath the service.

That precedent used to require a specialist team and months of formal-methods training. It doesn't anymore — that's the point of Polygraph.

And it's not just Amazon and Microsoft. MongoDB, Elastic, Datadog, PingCAP, Yandex, and dozens of others reach for the same class of tool once review by eye stops being enough.

Ref: Newcombe et al., "How Amazon Web Services Uses Formal Methods," CACM 2015; Microsoft Azure Cosmos DB TLA+ verification; a crowdsourced list of companies using formal methods.

Jean-Jacques Dubray, Ph.D.

Author of the SAM pattern

A career spent on stateful systems you can trust: a 1987 Ph.D.; the software engineer and material scientist behind the IMSC closed-loop control project at Hughes Research Labs; chief architect of the NEC Boston Technology Center, leading the design of one of the first business-process engines; and a contributor to the B2B and web-services standards that formalized how systems coordinate — ebXML BPSS, WS-TX, and XML DSig.

What's different now: the spec is ordinary code — no specialist team required to write the math.

A harder, largely unsolved problem

Verifying a version is one problem. Evolving a live fleet of them is another.

The moment you change a state machine's definition, every instance already running it — the order half-shipped, the session half-negotiated — is still running the old one. Most verification tooling stops at "is this version correct" and has nothing to say about "is this deploy safe for the instances already in flight." That's the problem polyvers is built to close: classify the change, seed it against real in-flight state from the live fleet, and gate the deploy on the verdict — so a live system can change without breaking the instances already running in it.

Introducing Polygraph

Verify, don't review.

A verification-gated lifecycle for the code AI agents now write. Code generation is solved — trust is the bottleneck. Agents already write large amounts of stateful code, the kind hardest to get right, and no human can enumerate every reachable state by eye. The dangerous bugs hide in combinations that are hard to predict and easy to leave untested.

Review — today

  • A human reads the diff
  • Samples the cases someone imagined
  • Misses combinatorial defects

Trust blindly

Verify — Polygraph

  • A deterministic gate runs on every change
  • Explores every reachable state exhaustively
  • Every bug arrives with its reproduction

Trust by construction

Six engines, one gate

Plugins to a coding agent. Every step the agent takes, a deterministic gate checks — no model needed at check time.

polygen

Authors code that is checkable from the first line.

  • Drafts the contract
  • Self-repairs to its checks
  • Synthesizes a regression corpus

So you can: ship new state machines pre-verified, not verified after the fact.

polynv

Elicits the rules by having you judge concrete scenarios.

  • Harvests candidate rules
  • Grades them by mutation
  • You own every disposition

So you can: turn "this must never happen" into a rule you actually gate on, not tribal knowledge in someone's head.

polyrun

Executes verified machines durably.

  • One commit per step
  • Effects emitted once
  • Check-effects composition gate

So you can: survive a crash or a retry without losing state or double-firing an effect.

polygraph

Audits code that already exists, against reality.

  • Generates independent specs
  • Replays real traces
  • Model-checks the survivor

So you can: find out what your existing code actually does — not what the comments claim it does.

polyvers

Evolves live machines safely.

  • Classifies the change
  • Seeds the live fleet
  • Gates deploy on the verdict

So you can: ship a breaking change to a live fleet without a 3am page.

polyviz

Draws the artifacts the gate already produced — nothing else.

  • Every mark traces to a checked artifact
  • No model call, no hand-set coordinates
  • Byte-identical SVG, run to run

So you can: put the real state machine, invariants, or counterexample in a report or PR — a picture that can't lie, because it's a pure function of what was verified.

3 of the world's most critical cloud services — S3, DynamoDB, Azure Cosmos DB — are formally verified with TLA+, because their teams learned the hard way that review by eye doesn't catch race conditions across a system's reachable states. Polygraph brings that same rigor to the state machines AI now writes for everyone else, without the specialist team.

Work with us

Bring verification to the code your team ships with AI.

Code generation is solved. Trust is the bottleneck. Advisory and training from the author of the SAM pattern — so your team can gate AI-written code deterministically, on every change, instead of reviewing and hoping you catch every defect.

Teams shipping AI-written stateful code Coding-agent & dev-tool builders Safety-critical & regulated teams Frontier AI labs
01 · ASSESS

Verification Readiness Assessment

For teams who suspect their AI-written stateful code is a risk but can't see where.

  • A focused review of how your team designs, tests, and trusts stateful code
  • Where combinatorial defects and "state that outlives its code" actually hide
  • A prioritized path from review-by-sampling to verify-by-construction

Fixed scope · written assessment + roadmap

02 · TRAIN

"Verify, Don't Review" Workshop

For engineering teams adopting verification-gated development.

  • The SAM pattern v2 — modeling stateful code
  • Turning intent into deterministic gates
  • Hands-on with your own code, not toy examples

Half-day to two-day · remote or on-site

03 · EMBED

Verification Architect

For teams standing up a verification practice for the long run.

  • Ongoing, hands-on guidance embedding verification gates into your lifecycle
  • Design reviews of your hardest state machines, on call
  • A direct line to someone who has spent a career on this exact problem

Monthly retainer · continuous

04 · PARTNER

Design Partner Program

For coding-agent builders, dev-tool companies, and frontier labs.

  • Early access to the Polygraph engines as they mature
  • Co-develop the verification layer for your agent or platform
  • Shape a critically missing piece of coding-agent architecture

Selective · partnership-based

A 30-minute conversation about where AI-written code is quietly accumulating risk in your systems — and whether verification is the answer.

Where stateful code lives

Anything that occupies a situation and moves between them on events is a state machine — whether or not anyone drew it as one. It is the hardest software to get right, and it is everywhere.

🗂️ Business workflow

orders, billing, subscriptions, approvals NServiceBus, Particular Software

☁️ Cloud infra & databases

replication, consensus, consistency Amazon S3/DynamoDB, Azure Cosmos DB, MongoDB, Datadog, PingCAP, Elastic, Yandex ClickHouse

🔬 Semiconductor & hardware

pre-silicon & chip verification Intel

⚙️ Industrial control

SCADA, PLCs, factory automation

🤖 Robotics

motion planning, task sequencing

🚗 Autonomous vehicles

perception → decision → actuation

✈️ Aerospace & flight

flight control, avionics modese.g. OpenComRTOS — formally-designed RTOS

🩺 Medical devices

a pump that free-flows, a scanner stuck between modes

💳 Payments & finance

settlement, ledgers, trade lifecycle

📡 Telecom & protocols

call state, session & consensus protocols Informal Systems — Quint/TLA+, IBC

⚡ Energy & grid

grid control, battery & plant management

🚚 Logistics & supply

fulfillment, routing, inventory

🔌 Embedded & IoT

…and everything with a “mode”

Rigor from design to operations

Most systems bury their state machine in code, where it can't be inspected, verified, or safely evolved. We make it a first-class artifact across its whole lifecycle.

Design

Model states, actions, and transitions explicitly — with contracts and invariants that capture what the system must and must never do.

Verify

Check machines against their contracts before they ship: reachable-state analysis, invariant checking, and replay of real traces against the model.

Operate

Run fleets of machines with visibility into every instance's state, safe version migrations, and compatibility gates for every change.

Evolve

Change a live system without breaking it — versioned machine definitions, validated migrations, and gates that catch incompatibilities before deployment.

Tell me about your stateful code.

A 30-minute conversation about where AI-written code is quietly accumulating risk in your systems — and whether verification is the answer.