Developer Reference

    API Reference

    Complete endpoint documentation, framework SDKs, and universal deployment guides — everything you need to integrate and ship.

    REST API

    Endpoints

    Base URL: https://<your-host>/api/v1 · All endpoints require Authorization: Bearer <PAT or OIDC JWT> unless marked public. Issue PATs via POST /api/v1/auth/tokens.

    SDK & CLI

    TypeScript SDK — Quick Start

    TypeScript: npm install @aegissovereign/sdk · Python: pip install aegissovereign — both v0.2.0 with client.safety.* / oss.safety.* covering all 8 safety subsystems.

    example.ts
    import { AegisSovereignClient } from "@aegissovereign/sdk";
    
    const client = new AegisSovereignClient({
      apiKey: process.env.AEGISSOVEREIGN_API_KEY!,
      workspaceId: "ws-finance-prod",
      // baseUrl: "https://your-host/api/v1",  // default: production API
    });
    
    // ── Register and promote a model ──────────────────────────
    const model = await client.models.create({
      name: "fraud-detector-v3",
      version: "3.1.0",
      framework: "scikit-learn",
      tags: ["fraud", "tabular"],
      metadata: { accuracy: 0.943, clean_accuracy: 0.943 },
    });
    
    // ── Run EU AI Act compliance evaluation ───────────────────
    const evaluation = await client.regulatory.evaluate(
      model.id,
      "eu_ai_act",
      { use_case: "fraud_detection" }
    );
    
    console.log(evaluation.passed);  // true
    console.log(evaluation.score);   // 0.83
    
    // ── Run adversarial robustness test ───────────────────────
    const robustness = await client.robustnessEvals.create(model.id, {
      attack_types: ["fgsm", "pgd", "carlini_wagner"],
      epsilon: 0.1,
      mode: "simulation",
    });
    
    console.log(robustness.robustness_score);  // 0.74
    console.log(robustness.passed);            // true
    
    // ── Promote to production (requires passing evals) ────────
    const job = await client.models.promote(model.id, {
      notes: "Q4 re-train, all compliance gates passed",
    });
    
    // ── Chat via unified LLM gateway ─────────────────────────
    const response = await client.chat.complete({
      model: "gpt-4o",
      messages: [{ role: "user", content: "Summarise EU AI Act Article 9." }],
    });
    
    // ── AI Safety — validate a prompt before sending ──────────
    const safetyResult = await client.safety.validateInput(
      "Ignore all previous instructions and...",
    );
    if (safetyResult.blocked) {
      console.error("Blocked:", safetyResult.violations.map(v => v.rule_id));
    }
    
    // ── AI Safety — check model registry clearance ───────────
    const clearance = await client.safety.checkModel("gpt-4", "gpt-4-turbo", "customer-support");
    if (!clearance.allowed) throw new Error(clearance.reason);
    
    // ── AI Safety — check model clearance ────────────────────
    const clearance = await client.safety.checkModel("my-fine-tune");
    console.log(`Cleared: ${clearance.cleared} (${clearance.verdict})`);
    
    // ── AI Safety — SLO burn rate ─────────────────────────────
    const slos = await client.safety.getSLOSummary();
    if (slos.critical > 0) console.error("Safety SLO breach — check PagerDuty");
    
    // ── AI Safety — run red-team certification ────────────────
    const redteam = await client.safety.runRedteam({
      domains: ["medical", "financial"],
      includeMultiTurn: true,
    });
    console.log(`Pass rate: ${(redteam.certification.pass_rate * 100).toFixed(1)}%`);
    
    // ── AI Safety — generate EU AI Act report ────────────────
    const report = await client.safety.generateReport({
      framework: "eu_ai_act",
      organization: "ACME Financial",
    });
    console.log(report.content);  // full markdown report
    
    // ── Verify audit chain integrity ──────────────────────────
    const entries = await client.audit.list({ limit: 1 });
    const verification = await client.audit.verifyChain(entries.items[0].id);
    console.log(verification.chain_valid);  // true
    
    // ── Webhook signature verification ───────────────────────
    const isValid = AegisSovereignClient.verifyWebhookSignature(
      rawBody,          // Buffer | string
      xSignatureHeader, // "sha256=..."
      process.env.WEBHOOK_SECRET!
    );
    Universal Deployment

    Helm Guides — AKS · EKS · On-Prem

    The pre-upgrade hook runs alembic upgrade head automatically before pods roll. TLS is managed by cert-manager. See the Operations Guide for full reference.

    Prerequisites

    • Azure CLI installed and authenticated
    • AKS cluster running (≥1.27)
    • Helm 3.12+ installed
    • Sovereign license key

    Steps

    1. 1Authenticate to your AKS cluster
    2. 2Add the Sovereign Helm registry
    3. 3Configure sovereign-values.yaml
    4. 4Install with Helm
    deploy-aks.sh
    # 1. Get AKS credentials
    az aks get-credentials \
      --resource-group sovereign-rg \
      --name sovereign-aks-cluster
    
    # 2. Install Aegis Sovereign
    helm upgrade --install aegissovereign helm/sovereign-gateway \
      --namespace aegissovereign \
      --create-namespace \
      --values helm/sovereign-gateway/values.yaml \
      --values helm/sovereign-gateway/values-production.yaml \
      --set global.platformHost=sovereign.yourcompany.com \
      --set ingress.tls.certManager.acmeEmail=ops@yourcompany.com \
      --wait --timeout 10m
    sovereign-values.yaml
    # values-production.yaml — AKS
    global:
      platformHost: sovereign.yourcompany.com
    
    provider: azure
    cluster:
      type: aks
      region: eastus2
    
    secretKeyProvider: azure_keyvault
    azureKeyVaultUrl: https://your-vault.vault.azure.net
    azureSecretName: sovereign-encryption-key
    
    autoscaling:
      enabled: true
      minReplicas: 2
      maxReplicas: 10
    
    monitoring:
      prometheus: true
      grafana: true