HeadlinesBriefing favicon HeadlinesBriefing.com

Datasette launches sandboxed HTML app plugin

Hacker News •
×

On June 18, the maintainer of Datasette released datasette-apps, a plugin that lets developers embed self‑contained HTML/JavaScript tools inside a Datasette instance. The apps run in an <iframe> sandbox with a strict CSP, allowing read‑only SQL queries and, when configured, write operations via stored queries. A public demo is quickly available at agent.datasette.io after signing in with GitHub.

The sandbox uses sandbox="allow-scripts allow-forms" and injects a meta CSP that blocks external network calls, preventing exfiltration from sensitive databases. Communication back to the parent window relies on Message Channel(), which closes automatically if the iframe navigates away, adding a robust additional layer of defense beyond simple postMessage(). This design grew from an experiment with Claude Artifacts for Datasette Agent.

Write‑enabled apps use Datasette’s stored‑query feature, recently upgraded in Datasette 1.0a31, to whitelist specific insert or update statements. The plugin also exports a copy‑ready prompt that describes the target schema, enabling LLMs like Claude or Gemini to generate complete app code with a single paste. The result is a tightly controlled yet extensible way to efficiently build custom data‑driven interfaces.