SDK Quickstart

Get started with the Cognigate governance API in your language of choice

TypeScript / Node.js

Official TypeScript SDK with full type safety

npm install @vorionsys/cognigate
import { Cognigate } from '@vorionsys/cognigate';

const cg = new Cognigate({
  apiKey: process.env.COGNIGATE_API_KEY,
  baseUrl: 'https://cognigate.dev',
});

// Parse intent
const intent = await cg.intent.parse({
  agentId: 'agent_001',
  rawIntent: 'Read user profile data',
  trustScore: 650,
});

// Enforce policies
const decision = await cg.enforce.evaluate({
  intent: intent.normalized,
  agentId: 'agent_001',
  trustLevel: 4,
});

// Create proof
const proof = await cg.proof.create({
  event: 'intent_enforced',
  entityId: 'agent_001',
  payload: { intent, decision },
});

Python

Python SDK with async support

pip install cognigate
from cognigate import Cognigate

cg = Cognigate(
    api_key="your-api-key",
    base_url="https://cognigate.dev",
)

# Parse intent
intent = await cg.intent.parse(
    agent_id="agent_001",
    raw_intent="Read user profile data",
    trust_score=650,
)

# Enforce policies
decision = await cg.enforce.evaluate(
    intent=intent.normalized,
    agent_id="agent_001",
    trust_level=4,
)

# Create proof
proof = await cg.proof.create(
    event="intent_enforced",
    entity_id="agent_001",
    payload={"intent": intent, "decision": decision},
)

cURL / REST

Direct HTTP access to the API

# Parse intent
curl -X POST https://cognigate.dev/v1/intent \
  -H "X-API-Key: your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "agent_001",
    "raw_intent": "Read user profile data",
    "trust_score": 650
  }'

# Enforce policies
curl -X POST https://cognigate.dev/v1/enforce \
  -H "X-API-Key: your-key" \
  -H "Content-Type: application/json" \
  -d '{
    "intent": "data.read.user_profile",
    "agent_id": "agent_001",
    "trust_level": 4
  }'

# Get trust tiers
curl https://cognigate.dev/v1/reference/tiers

Go

Go client library

go get github.com/vorionsys/cognigate-go
package main

import (
    "context"
    cognigate "github.com/vorionsys/cognigate-go"
)

func main() {
    client := cognigate.NewClient(
        cognigate.WithAPIKey("your-api-key"),
        cognigate.WithBaseURL("https://cognigate.dev"),
    )

    // Parse intent
    intent, _ := client.Intent.Parse(context.Background(),
        &cognigate.IntentRequest{
            AgentID:    "agent_001",
            RawIntent:  "Read user profile data",
            TrustScore: 650,
        },
    )
}

Quick Links

API Documentation

Interactive Swagger UI with try-it-out for all endpoints

Open Swagger UI →
ReDoc Reference

Clean, readable API reference documentation

Open ReDoc →
OpenAPI Spec

Download the raw OpenAPI 3.1 specification

Download JSON →
GitHub

Source code, issues, and contributions

View on GitHub →