For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

You don't need to read this section to build with Brain. It's here for the moments when you do: compliance review, custom policy design, on-chain audit, agent autonomy work, or just because you want to understand what's happening underneath.

The Six-Layer Stack

Raw → Ledger → Wiki → Policy → Agent → Audit

Information flows up. Control flows down. Each tenant has its own logical instance of every layer, with hard isolation at the database, key, and policy boundaries.

Layer
Owns
Concept page

1. Raw

Source evidence, immutable

Raw and Ledger

2. Ledger

Machine-readable financial truth

Raw and Ledger

3. Wiki

Human-readable financial memory

The Wiki

4. Policy

Deterministic permission and approval logic

Policy and Permissioning

5. Agent

Proposal and orchestration

Agents

6. Audit

Immutable proof of what happened and why

Audit and Proof

→ Six-layer overview

What's in This Section

The Six-Layer Stack

The whole protocol on one page.

Raw and Ledger

How evidence becomes deterministic structure.

The Wiki

The continuously regenerated memory layer.

Policy and Permissioning

Plain-English rules to deterministic guards.

Agents

Internal and external agents in the protocol.

Payment Intents

The Ledger entity that represents a proposed action.

The Pre-Execution Gate

The 13 numbered checks + 10 hardening additions (23 total) before any payment.

Audit and Proof

Tamper-evident history anchored on Base L2.

Agent Contributions

How external agents contribute evidence safely.

Architecture Deep Dives

System Overview

The architecture top-down.

Data Flow

How a single source-of-truth event ripples up the stack.

Write Paths

The two controlled exceptions to bottom-up flow.

Tenant Isolation

Per-tenant boundaries, end to end.

Security and Compliance

Crypto, keys, sanctions, SOC 2 trajectory.

Risks and Mitigations

Where things can go wrong, and what catches them.

Where the Protocol Meets the Chain

The on-chain surface is intentionally small. Most logic stays off-chain. Four smart contracts on Base L2 anchor the parts that have to be public and tamper-evident.

Contract
Anchors
Page

BrainAuditAnchor

Audit Merkle roots per tenant

BrainAuditAnchor

BrainPolicyRegistry

Policy version hashes per tenant

BrainPolicyRegistry

BrainSmartAccount

Session-key account enforcing scope, spend caps, and the bound policyVersion via executeViaSessionKey

BrainSmartAccount

BrainMCPAgentRegistry

Agent identity, capabilities, scope grants

BrainMCPAgentRegistry

Where to Start

If you want to understand...
Start here

The whole stack

Six-Layer Stack

Why memory and policy are separate layers

Raw and Ledger

How decisions stay safe

Pre-Execution Gate

Why this is verifiable

Audit and Proof

What external agents can and can't do

Agents, Agent Contributions

Last updated