Skip to main content

Integration Guide

Connect any AI agent framework to Vienna OS in under 10 minutes.

Quick Start

1

Install the SDK

npm install @vienna/sdk
# or
pip install vienna-sdk
2

Initialize the adapter

import { createLangChainAdapter } from '@vienna/sdk';

const vienna = createLangChainAdapter({
  apiUrl: 'https://api.regulator.ai',
  apiKey: 'vos_your_api_key',
  agentId: 'my-langchain-agent'
});

// Register agent on startup
await vienna.register({
  name: 'My LangChain Agent',
  capabilities: ['deploy_code', 'send_email', 'query_database']
});
3

Submit intents before acting

// Before executing any action, submit intent to Vienna
const result = await vienna.submitIntent({
  action: 'deploy_code',
  params: { service: 'api-gateway', version: '2.3.1' },
  objective: 'Deploy API v2.3.1 to production'
});

if (result.status === 'approved') {
  // Execute with warrant
  await deployService('api-gateway', '2.3.1');
  
  // Report execution result
  await vienna.reportExecution(result.warrant_id, {
    success: true,
    output: 'Deployed api-gateway v2.3.1'
  });
} else if (result.status === 'pending') {
  // T2/T3 — wait for human approval
  const approved = await vienna.waitForApproval(result.intent_id);
  if (approved.status === 'approved') {
    await deployService('api-gateway', '2.3.1');
    await vienna.reportExecution(approved.warrant_id, { success: true });
  }
}

Framework Examples

LangChain / LangGraph

Wrap tool calls with Vienna governance

import { createLangChainAdapter } from '@vienna/sdk';

const vienna = createLangChainAdapter({
  apiUrl: 'https://api.regulator.ai',
  apiKey: process.env.VIENNA_API_KEY,
  agentId: 'langchain-agent-01'
});

// Create a governed tool
function governedTool(toolFn, action) {
  return async (...args) => {
    const result = await vienna.submitIntent({
      action,
      params: { args },
      objective: `Execute ${action}`
    });
    
    if (result.status !== 'approved') {
      throw new Error(`Action ${action} requires approval`);
    }
    
    const output = await toolFn(...args);
    await vienna.reportExecution(result.warrant_id, { 
      success: true, output: JSON.stringify(output) 
    });
    return output;
  };
}

CrewAI

Add governance to crew task execution

from vienna import create_crewai_adapter

vienna = create_crewai_adapter(
    api_url="https://api.regulator.ai",
    api_key=os.environ["VIENNA_API_KEY"],
    agent_id="crewai-research-crew"
)

# Before each task execution
result = vienna.submit_intent(
    action="web_search",
    params={"query": "AI governance market analysis"},
    objective="Research AI governance market for quarterly report"
)

if result["status"] == "approved":
    # Proceed with crew task
    crew.kickoff()
    vienna.report_execution(result["warrant_id"], success=True)

OpenClaw

Native integration via OpenClaw bridge

import { createOpenClawAdapter } from '@vienna/sdk';

const vienna = createOpenClawAdapter({
  apiUrl: 'https://api.regulator.ai',
  apiKey: process.env.VIENNA_API_KEY,
  agentId: 'openclaw-main-agent'
});

// OpenClaw sessions automatically route through Vienna
// when VIENNA_API_URL is set in environment

Microsoft AutoGen

Govern multi-agent conversations

from vienna import FrameworkAdapter

vienna = FrameworkAdapter(
    api_url="https://api.regulator.ai",
    api_key=os.environ["VIENNA_API_KEY"],
    agent_id="autogen-group-chat",
    framework="autogen"
)

# Wrap the GroupChatManager's execution step
# Each agent action goes through Vienna governance
result = vienna.submit_intent(
    action="code_execution",
    params={"language": "python", "sandbox": True},
    objective="Execute generated code in sandbox"
)

API Reference

POST/api/v1/intents

Submit an intent for governance evaluation

Request Body
agent_idstring — Agent identifier
actionstring — Action to perform
paramsobject — Action parameters
objectivestring — Human-readable description
Response
intent_idstring
status'approved' | 'pending' | 'denied'
risk_tier'T0' | 'T1' | 'T2' | 'T3'
warrant_idstring (if approved)
POST/api/v1/executions

Report execution result after warrant-authorized action

Request Body
warrant_idstring — Warrant that authorized this execution
successboolean — Whether execution succeeded
outputstring — Execution output
Response
execution_idstring
verifiedboolean
POST/api/v1/agents

Register an agent with Vienna OS

Request Body
agent_idstring — Unique agent identifier
namestring — Display name
capabilitiesstring[] — Actions this agent can perform
Response
registeredboolean
agent_idstring
GET/api/v1/warrants/:warrantId

Verify a warrant's validity

Response
validboolean
warrantobject — Full warrant details

Risk Tiers

TierRiskApprovalMax TTLExample
T0InformationalAuto60 minRead file, check status
T1LowPolicy auto30 minSend email, create ticket
T2Medium1 human15 minDeploy code, modify DB
T3High2+ humans5 minWire transfer, delete prod

Ready to govern your agents?

Start with the free Community tier. No credit card required.

Get Started Free