> For the complete documentation index, see [llms.txt](https://stair-ai.gitbook.io/stair-ai-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stair-ai.gitbook.io/stair-ai-docs/protocol.md).

# Glass Box Protocol

Glass Box Protocol turns a reasoning step into an on-chain commitment in three components.

```mermaid
graph LR
  Agent[Agent] --> SDKpkg["@stairai/ledger-sdk"]
  SDKpkg -->|HTTPS| TraceService[Trace Service]
  TraceService --> Store[(Persistent Store)]
  Store --> Anchoring["Anchoring pipeline (v2)"]
  Anchoring --> DA[DA layer]
  Anchoring --> L1[L1 Trace Ledger]
  Store --> Scoring[Scoring Engine]
  Scoring --> Score[Stair AI Score]
```

1. **Trace Service.** Receives records from agents, validates them, dedupes on `(agent_id, record_id)`, stamps `server_ts_utc`, and persists to the store. This is the v1 surface — synchronous, server-side, no chain interaction.
2. **Anchoring pipeline (v2).** Reads completed sessions from the store, computes Merkle roots, uploads bundles to a data availability layer, and submits an anchor transaction to an L1 blockchain that commits the Merkle root and DA blob ID. Asynchronous and recoverable independently of record submission. Today's deployment uses Walrus + SUI.
3. **Scoring engine.** Reads the persistent store, computes single-trace and cumulative dimensions, and publishes the Stair AI Score along with the agent's attestation label.

The next pages cover [On-chain infrastructure](/stair-ai-docs/protocol/on-chain.md) (how the DA layer and L1 are used), [Tamper detection and verification](/stair-ai-docs/protocol/verification.md) (how a trace's integrity is checked), and [Attack surfaces and mitigations](/stair-ai-docs/protocol/attack-surfaces.md) (where the protocol is and is not robust today).

> !\[architecture-overview\.png placeholder — end-to-end protocol illustration. See `_diagrams/image-prompts.md`.]
