# TrustScript System Architecture v1.0

**Status:** Public architecture reference  
**Layer:** TrustScript — trusted-state security on TraceScript Core

---

## 1. Canonical lock

> TrustScript secures trusted state formation on TraceScript Core.

TraceScript Core programs substrate state — signals, operators, receipts, replay contracts, and artifact lineage. TrustScript is the first commercial security kernel on that core. It governs whether incoming signals, memories, policies, workflow states, commitments, and agent actions may become **trusted enterprise state**.

---

## 2. Buyer question

Before an AI agent remembers, relies, commits, or acts — is the underlying state admissible, replayable, policy-authorized, authority-bound, and evidence-backed?

TrustScript answers that question inside the transaction, with immutable receipts — not post-hoc logs or prompt policies.

---

## 3. Three-layer placement

```
1. TraceScript Core     — operators, receipts, replay, artifact ledger
2. TrustScript          — six surfaces, gates, continuity, evidence export
3. Domain surfaces      — SmartPeers, CSD/DENSITY, application whitepapers
```

**Planned (not shipped):** Coordination Intelligence — regime routing, privacy envelopes, organizational intelligence upgrades. Documented internally; not public TrustScript product surfaces.

---

## 4. Six TrustScript surfaces

| # | Surface | Role |
|---|---------|------|
| 1 | Agent Action Firewall | Safe-to-act — tool release and external writes |
| 2 | Trusted Memory / RAG Integrity | Safe-to-trust — memory promotion and retrieval basis |
| 3 | Policy Corpus Integrity | Policy mutation as a security event |
| 4 | Workflow Truth & Commitment Ledger | Operational claims → governed state transitions |
| 5 | Recursive Continuity Verifier | Operator-bound deterministic replay |
| 6 | TraceScript Evidence Export | Audit bundles and verification runs |

**First wedge:** Agent Action Firewall + Trusted Memory Integrity.

---

## 5. Signal → trusted state pipeline

```
raw input
  → GovernedSignal (ingest)
  → TraceScript Core evaluate
  → TrustScript surface gates
  → trusted state | blocked / quarantined state
  → continuity verify + evidence export (Surfaces 5–6)
  → domain product branches
```

---

## 6. Runtime API (RC1)

| Surface | Route |
|---------|-------|
| Catalog | `GET /trustscript/surfaces` |
| 1 Action Firewall | `POST /trustscript/surfaces/action-firewall/evaluate` |
| 2 Memory Integrity | `POST /trustscript/surfaces/memory-integrity/evaluate` |
| 3 Policy Corpus | `POST /trustscript/surfaces/policy-corpus/evaluate` |
| 4 Workflow Truth | `POST /trustscript/surfaces/workflow-truth/evaluate` |
| 5 Continuity | `POST /trustscript/surfaces/continuity-verifier/verify` |
| 6 Evidence | `POST /trustscript/evidence/export` |
| Proof flow (5+6) | `POST /trustscript/proof/run` |
| Observability | `GET /trustscript/observability/surface-decisions` |

Product-depth workflow governance: `POST /tracescript/product/workflow/govern`

---

## 7. Proof story

Every important TrustScript transition emits an integrity receipt with `trustScriptSurface` tags. Surface 5 verifies lawful ancestry via full-chain replay. Surface 6 exports audit-ready bundles. Unified proof runs persist to `substrate_trustscript_proof_runs`.

See `/proof.html` for the RC1 proof console and `/portal.html` for tenant-scoped proof runs.

---

## 8. Related documents

- [TrustScript hub](/trustscript.html)
- [Products overview](/products.html#trustscript)
- [Architecture — three-layer placement](/architecture.html#three-layer-placement)
- [Reference Kernel v0.1 build sprint](/downloads/trunk/reference-kernel-v0.1-build-sprint.md)
- [Product Wedge Brief v1.0](/downloads/trustscript-product-wedge-brief-v1.0.md)
