Invariant
STABLE SDK REFERENCE

Invariant SDK

Integrate formal constraint checking into your deployment pipelines. The Invariant SDK allows you to define, verify, and enforce system invariants in real-time.

01 Getting Started

Install the Invariant Node.js client to begin asserting claims and validating actions. The SDK wraps the full REST API and is optimized for high-concurrency agent environments.

npm install @invariant/sdk-node

Core API Endpoints

POST
/observations

Ingest raw observations from agents, tools, or sensors into the world state graph.

POST
/claims

Assert a typed predicate about an entity. Claims are validated against active constraints before commit.

POST
/actions/validate

Validate a proposed agent action. Returns admissibility (VALID / RISKY / BLOCKED), ΔΦ, Ψ score, and constraint trace.

GET
/world/coherence

Returns the current global coherence score Φ(G) and per-dimension breakdown (consistency, knowledge, drift, utility, boundary).

02 Posting Claims

Claims represent atomic units of truth about your infrastructure. Use the POST /claims endpoint to update the global registry.

send

Synchronous Validation

Claims are validated against existing constraints before being committed to the World State Graph.

03 Defining Constraints

Constraints are the guardrails of your system. They are evaluated whenever a new claim is proposed. A STATUS_DEPENDENCY ensures that sensitive actions are blocked if health checks fail.

Configuration Parameters

  • enforcement_level CRITICAL | WARNING | ADVISORY
  • target_node UUID String
  • dependency_type NODE_STATE | TRAFFIC_LOAD