Skip to content

Snug Protocol documentation

An open protocol for portable, agent-backed personal software.

Snug is an open protocol for small, user-built apps that think through their host’s AI agent at runtime. A Snug app is a sandboxed app — usually one HTML file — created through conversation. At runtime it exchanges versioned JSON envelopes with the host agent: the agent is the app’s mind, the app is a body.

The boundary that makes it a protocol rather than a product: the application and its accumulated state belong to the user — code, versions, data and chats in one portable .snug file — while the host supplies the intelligence. That is what lets the same app move between compatible hosts, change the model behind it, and run entirely on-device when paired with local inference.

Build an app

You mostly talk — the agent writes the app. Understand what it produces in Build your first app.

Implement the protocol

Host Snug apps in your own product or build a hub client from scratch: Implementor quickstart.

Read the spec

The complete 1.0 specification — wire protocol, portable user database, connected apps, runtime contracts — plus JSON Schemas for every frame.

Three actors, deliberately separated:

  • The user owns ONE portable SQLite file (.snug) holding every app, its data, its chats, and its settings. It runs from a browser (OPFS) or a desktop disk, syncs where the user chooses, and exports whole.
  • The hub client (a web app, a desktop shell, your product) renders apps in a hard sandbox and brokers every capability: agent turns, storage, network, navigation.
  • The LLM provider is whatever the user or host picks — the protocol is provider-neutral, and a well-built app runs on a frontier model or a small local one.

Security is architectural, not policy: app iframes get no network of their own, and credentials never enter the app, never reach the LLM, and never reach a publisher. The whitepaper argues the design; the spec makes it normative.