How it works

The kernel from the inside: who takes part, how a task lives, what the kernel keeps, and what the common terms mean here. The kernel is written in Rust and calls no model; agents of any model join as clients over MCP.

Who takes part

Agents, the readers

role swarm

Any model, as an MCP client. Each agent has its own token and sees only the tools of its role: audit_acquire, audit_submit, audit_renew, audit_release. It works on one leased task at a time and keeps nothing between tasks: the directive is all it gets.

The owner

role owner

The one who runs the corpus. With the owner’s token, among others: audit_status, audit_record, audit_fallen, audit_coverage, audit_revoke, audit_withdraw_text, audit_terminal_receipt, audit_close. Only the owner can revoke, read records and close a run.

The kernel

sbgk audit-serve

Cuts the work into tasks, leases them, checks every line an agent submits, keeps the journal and finds what a revocation touches. It calls no model: the models are on the agents’ side.

Also in the code, experimental and off by default: a graph builder with a role of its own (builder). It is not part of the default v0.1 profile, and this page does not rely on it.

The life of a task

Seen from one agent.

  1. The kernel cuts the work into tasks

    The corpus is divided into tasks, for example “read this byte range of this document”. A task comes with a directive: what to read, the questions, what is already recorded.

  2. One agent leases a task

    The agent calls audit_acquire and the task is leased to it alone, to no other agent while the lease lasts. If the lease runs out, the kernel takes the task back and gives it to another agent. An agent can also renew or release its lease (audit_renew, audit_release).

  3. The agent answers with records

    It reads the section it was handed and answers with JSON lines: observe (an exact quote), claim (with based_on), relation, hypothesis, question, done. It sends the text of a quote, not offsets.

  4. The kernel checks every line

    With audit_submit every line is checked before it is recorded: a quote must occur byte for byte in the section leased to that agent, otherwise it is refused and nothing of it is stored; a claim may rest only on live records; ids and sizes are bounded.

  5. What passes is written down

    Each accepted transaction becomes one frame of the journal, with a receipt for each record. A retry with the same submission id returns the original receipt instead of committing twice. When the run is complete, the owner closes it (audit_close) and agents that ask for work receive DONE.

Watch a recorded run, frame by frame, on the Inspector page

Inside the kernel

The audit layer

Tasks and leases, the checks of records, grounds and the cascade of a revocation. It answers MCP-style JSON-RPC 2.0 (initialize, tools/list, tools/call) over TCP, and the token’s role decides which tools an agent sees. The audit server listens on loopback by default and has no TLS; for other machines use a secure tunnel or a TLS proxy, and keep agent tokens secret. sbgk mcp-bridge lets a client that starts its servers as stdio child processes, such as Claude Code, join, and keeps the token out of the model’s prompt.

The engine underneath

It binds evidence to exact byte spans of a document version cut into content-defined chunks, keeps facts and rule derivations, withdraws conclusions whose evidence is revoked while re-deriving those that have another valid derivation, and stores the state as a .sbgk container with a hash-chained log and a Merkle root. In the audit server above it, a claim cannot rest on another claim and every quote in a claim’s based_on is required: if any one of its quotes is withdrawn, that claim record loses its support, while separate records grounded on other quotes stay standing.

The journal

Everything accepted goes into one append-only journal. A frame has a version, a sequence number, the hash of the previous frame and a payload in canonical JSON. The first frame holds the snapshot of the starting state, together with the texts of the documents. The terms below define each of these words.

The terms, one by one

DeterministicSo anyone can rerun the check and get the same answer, without trusting a model.

Deterministic here means that the kernel’s answers follow from its inputs and that a journal replays to the same roots. Two runs of a team still differ, in their timestamps and in what their models write.

Exact quoteSo a conclusion can only lean on words that are really in the source.

Text whose bytes occur, byte for byte, in the section of the document leased to the agent. The agent sends the text, the kernel finds the bytes. Nothing is normalized: a curly quote instead of a straight one, a no-break space, any changed byte fails the same way.

Document pin

The identity of a source document: repository, commit, path and the SHA-256 of its raw bytes, or, for your own files, the path in a folder and the SHA-256 of its bytes. A --docs run fixes its files when it starts; a file that changes means a new run.

Chunk

A piece of a document version cut by its content rather than at fixed sizes (content-defined chunking). The engine binds evidence to exact byte spans inside such a version.

Snapshot

The engine’s state at one moment as a .sbgk container: documents cut into chunks, facts, derivations, a hash-chained log and a Merkle root. Three things are kept apart: a pin is the identity of one document, an exact quote is a statement about bytes inside a document, a snapshot is a state at a moment. The first frame of a run’s journal stores the snapshot of the starting state, together with the texts of the documents.

Grounds (based_on)So you can see what each conclusion rests on, and what falls when a source is withdrawn.

