§ Security Posture
Authentication is required on every endpoint.
Production tenants receive a signed API key (HMAC-SHA256, scoped to a tenant_id) issued on cohort onboarding. Sandbox / evaluation tokens are time-bounded and watermarked. Trust Gate does not expose interactive OpenAPI / ReDoc / Swagger UI on production hosts — the only public surface is this human-readable reference.

Need a production credential? Book a 30-min onboarding or email apps@cyberwarriornetwork.com.
§ 14.A · Authentication

Authentication.

Every request requires a Bearer token in the Authorization header. Tokens are scoped to a single tenant, audited on every call, and rotate on a 90-day cycle (or on-demand via the customer portal).

Request header
Authorization: Bearer <your-api-key>
Content-Type: application/json
X-Tenant-Id: <your-tenant-id>
Authorization scopes
ScopeGrants
decisions:writeMint TrustAtom receipts via /api/decision/evaluate
decisions:readQuery the evidence graph (recent, denied, lineage, range, analytics)
receipts:verifyVerify cryptographic signatures on any TrustAtom (read-only, audit-friendly)
explain:readGenerate human-readable policy explanations for a decision ID
Rate limits: default 100 requests / minute per tenant on the evaluate endpoint, 1,000 / minute on read endpoints. Enterprise tier is 10× default. 429 Too Many Requests on overflow with a Retry-After header.
§ 14.B · Availability

High Availability.

Trust Gate runs with graceful degradation — the receipt pipeline never goes down, even when downstream services do. Decisions and receipts are always minted and always cryptographically signed.

ModeBehaviour
FullAll services nominal. Receipts written to evidence graph synchronously.
DegradedOne downstream service unavailable. Receipts continue, written to durable queue, replayed on recovery.
SandboxEvaluation tier. Returns watermarked demo receipts that are not production-grade evidence.

SLA: 99.99% uptime on Enterprise tier with <120ms p99 latency. Status: status.cyberwarriornetwork.com.

§ 14.C · Decision Engine

Decision Engine.

Three customer-facing endpoints: gate a decision, verify a receipt, explain a verdict.

POST /api/decision/evaluate

Gate a request through your tenant's policy. If allowed, mints a court-admissible notarization (hybrid post-quantum signature, evidence-hashed) and writes to the immutable evidence graph. If denied, returns the policy reasoning — no notarization is minted.

Request body
{
  "tenant_id":        "<your-tenant-id>",
  "decision_id":      "<client-supplied-uuid>",
  "principal_id":     "<the-human-or-system-actor>",
  "agent_id":         "<the-AI-agent-acting>",
  "action":           "READ_EVIDENCE",
  "resource_id":      "<the-resource-being-acted-on>",
  "request_category": "GRAPH_READ"
}
Response — ALLOW
{
  "decision": {
    "decision":  "ALLOW",
    "reasons":   ["action_in_safe_categories"],
    "policy_version": "<tenant-policy-hash>"
  },
  "trustatom": {
    "id":             "ta_<hex>",
    "evidence_hash":  "<sha-256>",
    "signature_b64":  "<ed25519-signature>",
    "pq_signature_b64": "<ml-dsa-65-signature>",
    "minted_at":      "2026-05-06T13:56:40Z"
  },
  "timing": { "total_ms": 87 }
}
Response — DENY
{
  "decision": {
    "decision":  "DENY",
    "reasons":   ["policy_constraint_violated"],
    "policy_version": "<tenant-policy-hash>"
  },
  "trustatom": null
}
POST /api/trustatom/verify

Verify the hybrid post-quantum signature and evidence hash of a notarization. Verification is independent of the issuer — auditors verify any notarization with the public key alone, no Trust Gate access required. Court-admissible under ESIGN and eIDAS.

Request body
{
  "evidence_hash":     "<sha-256>",
  "signature_b64":     "<ed25519-signature>",
  "pq_signature_b64":  "<ml-dsa-65-signature>",
  "receipt_payload":   { "...": "the original receipt JSON" }
}
Response
{
  "ok":  true,
  "ed25519":   { "valid": true },
  "ml_dsa_65": { "valid": true },
  "evidence_hash": { "match": true },
  "verified_at":   "2026-05-06T14:02:11Z"
}
POST /api/decision/explain

Generate a human-readable explanation for a decision by ID. Returns reasoning + compliance framework alignment.

Request body
{
  "decision_id": "<previously-minted-decision-id>",
  "mode":        "why_allowed"
}

Modes: why_allowed · why_denied · constraints · similar_decisions

