Build on
governed state and action authorization

Everything you need to integrate Cogna8's state management, conflict detection, and policy enforcement into your AI agents and workflows.

01 - REST API

Every operation.
One HTTP call away.

REST API for state management, gate evaluation, conflict resolution, and audit history. JSON in, JSON out. Structured responses with consistent schemas and explicit error codes.

State Management

CRUD operations on state items with typed schemas, versioning, and conflict detection built in.

Gate Evaluation

Evaluate any action against current state. Get deterministic ALLOW, WARN, or BLOCK verdicts with full explanations.

History & Events

Query the complete audit trail with pagination, time-range filtering, and event-type selection.

POST /v1/state/items
Authorization: Bearer sk_live_...

{
  "session_id": "sess_abc123",
  "key": "project.budget",
  "value": "$4.2M",
  "type": "fact",
  "source": "user_input"
}

// → 201 Created
{
  "id": "si_7f3a2b",
  "key": "project.budget",
  "value": "$4.2M",
  "status": "accepted"
}
02 - SDKs & Libraries

First-class clients.
Every major language.

Type-safe SDKs with IDE autocomplete and async operations. Plus a declarative Policy DSL for defining gate rules without writing code.

Python SDK

Async-native client with Pydantic models, automatic retry, and streaming support for real-time state updates.

TypeScript SDK

Fully typed client with generics, tree-shakeable, works in Node.js and edge runtimes.

Policy DSL

Declarative language for defining gate rules - action requirements, integrity conditions, and enforcement behaviors.

from cogna8 import Cogna8Client

client = Cogna8Client(api_key="sk_live_...")

# Push a state item
item = await client.state.create(
    session_id="sess_abc123",
    key="project.budget",
    value="$4.2M",
    type="fact",
)
print(f"Created: {item.id}")

# Evaluate a gate
result = await client.gates.evaluate(
    session_id="sess_abc123",
    action="send_invoice",
)

if result.verdict == "ALLOW":
    await send_invoice()
elif result.verdict == "BLOCK":
    print(f"Blocked: {result.reason}")
03 - Quickstart

Get started.
Your first gate.

Three steps from setup to first gate evaluation. The SDK and API are currently in private developer preview.

Install & Authenticate

One package install, one environment variable. Works with npm, pip, or direct REST.

Push Your First State

Create a state item and see it versioned and persisted. Conflicts are detected automatically.

Evaluate Your First Gate

Define a policy, trigger an action, see the verdict. Action authorization enforced in three lines of code.

Terminal
$ npm install @cogna8/sdk
added 12 packages in 1.2s

$ export COGNA8_API_KEY=sk_live_...

$ node quickstart.js

→ Creating state item...
  ✓ project.budget created (accepted)

→ Creating conflicting state...
  ⚠ project.budget conflict detected

→ Evaluating gate: send_invoice
  ✗ Verdict: BLOCK
  ✗ Reason: Unresolved conflict on project.budget

→ Resolving conflict (accept new)...
  ✓ project.budget = "$5.1M" (v2, accepted)

→ Re-evaluating gate: send_invoice
  ✓ Verdict: ALLOW
  ✓ All required keys resolved

Done! Your first gate evaluation is complete.
04 - Integrations

Drop into any stack.
Zero refactoring.

Integrations for major AI frameworks, webhook delivery for real-time notifications, and CI/CD pipeline gates for deployment safety. See Partners for current integration status.

LangChain & LlamaIndex — Planned Q2 2026

Planned callbacks for automatic state extraction and gate enforcement in agent loops.

Webhooks — Planned Q2 2026

Real-time HTTP notifications for state changes, conflicts, and gate decisions. Signed payloads with retry.

CI/CD Gates — Planned Q2 2026

Run policy evaluations in GitHub Actions, GitLab CI, or any pipeline before deployment.

# Planned Q2 2026 — integration not yet live
from langchain.agents import AgentExecutor
from cogna8.integrations import LangChainCallback

# Add Cogna8 as a callback handler
cogna8_cb = LangChainCallback(
    api_key="sk_live_...",
    session_id="sess_abc123",
)

agent = AgentExecutor(
    agent=your_agent,
    tools=your_tools,
    callbacks=[cogna8_cb],
)

# State is automatically extracted.
# Tool calls are gated before execution.
result = await agent.ainvoke({
    "input": "Send the invoice for Project Alpha"
})
# → Gate blocks if conflicts exist

Build with us

We're onboarding early technical partners to shape the API and SDK. Request access to get started.

Request Developer Access