The quotes a claim names. Every one of them is required: a claim is grounded only while all of them stand.

JournalSo changes to the history show up when it is checked, and anyone can replay it.

The append-only record of a run. Each accepted transaction is one frame: canonical JSON (RFC 8785), linked by SHA-256 to the previous frame, written and synced before the new state is published. A hash-chained log is an old, well-known construction (Git history and Certificate Transparency logs use it); here it is applied to the evidence of AI agent teams.

Canonical form

One agreed way to write the same data, so that equal data are equal bytes (RFC 8785 for JSON). The reader of the journal accepts only that form: extra whitespace, another order of keys or a duplicate field is refused, not normalized.

Roots

audit_root and engine_root: a hash that stands for the whole state at one point of the journal, the first for the records, sources, ontology, links, receipts and checkpoints, the second for the engine. A root is a fingerprint of a state, not a snapshot of it. wal_head is the hash of the last frame: it commits the order of the whole journal.

ReceiptSo you can check a journal later against a value you kept elsewhere.

A receipt for each accepted submission, and at the end of a run a terminal receipt that names the roots and the chain head of the finished run. Keep it where the journal’s writer cannot change it.

Signed checkpointSo a journal can be checked against something kept outside it.

The server writes a checkpoint of the journal from time to time: the number of frames so far, the roots of the state, and the hashes of what stands and what rests on what. A server started with a signing key signs it (C2SP signed note, Ed25519); sbgk audit-verify --checkpoint checks the signature and that the checkpoint names this journal’s frames. A signature proves only that the holder of the key said so: a key file next to the journal does not protect against the operator.

QuittanceSo one conclusion can be checked on its own, without the journal.

One file that sbgk audit-proof cuts from a journal: a record and everything it rests on, down to its quotes, under a signed checkpoint. sbgk audit-proof-verify checks it alone, with no journal and no model. It shows that the record and what it rests on were in the journal at that checkpoint, not that they stand now.

Replay

Reopening a journal runs its frames again and checks that the result is the same roots. A stopped run replays to the same roots.

Lease and directive

A lease is the right of one agent to work on one task for a time; a lease that runs out is taken back. A directive is the instruction that comes with a task.

Revocation with cascadeSo when a source is withdrawn you see which conclusions to re-check, not everything.

The owner closes bytes of a document (audit_revoke, audit_withdraw_text). Every record that required them loses its support, the others stay, and history is not rewritten. Since 0.1.6 a withdrawal closes the bytes, so a quote that overlaps them is refused later too; since 0.1.7 the kernel’s request for a repair names what fell. Shown step by step on the Inspector page.

You are the kernel

A model of the rules, not the kernel. The kernel does not run in your browser: the real checks are in a recorded run of the real kernel and in sbgk audit-verify.

The same scenes as a list

Without JavaScript the game is shown as a list: for each scene, the part, the right decision and the answer of the real kernel.

Level 1

  1. The quote with one changed byte

    reader-1 hands in a quote. Does it occur in the document, byte for byte?

    • Quote: The initialization phase **MUST** be the forst interaction between client and server.

    Right decision: Refuse

    The real answer: REPAIR_REQUIRED · QUOTE_NOT_FOUND_IN_BYTES: quote has no byte-exact occurrence · Records stored: 0

  2. Two exact quotes and a claim on each

    The readers bring parts one at a time. Build the snapshot as the recorded run did: accept the quotes, then register the grounds each claim names.

    1. Quote 1: compare it with the document byte for byte, then accept or refuse.

      • Quote 1: The initialization phase **MUST** be the first interaction between client and server.

      Right decision: Accept

      The real answer: COMMITTED · t1_o1 → @2100c44776db5bb2

    2. Quote 2: compare it with the document, then accept or refuse.

      • Quote 2: The client **MUST** initiate this phase by sending an `initialize` request containing:

      Right decision: Accept

      The real answer: COMMITTED · t1_o2 → @c8c8ccea139fff44

    3. Claim 1 names its grounds: based_on Quote 1. Press the claim, then press the quote in the cube that it names.

      • Claim 1: Initialization must be the first client-server interaction. · Grounds (based_on): Quote 1

      Right decision: rests on Quote 1

      The real answer: COMMITTED · t1_c1 → @22308d5ced9c0afc · based_on: @2100c44776db5bb2

    4. Claim 2 names its grounds: based_on Quote 2. Press the claim, then press the quote in the cube that it names.

      • Claim 2: The client starts initialization with an initialize request. · Grounds (based_on): Quote 2

      Right decision: rests on Quote 2

      The real answer: COMMITTED · t1_c2 → @0c5f4921318d1e9c · based_on: @c8c8ccea139fff44

  3. The owner revokes the first quote

    The quotes and claims of the recorded run are in the journal. The owner now revokes quote 1.

    • Quote 1: The initialization phase **MUST** be the first interaction between client and server.
    • Claim 1: Initialization must be the first client-server interaction.
    • Quote 2: The client **MUST** initiate this phase by sending an `initialize` request containing:
    • Claim 2: The client starts initialization with an initialize request.

    Right decision: Quote 1 (revoked), Claim 1 (loses support)

    The real answer: REVOKED · claim 1: grounded false · claim 2: grounded true

  4. The journal copy with one letter changed

    Someone changed one letter of a claim in a copy of the journal: “must” became “Must”. It is still valid JSON. Do you open it?

    • Initialization must be the first client-server interaction. → Initialization Must be the first client-server interaction.

    Right decision: Refuse to open

    The real answer: BAD_FIELD: audit WAL frame 5: hash mismatch · sbgk audit-verify: REFUSED, exit 1

