Docs
Get startedClaiming and the sandbox
View as Markdown(opens in a new tab)

Claiming and the sandbox

mirio init needs no account, so an agent can go from a prompt to a tested form on localhost without a human. The trade-off is that anonymous projects must not collect real people's data. Unclaimed projects therefore run in a sandbox.

Sandbox rules

  • Submissions are accepted only from localhost origins (localhost, 127.0.0.1, *.localhost, any port). A public origin gets HTTP 403 with code project_unclaimed and the claim link in the hint.
  • Requests made with the project's secret key (the CLI, server code) are accepted without an origin check, because they are the owner's own test traffic. A deploy key isn't: it only registers forms.
  • Sandbox data expires after 72 hours. Read it with mirio submissions.
  • No emails or webhooks are sent from a sandbox project.
  • mirio status and mirio push warn; mirio check fails. The framework plugin (and mirio sync) fails only a production build; preview, pull-request and local builds warn.

Claiming

The claim link looks like https://trymirio.com/claim/<token>. A human opens it, signs in with Google, GitHub or a code sent to their email, picks or creates a workspace, accepts the terms, and enters the production domains (one per line; example.com, https://app.example.com, or *.example.com). The project becomes live and starts accepting submissions from those origins. The secret key does not change.

Claiming gives every live form an identified owner who has accepted the terms, which matters under GDPR and for abuse response.

Content Security Policy

Sites with a CSP must list the API in connect-src: https://api.trymirio.com in production and your local API URL in development. Without it the browser refuses the request before it reaches Mirio.

Connecting a site created in the dashboard

A site can also start in the dashboard (sign up at trymirio.com/signup): New form creates the site (already yours, no claim step) and a draft form. The draft's page has Copy prompt: it holds a one-time setup command for the coding agent,

npx @trymirio/mirio init --link mil_XXXXX-XXXXX-XXXXX-XXXXX

which writes mirio.json and .mirio/secret for that site and lists the drafts waiting for their files. The agent then writes mirio/forms/<slug>.ts; the first registration turns the draft into a live form and keeps the notifications and triage settings you already set up. Codes work once and expire after 24 hours; copy the prompt again for a new one. To move a site to another repo, open the site under Sites, choose New key next to its secret key, then Command for the repo (the old repo's key stops working when the command runs).

The secret key in another checkout

.mirio/secret is gitignored, so it exists only in the checkout where init (or init --link) ran. A git worktree or a fresh clone of the same repo has mirio.json but no key, so it can't register forms. Copy .mirio/secret into it, or set MIRIO_SECRET_KEY there (npx @trymirio/mirio env print --secret in the first checkout shows the key). A link code doesn't connect a second checkout: "Connect a repo" works only while the site has no key, and New key replaces the key everywhere. See the CLI.

Deploy keys

A site has two kinds of key:

  • The secret key (sk_…), in .mirio/secret. The CLI and coding agents in the repo use it, and it can do everything for the site: register forms, read responses, change destinations and settings, and send responses from a server. Only its hash is stored, so Mirio can't show it again.
  • Deploy keys (dk_…), for a host's build settings. A deploy key can only register forms (GET /v1/project and PUT /v1/project/forms/{slug}), which is all a build does. It can't read responses, change anything else, send responses or make other keys; those requests get 403 forbidden. Its pushes don't import the old settings.review or settings.notifyEmails from a schema file either (triage and notifications live in Mirio). Don't give a host the secret key.

Both go in MIRIO_SECRET_KEY, so the framework plugin and mirio sync work the same with either. To make a deploy key:

  • npx @trymirio/mirio env vercel (or netlify) makes one and adds it to the host; npx @trymirio/mirio env print makes one and prints it. They need the secret key, so run them in the checkout where init ran.
  • Or, on the site's page under Sites, New deploy key: name it after where it goes (Vercel, GitHub Actions), and copy the name and value into the host's environment variables, for production and preview builds. It's shown once.

Make one per host or project, so you can revoke one alone. The site's page lists them with when each was last used; Revoke stops builds using it from registering forms at once (your forms keep working with the questions registered last).

New key next to the secret key replaces the secret key, for owners: either as a one-time command for the repo (the key changes when an agent runs it and lands in .mirio/secret without copying), or shown once on the page (it changes then). The old key stops working everywhere it's set; deploy keys keep working. Keys made before 2026-11-06 start sk_test_ or sk_live_, by the site's mode when the key was made; the label means nothing, and claiming never changes the key. New keys start sk_.

After claiming

  • Add more domains any time: npx @trymirio/mirio domains add acme.com (or the site's page under Sites in the dashboard); acme.com also covers www.acme.com, and the other way round. Domains belong to the site, not to a form. Localhost keeps working on a live site; those responses are stored as test.
  • The person who claims the site (or creates it in the dashboard) gets email notifications on every form, including forms added later, unless a form already has a destination when its file is first registered (a draft you connected to Slack first): then add their email to it yourself. mirio destinations add warns when that happens, and the draft's Delivery page says so. Add teammates to the workspace to notify them too (email goes to members only), or use Slack for shared channels.
  • mirio status shows live and mirio check passes.