Response
{
  "ok": true,
  "explanation": {
    "summary": "<natural-language-summary>",
    "policy_rules": ["<rule-name>"],
    "compliance_alignment": {
      "nist_ai_rmf":  ["<applicable-control>"],
      "soc2":         ["<applicable-control>"],
      "eu_ai_act":    ["Article 50 transparency"]
    }
  }
}
§ 14.D · Evidence Graph

Evidence Graph.

Read endpoints over the immutable receipt graph. All endpoints honour X-Tenant-Id — you only see receipts for your tenant.

GET /api/graph/stats

Tenant-scoped aggregates — total decisions, allow/deny split, receipt count, principal + agent counts.

GET /api/graph/decisions/recent

Recent decisions with receipt IDs, descending by timestamp. Query params: limit (default 20, max 100).

GET /api/graph/decisions/denied

Denied decisions with policy reasoning. Useful for compliance review + auditor walk-throughs. Query params: limit (default 20, max 100).

GET /api/graph/decision/{decision_id}

Full lineage for a single decision — decision node + receipt + policy verdict + actor chain. The artifact auditors actually ask for.

§ 14.E · Analytics

Analytics.

Operational dashboards over the receipt graph. Per-tenant, time-bounded.

GET /api/graph/decisions/range

Time-range filtered decisions. Defaults to last 24 hours. Query params: since_ms · until_ms · limit (default 100, max 1000).

GET /api/graph/analytics/agents

Per-agent decision statistics: total, allow count, deny count, deny rate. Anomaly surface for security review. Query param: limit (default 20).

GET /api/graph/analytics/compliance

Compliance-framework coverage distribution — which frameworks are most exercised by your tenant's decisions. Useful for audit prep.

§ 14.F · Receipt Fields

Receipt Fields.

Every TrustAtom receipt includes provenance fields so auditors can trace lineage, environment, and risk category for each decision.

FieldTypeDescription
envenumSANDBOX · STAGING · PRODUCTION
parent_decision_idstringLinks to the parent decision in a causal chain (empty if root)
compliance_tagsstring[]Compliance framework alignment tags (NIST AI RMF, SOC 2, EU AI Act, CMMC 2.0, HIPAA)
risk_categoryenumSAFE · MODERATE · HIGH · CRITICAL — computed from action class
ttl_msintTime-to-live for time-bounded decisions. 0 = permanent

Risk categorisation is policy-driven and tenant-configurable. Default category mappings ship with the SDK; custom risk policies are authored via the customer portal (Enterprise tier) or scoped during onboarding.

§ 14.G · Error Handling

Error Handling.

All endpoints return structured errors with a consistent shape. Internal stack details are redacted from production responses.

{
  "ok":           false,
  "error_code":   "AUTH_REQUIRED",
  "message":      "Authentication required.",
  "request_id":   "<opaque-trace-id>"
}
200 Success 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 429 Rate Limited 503 Service Unavailable
Error CodeWhen
AUTH_REQUIREDMissing or invalid Bearer token
SCOPE_DENIEDToken lacks the required scope for this endpoint
TENANT_MISMATCHX-Tenant-Id does not match the token's scope
INVALID_REQUESTMissing or malformed request body fields
NOT_FOUNDDecision ID or resource not found in your tenant
RATE_LIMITEDPer-tenant rate limit exceeded; retry after Retry-After header
SERVICE_UNAVAILABLETransient downstream issue; receipt is queued and will be replayed

Every error response includes a request_id. Quote it when contacting support — it lets us correlate your request to the audit trail without exposing internal trace data.

§ 14.H · SDK + MCP

SDK + MCP.

Drop-in language SDKs and an MCP server for direct AI agent integration.

@cwn/trust-gate-sdk

Python and TypeScript libraries. One-line decorator gates a function call through Trust Gate, mints a receipt, and returns the wrapped result. Available to onboarded customers via private GitHub repo.

Python decorator pattern
from cwn_trust_gate import trust_gate

@trust_gate(policy="data_pii", tenant_id="<your-tenant-id>")
def export_customer_records(query: str) -> list:
    return db.query(query)

# Every call is gated, signed, receipted automatically.
@cwn/mcp-trust-gate

Model Context Protocol server — lets Claude / GPT / any MCP-compatible agent invoke Trust Gate directly. Available on the MCP registry for onboarded customers.

Stripe Agent Toolkit Plugin

Wraps every Stripe Agent Toolkit operation with Trust Gate so AI agent payments produce a dual receipt — one from Stripe (the money moved), one from Trust Gate (the decision was authorised).

Get the SDK: Book onboarding or email apps@cyberwarriornetwork.com. Production credentials are issued at cohort onboarding.