The Snug Protocol · open spec · MIT

MCP connects agents to tools.
Snug connects agents to apps.

Describe a tiny app in chat and the agent writes it. It runs in a hard sandbox, thinks through the host agent at runtime, and lives — code, data, versions, chats — in one portable file you own.

the playground, real time — talk. build. run.

the runtime agent bridge

The app is a body.
The agent is its mind.

A Snug app doesn't bundle a model — it sends versioned JSON envelopes to whatever agent its host runs, and animates the reply. Here is a chess app asking the host agent for its move, verbatim.

Thirteen frame types, all published as JSON Schemas. Read the wire protocol →

why it's different

Three things no app platform gives you.

A runtime relationship, not codegen

Each app carries a compact runtime contract — what it is, what a good answer looks like — so its turns cost ~nothing and the same app runs well on a frontier model or a small local one. The agent plays chess with your app every move, forever.

One file. Yours.

Every app you build — code, versions, its own isolated database, its chats — lives in one portable .snug file (real SQLite, openable with ordinary tools, optionally sealed with a passphrase only you hold). Any hub, any LLM provider, sync where you choose. Leave whenever you like and take everything.

Secure by construction

Apps run in a hard sandbox with zero network of their own. Your credentials never enter the app, never reach the LLM, never reach a publisher — every connected request goes through a host executor inside a ceiling you approved and the host froze.

See how it works — six diagrams →

for implementors

Ship the app platform
your product was missing.

Your product already has an AI assistant. Snug makes it an app platform: users describe tiny apps in your chat, the assistant writes them, and they run in a hard sandbox against your agent — with their own storage, versioning, and a security model that has already been attacked in anger.

  • An open spec — thirteen frames, published JSON Schemas, MIT.
  • A production reference implementation — runner, SDK, portable user database, credential broker, all extracted from a shipped system.
  • A whitepaper that argues the design — threat model and security properties included, not implied.
// a Snug app is one HTML file; the SDK is the bridge
const { isReady, sendMessage } = useSnugApp({ appId: 'ember-chess', displayName: 'Ember Chess' });
const db = useAppDB();

// the host agent is the app's brain — one call
const reply = await sendMessage('opponent-move', { lastMove: 'e7e5' });

// per-app isolated storage in the user's own file
if (reply.ok) await db.exec('INSERT INTO moves (san) VALUES (?)', [reply.data.move]);

talk. build. run.

Software that's yours in the oldest sense: it sits with you, works for you, and fits in your pocket when you go.