Engine Status: Stable

Ground truth for
every agent step.

Long runs fail quietly first, then catastrophically. Step 4: a wrong assumption. Step 22: a forgotten rule. Step 47: a tool call that contradicts what was true at step 3.

Invariant is the memory and rules layer every step reads and writes, and the gate that stops the next tool call when it would break what you've already established.

memory Remember What the world is, claims, entities, evidence
compare_arrows Reconcile Conflicts surface instead of hiding
security Gate Validate tool calls against that state
How we score drift
Φ(G) = λc·Vc + λk·Vk + λd·Vd + λu·Vu + λb·Vb
Consistency
0.994
Knowledge
0.982
Drift
0.002
Utility
0.876
Boundary
1.000
code Open source engine, Apache 2.0 · Star us on GitHub arrow_forward

The Step 47 Problem

The model doesn't "remember" your system, it reconstructs it from context. The longer the chain, the more that reconstruction drifts. By step 47, it's executing a tool call that directly contradicts what was established at step 3.

Most tools try to fix this with better prompts. Invariant is the ground truth and the gate between intention and execution.

close

Contradictions pile up invisibly

Each step trusts the model's reconstruction of "what's true." Conflicts hide until something catastrophic happens.

close

Tool calls are "hope this is OK"

Without a gate, every tool call is optimistic. Multi-agent runs become multiple conflicting stories with no arbiter.

Agent Execution Trace INVARIANT BREACH AT T+47ms
CONFLICT DETECTED
Claim: "User account is verified."
World State: "verification_token = null"

Without Invariant vs. With Invariant

Without
closeEach step trusts the model's reconstruction of "what's true."
closeContradictions pile up invisibly until something ugly happens.
closeTool calls are "hope this is OK."
closeMulti-agent = multiple conflicting stories.
With Invariant
checkEach step is checked against stored state.
checkContradictions are first-class, you see them when they appear.
checkTool calls ask the engine first, blocked or warned with a reason.
checkMulti-agent = one graph, same rules.

"Invariant is the layer that remembers your world, spots when agents disagree with it, and stops dangerous tool calls, so agent workflows can run long without falling apart."

What Invariant Does

Agents write to a living graph. Contradictions surface. Risky actions get blocked before they run. That's how you scale from ten steps to hundreds.

verified_user

Tool-call gating

Validate before execute. Every tool call passes through Invariant's coherence engine before it runs. If the proposed action contradicts current world state, it's blocked, with a complete reason trace, before a single packet leaves the network.

VALID
RISKY
BLOCKED
hub

Shared state

All agents read and write to one coherent world model. No more diverging context windows. When agents see conflicting facts, Invariant preserves both branches and surfaces the contradiction rather than silently overwriting truth.

history_edu

Audit trail

Every claim, contradiction, and override is logged with full provenance. Which constraints fired, what the coherence score was, why the decision was VALID, RISKY, or BLOCKED, all export-ready for regulators and incident reviews.

World State Graph

Live Session ID: px-992-alpha

124 Nodes
99.8% Coherence
ENTITY_A ENTITY_B ENTITY_C ENTITY_D DRIFT VALID
DRIFT DETECTED
Branch #409 proposes state mutation prohibited by parent context.

How It Works

Three operations. One coherent world state.

input
01

Ingest

Push observations, tool outputs, and claims from any source via REST or SDK. Invariant extracts assertions and builds the world state graph in real time.

POST /observations
POST /claims
sync
02

Reconcile

The settling loop runs: detect contradictions → branch conflicting state → propagate dependencies → evaluate constraints → recompute confidence. Repeat until fixed point.

GET /world/coherence
Φ(G) → fixed point
verified_user
03

Validate

Before any agent executes an action, call /actions/validate. Get back admissibility (VALID / RISKY / BLOCKED), ΔΦ, Ψ score, and exact reasons.

POST /actions/validate
→ VALID | RISKY | BLOCKED

Ship in minutes,
not months.

Five lines of initialization. Then assert claims and validate actions anywhere in your agent stack. The SDK handles serialization, retries, and streaming, you handle logic.

check
TypeScript-first with full type inference
check
Works alongside any LLM or agent framework
check
Low-latency validation, designed for hot paths
agent-example.js
import { InvariantClient } from 'invariant-sdk';

const client = new InvariantClient({ baseUrl: 'https://invariant.me' });

// Assert a claim from a sensor or tool output
await client.claims.create({
  entityId: 'battery-bp1',
  predicate: 'temperature',
  value: 95,
  sourceId: 'sensor-array-3'
});

// Validate an action before executing
const result = await client.actions.validate({
  operation: 'proceed_to_launch',
  impactedEntityIds: ['launch-review-lr1']
});

if (result.admissibility === 'BLOCKED') {
  console.log('Action blocked:', result.reasons);
}

Built for production AI

Invariant is infrastructure, not a feature. It belongs wherever autonomous systems make decisions that matter.

account_tree

Multi-Agent Orchestration

When multiple agents act in parallel, their world views diverge. Invariant maintains a shared state graph that all agents read and write to, detecting conflicts the moment they arise, before a downstream agent acts on stale truth.

security

LLM Tool-Use Safety

Wrap any LLM with tool access and route every proposed tool call through Invariant first. High-risk calls, deleting data, writing production configs, calling external APIs, are blocked if current world state makes them inadmissible.

precision_manufacturing

Autonomous Systems

Pre-flight validation for robots, drones, and autonomous vehicles. Assert sensor readings and system health claims, then let Invariant gate each actuation command against the live constraint set before the packet reaches the motor controller.

rocket_launch

Mission-Critical Decision Support

Go/no-go decisions in aerospace, defense, and surgical systems require proof, not probability. Invariant produces a formal admissibility verdict with a complete dependency trace, every constraint evaluated, every claim cited.

hub

Distributed Knowledge Management

Track claims from sensors, APIs, models, and human operators simultaneously. When sources conflict, Invariant preserves both views as independent branches rather than overwriting, giving downstream consumers full visibility into what is known, disputed, or uncertain.

policy

Compliance & Audit Trails

Every action validated by Invariant is logged with its full provenance chain: which claims were evaluated, which constraints fired, what the Ψ score was, and why the decision was VALID, RISKY, or BLOCKED. Export-ready for regulators, auditors, and incident reviews.

Open Source · Apache 2.0 · Self-Hostable · Audit-Ready
Available for macOS

Invariant for Mac.

A native menubar app that connects to your local or cloud Invariant instance. Watch coherence in real time, get notified when contradictions spike, and inspect the world state without opening a browser.

  • check_circle Live Φ score in your menu bar, always visible
  • check_circle Native macOS notifications on contradiction detection
  • check_circle Connects to localhost or invariant.me cloud
  • check_circle One-click world state snapshot and export

v1.1.0 · Requires macOS 13 Ventura+

Invariant, connected to invariant.me

Coherence Score

98.1

42

Entities

2

Conflicts

128

Edges

Latest Contradiction

Claim #152 ↔ Claim #104, STATUS_CONFLICT

2s ago · score 0.81

Secure your agentic future.

$ npm install invariant-sdk content_copy