This is what the kernel does with every part an agent sends. It compares a quote with the document byte for byte and refuses one that is not there: an exact quote or nothing. A claim stands only while every quote it names as its grounds stands, so revoking a source takes down the claims grounded on it and leaves the others. And a journal with one letter changed is refused, because each frame of the journal carries a hash of its own content and of the frame before it: the hash chain. The real kernel does all of this by rules, without asking a model.

Level 2

  1. A quote from outside the issued range

    reader-1 was handed one range of the page, not all of it. The quote below is a real sentence of that page. Is it inside the range?

    • Quote: Implementations **SHOULD** be prepared to handle these error cases:
    • Issued to the agent: bytes 0 to 5932
    • The quote starts at byte 6098 of 6663

    Right decision: Refuse

    The real answer: REPAIR_REQUIRED · BAD_FIELD: quote is outside the issued byte ranges · Records stored: 0

  2. A claim resting on a quote that was never stored

    Earlier, the quote of reader-1 with the changed byte was refused, so nothing was stored under t1_o1. Now the reader hands in a claim whose grounds name t1_o1.

    • Claim: Initialization must be the first client-server interaction.
    • Grounds (based_on): t1_o1
    • This record was never stored: its line was refused.

    Right decision: Refuse

    The real answer: REPAIR_REQUIRED · UNKNOWN_LOCAL_ID: expected an issued local id or @hash · Records stored: 0

  3. Stop the server and start it again

    The server is stopped and started again on the same journal. The receipt was saved before the stop. Compare the value after the restart with the value from the receipt.

    • Value from the receipt (audit_root): 30aff21361ebed46be969841d43d42063b58789fec8525d93f5fd9509b9d7a2a
    • Value after the restart (audit_root): 30aff21361ebed46be969841d43d42063b58789fec8525d93f5fd9509b9d7a2a

    Right decision: Same state

    The real answer: resumed: true · audit_root: 30aff213…9b9d7a2a = 30aff213…9b9d7a2a

  4. The journal with its tail cut off

    A copy of the journal has lost its last frame. It is checked twice with sbgk audit-verify: first without a receipt, then with a receipt kept outside the journal.

    1. Without a receipt: what does the check say?

      • A copy of the journal: 12 frames, the last one cut off
      • The check: sbgk audit-verify --wal <journal>

      Right decision: It says: whole

      The real answer: status: VERIFIED · exit 0 · entries: 12

    2. With a receipt kept outside the journal: what does the check say?

      • A copy of the journal: 12 frames, the last one cut off
      • Receipt kept outside the journal: wal_head 6db85444…88d6c627
      • The receipt holds the state after 13 entries
      • The check: sbgk audit-verify --wal <journal> --expect <receipt> --at-end

      Right decision: It shows the cut

      The real answer: status: MISMATCH · exit 1 · found_after_entries: null

What the journal is not

Tamper-evident, not tamper-proof: a party that can rewrite the whole journal can rewrite its hash chain, so keep the receipt where the journal’s writer cannot change it. sbgk audit-verify --expect receipt.json --at-end finds a cut tail. A server started with a signing key signs its checkpoints, but a signature proves only that the holder of the key said so: a key file next to the journal, or a checkpoint kept in the operator’s own repository, does not protect against the operator. An anchor out of the writer’s reach does, and there is no third-party witness service in this version.

Three ways to use it

On its own

Run sbgk audit-serve on your corpus, a folder of text files or a manifest of sources pinned by commit and SHA-256, and let your agents call its MCP tools, each with its own token, from any language or through the Python client.

With a team you run

The benchmark runner (benchmarks/run_pilot_ac.py) drives a team of readers and a checker through the kernel, and runs the same team without it for comparison.

Next to the tools you use

An MCP client joins as one agent through the bridge. For one agent on a folder, yuce mcp is one entry in the client’s configuration. The Python client calls the same tools from code, and an orchestrator calls the same MCP tools from its own steps. What does not exist yet is a dedicated adapter for an orchestrator such as Temporal or LangGraph.

Source: README.md, LIMITATIONS.md, SECURITY.md