Skip to content

Agent Runtime browser contract

The Agent Runtime loads a playable release as static browser assets inside an isolated iframe. The game owns rendering, input, rules, and game state. The runtime owns isolation, lifecycle events, asset delivery, and the VifuHub SDK bridge.

AreaRequirement
Entrymain.url points to an HTML file in build.output, usually index.html.
Build outputStatic browser files only; no server process runs for the game.
AssetsPrefer relative paths. Use hub.resources for declared data and media.
JavaScriptBundle executable code into the release; remote JavaScript is blocked.
NetworkUse the VifuHub SDK instead of calling arbitrary external APIs.
StorageBrowser storage is suitable for temporary state; use hub.gameState for durable state.
Host bridgeUse @vifu/hub, not raw window.parent.postMessage(...).

Games must tolerate iframe constraints: avoid top-level navigation, required popups, and direct parent-window access; render responsively; and pause or resume cleanly when visibility changes.

Uploaded game code runs in a strict sandbox. Browser sandboxing and CSP limit execution, while the service that owns each protected operation still enforces authorization.

Read the Deploy policy for artifact rules.