Skip to content

Core Architecture

TheWARDN is a governance gateway — a service that sits between AI agents and the actions they want to take. Every action request passes through a multi-stage evaluation pipeline before receiving a verdict.

The Governance Pipeline

When an AI agent sends a request to /govern, it passes through these stages in order:

┌─────────────────────────────────────────────────────────┐
│                  GOVERNANCE PIPELINE                    │
│                                                         │
│  1. Governance Mode Check                              │
│     └─ DISABLED? → immediate pass-through              │
│                                                         │
│  2. Agent Status Check                                 │
│     ├─ deregistered? → reject                          │
│     ├─ identity_revoked? → reject                      │
│     ├─ paused? → auto-HELD (escrow)                    │
│     └─ blocked? → auto-BLOCKED (violation)             │
│                                                         │
│  3. CHAM Policy Load                                   │
│     ├─ Tenant-wide policies                            │
│     ├─ Agent-scoped policies (additive)                │
│     └─ Agent confidence floor injection                │
│                                                         │
│  4. Decision Boundary Checks                           │
│     ├─ Sequence state (halted sequences block)         │
│     ├─ Grant lifecycle (authorization grants)          │
│     └─ L6 Model Governance (model supply chain)        │
│                                                         │
│  5. Sentinel Evaluation (21 SGP)                       │
│     ├─ CHAM policy evaluation                          │
│     ├─ Tier mapping                                    │
│     ├─ Change window enforcement                       │
│     └─ Confidence threshold check                      │
│                                                         │
│  6. Verdict Sealing                                    │
│     ├─ SHA-256 hash chain audit record                 │
│     ├─ Escrow creation (if HELD)                       │
│     └─ Violation record (if BLOCKED)                   │
│                                                         │
│  7. Response                                           │
│     └─ {verdict, tier, seq, hash, escrow_id}           │
└─────────────────────────────────────────────────────────┘

Components

Sentinel Engine

The Sentinel engine is the core evaluation brain. It implements the 21 Sentinel Governance Principles (SGP) — a hardcoded set of rules that cannot be disabled or overridden by configuration. These include:

  • Fail-closed governance — silence is never approval
  • Human supremacy — humans can always override AI decisions
  • Identity verification — agents must prove WHO_I_AM before acting
  • Confidence thresholds — actions below minimum confidence are held
  • Environment protection — production actions face stricter scrutiny

Sentinel evaluates actions against:

  • SGP rules (hardcoded, immutable)
  • CHAM policies (configurable per tenant)
  • Tier mappings (action type → tier classification)
  • Change windows (time-based enforcement)

CHAM Policy Engine

CHAM stands for Configurable, Hot-swappable, Auditable, Measurable:

PropertyMeaning
ConfigurablePolicies are defined as JSON config — no code changes needed
Hot-swappableActivate, deactivate, or modify policies without redeployment
AuditableEvery policy evaluation is recorded in the audit trail
MeasurablePolicy effectiveness can be measured via governance stats

Policy types include:

  • confidence_floor — minimum confidence scores per dimension
  • environment_restriction — block actions in specific environments
  • action_type_block — block specific action types
  • rate_limit — limit actions per time window
  • require_reasoning — require agents to provide reasoning
  • grant_lifecycle — require authorization grants
  • compliance_pack — regulatory compliance policy sets

Audit Store

Every governed action produces an audit record sealed with a SHA-256 hash chain:

Record N:
  seq: 42
  hash: SHA256(prev_hash + tenant_id + agent_id + verdict + tier + action_type + ...)
  prev_hash: <hash of record 41>
  verdict: CLEARED
  tier: A
  policies_fired: ["confidence_floor"]
  sealed_at: 2026-04-10T20:14:03Z

The hash chain ensures tamper detection. If any historical record is modified, every subsequent hash becomes invalid. This provides:

  • Integrity verification — detect any tampering with historical records
  • Non-repudiation — prove that a specific verdict was sealed at a specific time
  • Regulatory compliance — HIPAA, SOX, and EU AI Act all require immutable audit trails

Escrow Queue

When Sentinel returns a HELD verdict, the action is placed in the escrow queue for human review:

  • Release — approve the action for execution
  • Kill — reject the action permanently
  • Timeout — if no human reviews within the timeout window (configurable per tier), the action expires

Escrow provides the "human in the loop" that regulators require for high-risk AI actions.

Agent Registry

Every AI agent that interacts with TheWARDN must be registered:

json
{
  "id": "agent_abc123",
  "name": "deploy-bot",
  "description": "Automated deployment agent",
  "status": "active",
  "tier_override": null,
  "confidence_floor": 0.85,
  "total_governed": 1247,
  "total_cleared": 1180,
  "total_held": 52,
  "total_blocked": 15,
  "last_seen": "2026-04-10T20:00:00Z"
}

Agent statuses:

  • active — normal governance evaluation
  • paused — all actions auto-HELD for review
  • blocked — all actions auto-BLOCKED
  • deregistered — agent cannot submit actions
  • identity_revoked — agent must re-register identity

Data Model

Core Tables

TablePurpose
tenantsOrganizations using TheWARDN
usersUser accounts within tenants
agentsRegistered AI agents
cham_policiesGovernance policies
tier_mappingsAction type to tier classification
change_windowsTime-based governance windows
audit_recordsImmutable hash-chained audit trail
escrow_queueActions held for human review
violationsPolicy violation records
agent_policiesAgent-specific policy assignments

Layer Tables

TableLayerPurpose
l6_model_registryL6Approved AI models
l6_map_policiesL6Model Access Policies
l6_model_auditL6Model governance audit trail
l6_shadow_eventsL6Shadow model detection events
l6_platform_connectorsL6Platform integration configs
l6_configL6Per-tenant L6 settings

Technology Stack

ComponentTechnology
Gateway APIFastAPI (Python 3.11+)
DatabasePostgreSQL 15
Cache/Rate LimitRedis 7
Console UIReact 19 + Tailwind v4 + Framer Motion
HostingHetzner (backend) + Vercel (frontend)
AuthSupabase Auth (JWT)
PaymentsStripe
Reverse ProxyNginx

Deployment Architecture

                    ┌──────────────────┐
                    │   Cloudflare     │
                    │   (DNS + CDN)    │
                    └────────┬─────────┘

              ┌──────────────┴──────────────┐
              │                             │
    ┌─────────┴─────────┐       ┌──────────┴──────────┐
    │ console.thewardn.ai│       │ api.thewardn.ai     │
    │    (Vercel)        │       │    (Hetzner)         │
    │    React SPA       │       │    Nginx → Gateway   │
    └────────────────────┘       └──────────┬──────────┘

                                 ┌──────────┴──────────┐
                                 │   Docker Compose     │
                                 │                      │
                                 │  ┌────────────────┐  │
                                 │  │ wardn-gateway  │  │
                                 │  │ (FastAPI:9008) │  │
                                 │  └───────┬────────┘  │
                                 │          │           │
                                 │  ┌───────┴────────┐  │
                                 │  │ wardn-postgres  │  │
                                 │  │ (PostgreSQL:5432)│ │
                                 │  └────────────────┘  │
                                 │                      │
                                 │  ┌────────────────┐  │
                                 │  │ wardn-redis    │  │
                                 │  │ (Redis:6379)   │  │
                                 │  └────────────────┘  │
                                 └──────────────────────┘

Next Steps

AI Governance for Every Organization