Security you can re-verify, not just read about

Thirty non-negotiable invariants, encoded as tests and database constraints, exercised against clean databases on every verification run.

The thirty invariants

These are requirements the test suite must encode — not aspirations. Each is enforced in application code and, wherever possible, again in PostgreSQL constraints and triggers.

IDInvariant
INV-01A disabled, revoked, expired, or quarantined principal cannot receive new authorization.
INV-02A denied action cannot execute through any TrustRail gateway.
INV-03Any protected-field mutation after decision or approval invalidates authorization.
INV-04One tenant cannot read, reference, mutate, approve, or execute another tenant's resources.
INV-05Every gateway execution attempt references one valid decision and subject digest.
INV-06Every privileged state transition commits its audit event in the same transaction.
INV-07Published policy and schema versions are immutable and reconstructable.
INV-08Production provider secrets never reach browsers, agents, logs, traces, or analytics.
INV-09An ML or LLM result cannot weaken a deterministic denial or mandatory approval.
INV-10A decision token cannot authorize more than one logical execution.
INV-11Approval votes are bound to the exact subject digest and approval rule version.
INV-12A kill switch or revocation blocks sensitive execution within the stated propagation SLO.
INV-13Child authority is a subset of every ancestor grant and current policy.
INV-14A revoked ancestor makes all descendant authority ineffective.
INV-15Binding commitments cannot be inferred solely from natural-language messages.
INV-16A provider timeout never becomes an assumed failure or assumed success.
INV-17Audit-chain forks are rejected by database concurrency controls.
INV-18No security decision relies on client-controlled tenant, role, risk, time, or digest values.
INV-19Agent-workload egress is denied unless an effective allowlist entry authorizes it.
INV-20Requested host, pinned DNS result, and observed TLS SNI must agree.
INV-21Broker or policy-cache loss fails closed and creates no bypass route.
INV-22Contained agents cannot distinguish containment from an ordinary denial response.
INV-23Automated containment may only restrict authority; widening requires a human.
INV-24Containment tiers are strictly ordered and cannot be skipped toward more authority.
INV-25The forensic plane has no provider credential or control-plane write path.
INV-26No forensic analysis proceeds before the evidence chain verifies.
INV-27Every privileged transition appends evidence in the same transaction.
INV-28No action is called executable without a registered adapter and reconciliation test.
INV-29Untrusted influence may tighten authorization and can never widen it.
INV-30Protected tools execute only against pinned definitions and canonical mappings.

Defense in depth, concretely

Four database roles

Application, gateway, worker, and audited break-glass repair — all NOLOGIN, non-superuser, and unable to bypass row-level security. The worker's only privilege is executing narrow claim functions.

Canonicalization as the root of trust

A from-scratch RFC 8785 implementation with golden vectors, duplicate-key detection (including escape-equivalent duplicates), and strict Unicode handling. Every signature and approval binds to its digests.

SSRF-safe provider transport

Exact-origin pinning, HTTPS only, private/loopback/link-local/metadata ranges rejected after DNS resolution, and the resolved address pinned to defeat DNS rebinding between check and connect.

Hardened execution tokens

Ed25519, canonical JSON encoding, closed claim set (unknown claims rejected), 300-second lifetime cap, base64url canonicity checks, revocation-first key lookup, and atomic one-use consumption.

Everything bounded

Body limits, string caps, policy step budgets, response size ceilings, statement timeouts, bounded retries, capped archives. Unbounded input is treated as the primary denial-of-service vector.

Fail closed, visibly

Missing policy denies. Unknown risk facts count as maximum risk. Stale JWKS is an outage, not a bypass. Readiness endpoints report exactly which dependency failed, with reason codes instead of fabricated success.

Review posture: every milestone ships with a threat model, an executable clean-database rehearsal, and a written review record. Internal deep reviews are complete and documented in-repo; independent external review gates are tracked openly and are never fabricated.