← Developer Portal

IIO SDK

Offizielle SDKs für Python und TypeScript — einfachste Integration

🐍 Python
🟦 TypeScript
💡 Beispiele
📖 API Reference

Installation

pip install iio-governance
pip install iio-governance[langchain] # mit LangChain

⚠ Planned PyPI-Veröffentlichung geplant für Juni 2026 (AGT-101). Jetzt: pip install -e git+https://gitlab.com/zologitlab/iio-seed#egg=iio-governance&subdirectory=base/ecosystem/sdk-python

Quickstart

from iio import IIOClient, GovernanceGate, LayerGraph

# Client initialisieren
client = IIOClient(
    api_key="iio-dev-your-key",  # Von developer.iio.space
    base_url="https://api.iio.space/v1"
)

# Health-Check
health = client.health()
print(health["status"])  # "ok"

# Policy-Check vor Deployment
result = client.policy.check(workspace=".")
if result["status"] != "PASS":
    raise Exception(f"Policy failed: {result}")

# HITL Gate für wichtige Aktionen
gate = GovernanceGate(client, "gate.minor-release-approve")
approved = gate.submit("Deploy v2.1 to production")

# Layer-Graph abfragen
graph = LayerGraph(client)
deps = graph.deps("layer-compliance")
cycles = graph.has_cycles()  # sollte False sein

LangChain Integration

from iio_langchain import create_iio_tools
from langchain.agents import create_react_agent, AgentExecutor

# IIO Tools für LangChain
tools = create_iio_tools(
    iio_api_key="iio-dev-your-key",
    iio_root="/path/to/local/iio"  # Optional für lokale Scripts
)

# Tools verfügbar:
# - iio_policy_check: Policy vor Aktionen prüfen
# - iio_hitl_gate: Mensch-Approval einfordern
# - iio_layer_query: Architektur-Graphen abfragen
# - iio_compliance_check: ISO 42001 / EU AI Act

agent = create_react_agent(llm, tools)
executor = AgentExecutor(agent=agent, tools=tools)

# Agent prüft automatisch Policy vor kritischen Aktionen
result = executor.invoke({
    "input": "Deploy the new AI model to production"
})

Compliance-Check

from iio import IIOClient, ComplianceChecker

client = IIOClient(api_key="iio-dev-...")
checker = ComplianceChecker(client)

# EU AI Act Assessment
result = checker.assess("eu-ai-act")
print(result["classification"])  # "Limited Risk"
print(result["status"])         # "COMPLIANT"

# Alle Frameworks
all_results = checker.assess("all")
# Ergebnis: {"iso42001": {...}, "eu-ai-act": {...}, "gdpr": {...}}

# Bekannte Gaps
gaps = checker.gaps()
for gap in gaps:
    print(f"Gap: {gap}")

Installation

npm install @iio/governance

⚠ Planned npm-Veröffentlichung geplant für Juni 2026 (AGT-106).

Quickstart

import { IIOClient, GovernanceGate, LayerGraph } from '@iio/governance'

// Client initialisieren
const client = new IIOClient({
  apiKey: process.env.IIO_API_KEY,
  baseUrl: 'https://api.iio.space/v1'
})

// Policy-Check
const policy = await client.policy.check()
if (policy.status !== 'PASS') throw new Error('Policy failed')

// HITL Gate
const gate = new GovernanceGate(client, 'gate.minor-release-approve')
const approved = await gate.isApproved()

// Layer-Graph
const graph = new LayerGraph(client)
const deps = await graph.deps('layer-compliance')
const cycles = await graph.hasCycles()  // false

Vercel AI SDK Integration

import { createOpenAI } from '@ai-sdk/openai'
import { createIIOProvider } from '@iio/governance'

// IIO als OpenAI-kompatiblen Provider verwenden
const iio = createIIOProvider({
  apiKey: process.env.IIO_API_KEY
})

// Oder direkt mit @ai-sdk/openai:
const openai = createOpenAI({
  baseURL: 'https://api.iio.space/v1',
  apiKey: process.env.IIO_API_KEY,
})

// Jetzt ganz normal Vercel AI SDK nutzen
const { text } = await generateText({
  model: openai('qwen2.5:7b'),
  prompt: 'Explain AI governance in one sentence',
})

🤖 Governed AI Agent (Python)

from iio import IIOClient
from iio_langchain import create_iio_tools
from langchain_openai import ChatOpenAI

# IIO als LLM-Provider UND Governance-Layer
llm = ChatOpenAI(
    base_url="https://api.iio.space/v1",
    api_key="iio-dev-...",
    model="qwen2.5:7b"
)

tools = create_iio_tools(iio_api_key="iio-dev-...")

# Agent schlägt automatisch an wenn:
# - Policy verletzt wird
# - HITL Gate Approval nötig
# - Compliance-Check fehlschlägt
executor = AgentExecutor(agent=create_react_agent(llm, tools), tools=tools)

result = executor.invoke({
    "input": "Analyse our AI system for EU AI Act compliance"
})

🔧 CI/CD Integration

# .github/workflows/governance.yml
name: IIO Governance Check

on: [push, pull_request]

jobs:
  governance:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: IIO Policy Check
        uses: iio/policy-check@v1  # Coming soon
        with:
          iio-api-key: ${{ secrets.IIO_API_KEY }}
          
      - name: Layer Graph Validation  
        uses: iio/layer-graph@v1
        with:
          iio-root: ./iio
          
# Oder direkt mit Script:
# bash iio/specs/scripts/run-ci-local.sh

IIOClient

MethodeBeschreibungRückgabe
health()API Health-Check{status, cells, models}
policy.check(workspace)Policy-Check ausführen{status, passed, failed}
graph.deps(layer_id)Transitive AbhängigkeitenString (formatted)
graph.cycles()Zyklen im Layer-GraphList[str]
compliance.assess(framework)Compliance-BewertungDict

GovernanceGate

MethodeBeschreibung
submit(action, risk_level)Aktion zur Approval einreichen
status()Gate-Status abfragen
is_approved()Direkte Boolean-Prüfung

Verfügbare API-Endpunkte

EndpointBeschreibung
GET/v1/healthSystem-Status
GET/v1/modelsVerfügbare Modelle
POST/v1/chat/completionsChat (OpenAI-kompatibel)
POST/v1/embeddingsText-Embeddings
POST/v1/governance/policy-checkPolicy-Check
GET/v1/graph/queryLayer-Graph-Queries
POST/v1/compliance/assessCompliance-Check
POST/a2a/tasks/sendA2A Agent Task
GET/.well-known/agent.jsonA2A Agent Card