Invariance SDK

Cryptographically-signed, hash-chained receipts for every agent action. Make AI agent behavior provable.

Installation

$ npm install @invariance/sdk
For AI Agents

Get the complete API as structured JSON — authentication, endpoints, SDK methods, and more:

$ curl https://api.invariance.dev/v1/docs

What is Invariance?

Every action an AI agent takes — tool calls, decisions, inter-agent messages — gets recorded as a hash-chained, cryptographically-signed receipt. This creates a tamper-evident audit trail that can be independently verified.

  • Receipt-based audit trail — every action produces a signed, hash-chained receipt
  • Policy enforcement — spending caps, rate limits, allowlists, custom predicates
  • Bilateral A2A proof — both sender and receiver sign every message exchange
  • Observability — trace events, anomaly detection, replay, counterfactual analysis
  • Settlement — cryptographic contracts between agents with delivery proof

Protocol-agnostic TypeScript SDK. Wraps MCP, A2A, CrewAI, LangChain, AutoGen, raw HTTP.

Core SDK

The foundation: initialization, sessions, recording, agents, policies, and identity.

Advanced

Observability, tracing, and query capabilities.

Integrations

Connect Invariance to existing agent frameworks and protocols.

For AI Agents

The complete Invariance API is available as structured JSON for programmatic consumption. This endpoint is public, unauthenticated, and cached for 1 hour.

Fetch API docsbash
curl https://api.invariance.dev/v1/docs
Response contents
  • authentication — auth tiers, key formats, header usage
  • concepts — receipts, hash chains, sessions, contracts
  • endpoints — all REST routes with methods, params, and responses
  • sdkMethods — every SDK function with signatures and examples
  • sdkClasses — TraceQuery, EvalSuite, A2AChannel, LiveStatusClient
  • exports — standalone helpers, crypto utilities, and constants
  • frameworkAdapters — LangChain, CrewAI, AutoGen integrations
Usage in codejavascript
const docs = await fetch('https://api.invariance.dev/v1/docs').then(r => r.json());

// Browse endpoints
console.log(docs.endpoints.length + ' endpoints available');

// Browse SDK methods
console.log(docs.sdkMethods.length + ' SDK methods available');
On this page
InstallationFor AgentsWhat is Invariance?Quick StartCore SDKAdvancedIntegrations