Engine Status: Stable

The coherence layer
for AI agents.

Invariant sits beneath your agents and humans. It ingests observations, claims, and tool outputs — reconciles them into a persistent state graph, detects contradictions, preserves conflicting branches, and blocks unsafe actions before they execute.

Get Started
npm install @invariant/sdk-node content_copy
Global Coherence Metric
Φ(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

Agentic workflows fail silently. An agent makes a small assumption at Step 4, forgets a constraint at Step 22, and by Step 47, it's executing code that contradicts your core business logic.

Most tools try to fix this with better prompts. Invariant fixes it with math.

close

Silent Degradation

Hallucinations compound across long-running autonomous sessions.

close

Constraint Blindness

Context windows lose track of system invariants during complex reasoning.

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

What Invariant Does

The first real-time formal verification engine for LLM agents.

visibility

Continuous World State Monitoring

Invariant maintains a high-fidelity graph of every fact, variable, and claim made during an agent's execution lifecycle. If a new action contradicts a previous fact, the engine flags it in microseconds.

NODE_A
NODE_B
NODE_C
gavel

Invariant Policy Enforcement

Define "Unbreakable Laws" for your agents using standard TypeScript or Python. If an agent tries to delete a production DB or bypass MFA, Invariant kills the process before the packet leaves the network.

bolt

Sub-millisecond Latency

Built in Rust and deployed as a sidecar, Invariant adds less than 2ms of overhead to your agentic calls. It's security that doesn't feel like a speed bump.

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
Sub-2ms validation overhead via local sidecar
agent-example.js
import { InvariantClient } from '@invariant/sdk-node';

const client = new InvariantClient({ baseUrl: 'http://localhost:3000' });

// 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({
  agentId: 'planner-1',
  actionType: '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 · SOC 2 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.0.1 · Requires macOS 13 Ventura+

Invariant — connected to localhost:3000

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-node content_copy