for agents/docs/llms.txtv0.2.75 · 9 Sep 2026

Home / Docs / Three surfaces

Three surfaces: which one are you building for?

Almost every question about “how do I show this” has three different right answers, because there are three places code runs in this estate — _page.json inside a vault, an HTML vault app inside a vault, and a page on a *.sgit.ai site outside every vault. They have different capabilities, different credentials and, most importantly, opposite trust directions. Pick the surface first; the rest of the guidance follows from it.

The short version. Publishing a document? _page.json or plain markdown, and write no code. Need to compute something over the vault's own data, for someone who already has the vault open? A vault app. Need it on the public web, indexed, linkable, with no key-holding required of the reader? A *.sgit.ai site page — and there you become the one who has to distrust the vault.

The three, side by side

_page.jsonHTML vault app*.sgit.ai site page
Where it runsThe vault browse viewA sandboxed frame inside the vault hostA normal public web page, any origin
Who reads the vaultThe hostThe host, answering window.sg callsYou do — a CORS GET plus Web Crypto
The credentialThe reader already opened the vaultSame — the app never holds a keyA published read key, printed in your page
What the reader needsThe vault link or keyThe vault link or keyNothing. It is a URL
Search engines and agentsInvisibleInvisibleIndexed, linkable, quotable
You writeJSONHTML, CSS, JS + app.jsonWhatever your site is built from
Trust directionHost renders your contentHost distrusts your app and sandboxes itYou distrust the vault and sandbox it
Ships whensgit pushsgit pushYour site's release

The last two rows are the ones people get wrong. Inside a vault host, the host is the one doing the protecting — it sandboxes the app, gates permissions and keeps the sovereignty rail. On your own site there is no host: you are the host, and vault bytes are untrusted input arriving in your origin.

The same job, on each surface

You want to…_page.jsonVault appSite page
Show a markdown documentNative — the markdown component, or just publish the .mdsg.vfs.readText, then renderFetch, decrypt, render — or write the prose as a page and keep a .md twin
Browse files and foldersNative — the host's tree is the browserBuild one from a build-time manifest; raw always availableSame, with the manifest read out of the vault
Show a deckslides or gallery componentsYour own viewer, or the vault's decks/v2 shellThe deck-viewer pattern — parse frame plus render frame
Show a PDFThe pdf componentsg.ui.previewDownload only. A sandboxed frame cannot render one
Compute over the dataNot possible — it is a layout formatYes, this is the reason apps existYes, in your own code
Be found by someone who has never heard of youNoNoYes — the only surface that does this

Where the guidance lives

SurfaceRead
_page.json and markdownPublishing content without code — the syntax. Markdown and file viewers: what not to build — the decision
HTML vault appsBuilding vault apps — the project shape and app.json. The window.sg bridge — the runtime and its permission model
*.sgit.ai site pagesReading a vault from a site page — the brief. Reading one file out of a vault — the primitive. Decks from a vault, on a site — a worked example
All threePublishing a vault: the method — read keys are publishable, vault keys never are, whichever surface you are on

They combine, and the combination is usually right

These are not alternatives to choose between once. The vaults on this site do all three at the same time, and that is the intended shape:

The AIUC-1 conformance vault is the clearest example — a fourteen-tab app inside the vault, and deck pages on this site reading the same files. One set of content; three ways in. What must never be duplicated is the content itself: if a paragraph exists in the vault and again in a site page, they will disagree, and the vault is the one that is right.

Every guidance page in this estate is labelled with the surface it applies to. If a page is not labelled, it applies to all three. All briefs · Docs · SG/Vault