Skip to main content

AI Orchestration

Truthlocks AI Orchestration enables you to define, execute, and monitor multi-agent workflows with built-in cost attribution, safety guardrails, and complete audit trails.

Overview

┌─────────────────────────────────────────────────────────────┐
│                    Orchestration Engine                       │
│                                                               │
│  Workflow Definition → Step Execution → Result Aggregation   │
│         │                    │                    │           │
│         ▼                    ▼                    ▼           │
│   ┌──────────┐     ┌──────────────┐     ┌──────────────┐    │
│   │ Guardrail│     │  Agent Pool  │     │  Cost Tracker │    │
│   │  Engine  │     │              │     │              │    │
│   └──────────┘     │ Agent A      │     │ $0.12 total  │    │
│                    │ Agent B      │     │ 847 tokens   │    │
│                    │ Agent C      │     └──────────────┘    │
│                    └──────────────┘                          │
└─────────────────────────────────────────────────────────────┘
All orchestration and workflow endpoints have an interactive API playground. Open any endpoint in the Orchestrations & Workflows API reference and click Send to try it against the Sandbox.

Quick start

Execute an orchestration

curl -X POST https://api.truthlocks.com/v1/orchestrations/execute \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "name": "quarterly-compliance-review",
    "agents": ["maip-agent:01JAAAA", "maip-agent:01JBBBB"],
    "steps": [
      {
        "name": "gather-evidence",
        "agent_id": "maip-agent:01JAAAA",
        "action": "compliance.gather",
        "input": { "scope": "soc2", "period": "Q1-2026" }
      },
      {
        "name": "evaluate-controls",
        "agent_id": "maip-agent:01JBBBB",
        "action": "compliance.evaluate",
        "depends_on": ["gather-evidence"],
        "input": { "framework": "soc2-type2" }
      }
    ],
    "guardrails": {
      "max_cost_usd": 5.00,
      "max_duration_seconds": 300,
      "require_trust_score_above": 70
    }
  }'
Response:
{
  "id": "maip-orch:01JOOOO",
  "status": "running",
  "steps": [
    { "name": "gather-evidence", "status": "running" },
    { "name": "evaluate-controls", "status": "pending" }
  ],
  "started_at": "2026-04-06T14:00:00Z"
}

Check Orchestration Status

curl https://api.truthlocks.com/v1/orchestrations/maip-orch:01JOOOO \
  -H "X-API-Key: $API_KEY"
{
  "id": "maip-orch:01JOOOO",
  "status": "completed",
  "steps": [
    { "name": "gather-evidence", "status": "completed", "duration_ms": 12400 },
    { "name": "evaluate-controls", "status": "completed", "duration_ms": 8200 }
  ],
  "cost": {
    "total_usd": 1.24,
    "breakdown": [
      { "step": "gather-evidence", "usd": 0.87, "tokens": 12400 },
      { "step": "evaluate-controls", "usd": 0.37, "tokens": 5200 }
    ]
  },
  "completed_at": "2026-04-06T14:00:21Z"
}

LLM Inference Logging

Track every LLM call made during orchestration:
curl -X POST https://api.truthlocks.com/v1/orchestrations/maip-orch:01JOOOO/llm-inference \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "model": "claude-sonnet-4-6-20250514",
    "provider": "anthropic",
    "input_tokens": 1200,
    "output_tokens": 450,
    "latency_ms": 2400,
    "cost_usd": 0.012,
    "step_name": "evaluate-controls"
  }'

Workflows

For recurring orchestration patterns, define reusable workflows:

Create a Workflow

curl -X POST https://api.truthlocks.com/v1/workflows \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "name": "weekly-risk-assessment",
    "description": "Automated weekly risk assessment across all vendors",
    "steps": [
      {
        "name": "scan-vendors",
        "action": "risk.scan",
        "input_template": { "vendor_list": "{{vendors}}" }
      },
      {
        "name": "score-risks",
        "action": "risk.score",
        "depends_on": ["scan-vendors"]
      },
      {
        "name": "generate-report",
        "action": "report.generate",
        "depends_on": ["score-risks"],
        "input_template": { "format": "pdf", "recipients": "{{team_email}}" }
      }
    ],
    "schedule": "0 9 * * MON",
    "guardrails": {
      "max_cost_usd": 10.00,
      "max_duration_seconds": 600
    }
  }'

Execute a Workflow

curl -X POST https://api.truthlocks.com/v1/workflows/maip-workflow:01JWWWW/execute \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "variables": {
      "vendors": ["vendor_a", "vendor_b", "vendor_c"],
      "team_email": "risk-team@corp.com"
    }
  }'

Guardrails

GuardrailDescription
max_cost_usdHard cost ceiling — orchestration halts if exceeded
max_duration_secondsMaximum wall-clock time
max_tokensTotal token budget across all LLM calls
require_trust_score_aboveMinimum agent trust score to participate
require_human_approvalSteps that need human sign-off before proceeding
allowed_modelsWhitelist of permitted LLM models
blocked_actionsActions that are explicitly forbidden

Guardrail Check

curl -X POST https://api.truthlocks.com/v1/guardrails/check \
  -H "X-API-Key: $API_KEY" \
  -d '{
    "agent_id": "maip-agent:01JAAAA",
    "action": "orchestrations:execute",
    "context": {
      "estimated_cost_usd": 3.50,
      "models": ["claude-sonnet-4-6-20250514"],
      "duration_estimate_seconds": 120
    }
  }'
{
  "allowed": true,
  "checks": [
    { "rule": "max_cost_usd", "status": "pass", "limit": 5.00, "actual": 3.50 },
    { "rule": "allowed_models", "status": "pass" },
    { "rule": "trust_score", "status": "pass", "score": 87, "minimum": 70 }
  ]
}

Cost Attribution

All costs are attributed at multiple levels:
  • Per-step: Each step tracks its own token usage and cost
  • Per-agent: Aggregate cost across all steps an agent participated in
  • Per-orchestration: Total cost for the entire workflow execution
  • Per-tenant: Monthly rollup for billing purposes
Cost data feeds into the billing system and is visible in the console dashboard.

Billing & Quotas

MetricDeveloperBusinessEnterprise
Orchestrations/mo101,000Unlimited
Workflow definitions250Unlimited
LLM inference logs/mo10010,000Unlimited

Next steps

Machine identity

Full MAIP protocol overview and quick start.

Trust scores

Continuous behavioral trust evaluation for agents.

Event streaming

Generate receipts for messages flowing through Kafka, EventBridge, Kinesis, NATS, and Redis Streams.

AI model connectors

Automatic receipts for LangChain, LlamaIndex, CrewAI, and other AI framework calls.