Simulate access before you ship
Check who can do what in your project — visitors, signed-in users, each app role and your team — across tables, documents, storage, realtime and functions, try one request step by step, without writing any data.
A simulation sends real requests through your project's gateway, identity checks and policies as each kind of caller, and records what happened at every step. Nothing is written: SQL writes run with every check and are then rolled back, and other writes stop right after their access checks.
#Who is simulated
| User type | Id in filters | What it stands for |
|---|---|---|
| Not signed in | __guest__ | A visitor using your anon key. |
| Signed-in user | __app_user__ | Any user of your app with no special role. |
| App role | app:<role> | A user with one of your app roles (for example app:librarian). |
| Team member | the role, e.g. developer | Someone on your Sovaria team, through the console or CLI. |
A run signs in as one real user of each app role that has users (with a token that lasts a minute and can't write), so an app role nobody holds yet can't be in a run. The console lists every app role from Authentication › Roles anyway: Who can do what names the roles with no users, and Try a request decides a request as any of them, as a visitor, as a signed-in user with no role, or as one real app user you pick (their id and roles).
App users and your team are checked separately. Your team's rules (for example the organization's "signed-in members may act") never answer for your app's users, and an app role named admin gives no console or team rights. To check one decision without a run, use sov policy simulate --action SELECT --resource orders (acts as a signed-in app user; add --as team for a team member) or POST /api/v1/policies/simulate, where each operation is an app user unless its context sets "actor": {"lane": "team"}.
Project settings that open doors are reviewed in the same run — for example open sign-up combined with rules that let any signed-in user change data.
#In the console
Open Simulation. It has seven tabs:
- Overview: the architecture map of your backend and the top problems. It is read from every part of the project, so it needs no run.
- Summary: the numbers — parts by status, problems by area, the latest run and the security drills.
- Try a request: one request decided step by step, as any of your app roles, a visitor, a signed-in user with no role or one app user, with a *What if…* rule change beside it (below).
- Access: the request flow (each user type through the gateway, identity and policy checks to every resource, with where a request stopped and how to fix it) and Who can do what, the matrix of a full run.
- Checks: every check on your configuration, worst first, plus Scenarios, Security drills and Limits (below).
- Integrations: each outside service your project uses, and what happens when it misbehaves.
- Runs: the issues a run found, what changed since the previous run, and the history (20 at a time; Show older runs loads more).
Each tab loads only what it shows. The counts in the bar come from one small summary; the map and checks load on Overview and Summary, the project's resources on Access and Try a request, and a run's results only where they are listed (Access and Runs), without each layer's check list: that loads for the one request you open. Answers carry an ETag, so going back to a tab you have seen costs a few bytes when nothing changed.
Try a request
Who is asking
Your app roles come first (from Authentication › Roles; the service role is a key, not a person, so it isn't listed), then Visitor (not signed in), Signed in, no app role and A specific app user…, found by email: the request then carries that user's id and roles, so rules that name the user or their own rows decide as they would for them.
On what, and what they do
Pick a table, collection, function, bucket or realtime channel of your project and the action: read, add, change or delete rows, read or write documents, call, download or upload, listen or send.
Decide it
Your live rules decide the request and every step is listed in order: who was asking, any organization limit, the DENY rules, the ALLOW rules, the default, and Postgres row-level security for tables. A rule in a step links to it in Policies.
What if…
Add a new rule, change a live rule (its current text is loaded for you to edit) or turn one off, then Compare: the same request is decided with your live rules and with the change, side by side, with one line saying whether the answer changes. Nothing is saved.
Each decision uses one simulation from this month's allowance (a comparison uses two), like Try before saving in Policies.
#The architecture map
The map shows how your backend fits together, left to right: who calls it (visitors, signed-in users, your mobile app, webhooks), the edge (gateway, domains, rate limits), sign-in (providers, hooks, SAML, SCIM), access rules, your data and functions (tables in every schema you created, not only public, collections, buckets, functions, channels), background jobs (cron jobs, queues, workflows, triggers, database webhooks), outside services (Stripe, email, SMS, push, log drains) and resilience (backups, point-in-time recovery, environments).
- A part's border is its status: red is breaking, amber needs a look, green is healthy, grey is not checked yet. It comes from the checks and from your latest run.
- Lines are how parts are wired: configured (a cron job runs a function), read from code (a function writes a table) or seen in traffic (thicker).
- A group of more than eight parts (for example a schema with 40 tables) is drawn as one box with its worst status; click it to expand. Only what needs a look hides the healthy parts.
- Click a part for its problems, what it is connected to and a link to its page in the console. On a phone the map is a list grouped by layer.
#Checks
Checks read your configuration and find what is wrong or at risk, each with what to do and a link to where. They are free and need no run. A few of them:
- Database: a schema app users can't reach (they get "permission denied"), a table app users can reach with row security off, a rule that allows every write, a view that skips row security, a foreign key with no index, a table with no primary key.
- Functions and jobs: a public HTTP function named like a webhook that doesn't check a signature, a secret the code reads that isn't set, a queue whose visibility timeout is shorter than its consumer's timeout (messages delivered twice), a cron job pointing at a function that no longer exists, dead letters.
- Sign-in and edge: sign-ups without a CAPTCHA or email confirmation, a wildcard redirect URL, any origin allowed, rate limiting off, an OAuth provider with no client secret, a SAML certificate about to expire.
- Plan: every allowance at 80% or more, and settings above what your plan allows (for example after a downgrade).
- Resilience: no recent backup, point-in-time recovery off on a plan that has it.


#Integrations: when an outside service misbehaves
Every connector your project uses — email (Sovaria's or your SMTP), SMS, push, sign-in providers, Stripe webhooks into your functions, database webhooks, Slack/Discord/Teams channels, log drains, AI, MCP servers, your KMS key, Vercel/Netlify, CAPTCHA and auth hooks — with its flows (sign-up confirmation, password reset, a row inserted…). Pick an outcome (works, slow, down, their rate limit, bad credentials, our limit, sent twice, forged, key revoked…) and see what your app, Sovaria and the outside service each do, and what your user ends up seeing. Try every outcome fills a table with all of them. Connectors you haven't set up show as *Not connected* with the modelled flow.
The answers are modelled from your settings: free, and nothing is built or sent. Run sealed runs the real code instead — your actual email template, SMS settings, webhook signature — up to the moment it would send, and shows the exact message that would have gone out (secrets as ••••). It still sends nothing and uses one single-request check from today's allowance.
#Scenarios
| Scenario | What you set | What it shows |
|---|---|---|
| Launch day | New users in the first hour | Whether your auth-email limit lets every confirmation out; fix: raise the limit or connect your own SMTP. |
| Botnet | How many bots | Low-and-slow password stuffing stays under per-IP limits; only CAPTCHA or the leaked-password check stops it. |
| Duplicate webhook | — | A provider retry runs your function twice unless it skips repeated event ids. |
| SMS provider outage | Outage length | Whether the function's retries outlast it, or messages end in dead letters. |
| New domain | The new site | Whether browsers on it are blocked by your allowed origins (CORS). |
Scenarios are worked out in your browser from your limits and connectors: no request is sent and nothing is used. Each fix opens the real setting.
#Security drills
Fourteen attacks judged from your real configuration: guessing a password, credential stuffing, bursting at a rate-limit edge, finding out who has an account, reading other users' rows, a forged admin token, SQL injection, reading your API from another site, an open redirect in a magic link, a forged payment webhook, reaching Sovaria's internal network, listing private files, one huge query, and SMS pumping. Each is stopped (and where), partly stopped or exposed, with why and a link to the setting that fixes it. Attacks Sovaria itself blocks are shown only as *blocked by platform protection*.
Readiness = (stopped + half of partly stopped) ÷ 14 × 100. The shield appears only at 100 with your saved settings. The *What if…* switches (CAPTCHA, refuse leaked passwords, hide whether an account exists) show what a change would do — changes there never save. Reading other users' rows uses your last full run; run one first for an exact answer.
#Limits
Every limit your project lives under in one list: sign-in, email and SMS rate limits (per IP, account, address or number), API rates, your plan's data budget, the largest file per bucket and allowed file types, each function's time, memory and call limits, realtime, the database pool and longest query, allowed origins and the shortest password. Change them where they live; this tab only reads them.
#Watching a run, step by step
Run sits in the bar at the bottom of the map. While the run is going, requests travel the map one at a time, in the order they are decided; the counter shows request / total with a red dot while it is live, and the map follows the moving request.
| Control | What it does |
|---|---|
| ‹ › | Move one hop at a time — gateway, identity, service, resource — and hold the request there with the checks that ran at that hop. |
| ▶ / ❚❚ | Play on from where you are, or pause. |
| Counter | Each request is a step and each hop a sub-step: 3.2 is request 3 at Identity. Type 3 or 3.2 and press Enter to jump. |
| Steps | Every request of the run; the current one expands to its hops. Pause on wrong results (on by default) stops the player on any request that got the opposite of what was expected, until you press ▶. |
| Live | Back to the newest request while a run is going. |
| Speed | 0.5× to 8×. |
Where a request stops
A request only lights the route it has actually travelled, and the rest of the map dims while it plays. When something refuses it — the gateway, identity or a rule in the service — it stops at that hop: a ✕ marks the spot, the callout says Refused here with the reason (for example DENY: no ALLOW rule matched) and which hops it never reached, and the route past it is drawn dashed, with the resource struck through. A refused request stays on screen a little longer than an allowed one, so you can read why.


| What you see at the last hop | Means |
|---|---|
| Refused here | Refused, as your rules intend (for example a guest reading another user’s orders). |
| Refused here — it should have been allowed | Refused, but the request was expected to work: a rule or setting is too strict. |
| Allowed — it should have been refused | Let through when it should not be: the callout shows the reason and a suggested fix. The player pauses here. |
When the run finishes, the findings stay in Issues; Details in the bar opens the full trace of the request on the map.


In Step by step, the same bar holds the user type, resource and action pickers with Simulate and Try everything, which sends each request that user type can make in turn. The i next to the view switch explains the colours.
#From the CLI and in CI
Sign in with sov login, pick the project, and run a simulation. --fail-on makes the command exit with status 1 when there are findings at that level or worse, so it can block a deploy.
sov sim run --fail-on criticalsov sim checks --fail-on critical # CI gate: exit 1 on a critical check
sov sim inventory --include rel,functions
sov sim map
sov sim limits
sov sim integrations --connector smtp --flow password_reset --outcome creds
sov sim integrations --connector smtp --flow magic_link --sealed # the exact email, still not sent
sov sim drills --fail-on exposed # CI gate: exit 1 on an exposed drill#Try a change before making it
sov sim change answers "what would this do?" for a policy or an SQL script. For a policy it lists who gains and who loses access; for SQL it runs the script with every check, rolls it back, and lists what it would add, drop or change — including tables that would be rewritten under a full lock.
sov sim change --policy-file draft.spl --name "staff edit books" --fail-on warningTry one rule, step by step
In Policies, the rule editor has Try before saving: pick who asks (one of your app roles, a visitor, a signed-in user with no role, or a specific app user), what they do and on which resource, and the same request is decided twice — by your live rules and with the rule you are editing in its place. Each answer comes with the steps that decided it, in order: who was asking, any organization limit, the DENY rules (a DENY rule that reads a field the request doesn't have denies — it fails closed), the ALLOW rules, the default, and Postgres row-level security for tables. Nothing is saved.
sov policy simulate --action DELETE --resource orders --explain \
--draft 'DENY IF ctx.action == "DELETE"' --replaces pol_123Every kind of request
Overview › Request security lists every kind of request your project answers — reading and writing rows, SQL, documents, files and signed file links, realtime and broadcast / presence, function calls and webhooks, flow webhooks and flow steps acting on your data, background runs (cron jobs, queues, event triggers), sign-in and your server — with every layer it passes in order. Explain step by step reads the layers out in plain sentences and says what they add up to. Scenarios also check who may test-run each flow; Flows checks access and then refuses to run anything under a simulation, so no flow runs, sends or writes.
#From code
Simulations act on the project's configuration, so call them as a team member (a console session or CLI token), not with an app user's session.
import { SovariaSDK } from '@sovaria/sdk'
const sovaria = new SovariaSDK({ baseUrl: process.env.SOVARIA_URL!, accessToken: process.env.SOVARIA_ACCESS_TOKEN! })
sovaria.setScope({ orgId: process.env.SOVARIA_ORG_ID!, projectId: process.env.SOVARIA_PROJECT_ID! })
// Discover once, then reuse it (kept for an hour): runs take only its manifest_id.
const { manifest_id } = await sovaria.simulate.discover()
const run = await sovaria.simulate.run({ manifest_id, filter: { resource: 'public.orders' } })
console.log(run.cases_total, 'checked,', run.cases_fail, 'wrong')
const preview = await sovaria.simulate.change({ kind: 'sql', sql: 'alter table orders add column note text' })#Reading the results
| Result | Meaning |
|---|---|
| Allowed | The request went through, as expected. |
| Denied (expected) | Refused, and that is what your rules intend. |
| Needs review | A rule allows it without a condition, or there is no rule and the default decided. |
| Wrong result | Allowed when it should be refused, or the other way round. Fix these first. |
| Intended | Your team marked this result as on purpose (green, counted as passing). |
Mark a result as intended
Some results are on purpose: visitors may read your product catalogue, or an internal table is meant to refuse everyone. Open the case and choose Mark as intended (add a note to say why). The case shows green on every run, counts as passing and leaves the findings; Undo puts it back. A mark covers one user type, action and resource, and only the result it names: if that table later refuses visitors, the case shows as usual again. Marking needs Change access policies (policies.write) and is in the audit log. From code: sovaria.simulate.markIntended({ role, action, resource, outcome }), or sov sim intended mark --role __guest__ --action sql:select --resource public.products --outcome ALLOW.
#Plans and what counts
| Free | Pro | Ultra | Team | Enterprise | |
|---|---|---|---|---|---|
| Real simulation runs per day | 2 | 50 | 150 | 400 | 2,000 |
| Policy simulations per month | 5 | 300 | 1,000 | 3,000 | 20,000 |
| Days simulation run history is kept | 30 days | 90 days | 90 days | 90 days | 90 days |
A real run uses one from today and one from this month: both or neither. The day resets at midnight UTC, the month with your billing period. A run that fails (stopped at the deadline, a service down) gives both back. The chip in the Simulation header shows what is left today; sov sim quota and GET /api/v1/sim/quota show both.
| Uses a real run | Free of charge |
|---|---|
A full run (sov sim run, Run in the console) | Discovery (limited to 20 a minute per organization) |
| A filtered run that covers more than 25 request types | Reading the summary, runs and one request of a run, comparing runs, the allowance, the plan explorer |
A change preview (sov sim change) | Anything worked out in your browser |
| Single-request checks (a filter covering at most 25 request types): one run from today per 5 checks, limited to 30 a minute |
One full run at a time per organization; a second gets 409 SIMULATION_RUN_IN_PROGRESS with the running run's id. A run is stopped after 10 minutes, and a project with more than 2,000 request types runs the first 2,000 (by user type, then resource, then action) and says so. See Plan limits for every limit.
#Sealed: nothing leaves Sovaria
A simulation runs your real code up to the moment something would leave Sovaria, and stops there. Emails, SMS, push notifications, auth hooks, database webhooks, Slack or Discord messages, log drains, calls your functions make to other APIs, AI model calls and your own KMS key are never sent or used: each one is recorded instead, with what would have gone out (the real template, signed body and headers), and the run answers as the provider would have. Secrets in a recording are replaced by •••• and recipients are masked (a***@example.com); message bodies are shown only to members with Project settings. Nothing is written either: SQL changes are rolled back, other writes stop after their access checks, outboxes get no rows, and a simulation never counts toward your API calls, emails, pushes, function invocations or compute. Simulated requests are marked in your logs and never reach your log drains. Read a run's recordings with GET /api/v1/sim/runs/{run_id}/artifacts.
One side effect remains, because Postgres doesn't roll it back: a simulated insert can use up id numbers from a sequence, so your next real row may skip a few ids. Nothing else changes.
#Who can simulate, and what they see
Starting discovery, runs and change previews needs the simulation.run permission (owners, admins and developers); reading runs needs simulation.read (viewers too). Results are trimmed to what you may read: without View access policies you see policy names but not their rules, without View app users no user ids or emails, and without Project settings only on/off settings. Run history never keeps rule text or user ids. Every run and every simulated sign-in is in the organization's audit log.
A simulated write never happens: SQL is rolled back, everything else stops after its access checks, realtime sockets are refused, and simulated requests don't count toward your project's request limits. Simulated inserts can use up id numbers (sequences advance even though the row is rolled back).
#Common mistakes
- Testing only as a signed-in user. Visitors (
__guest__) are where most leaks are — always include them. - Treating "Needs review" as fine. An unconditional rule is usually wider than intended.
- Running simulations after the deploy. Run
sov sim changeon the draft, andsov sim run --fail-on criticalin CI before deploying. - Reading a good drill score from a draft. The *What if…* switches never save; only your saved settings earn the shield. Change the real setting from the drill's fix link.
- Only testing integrations when they work. Try *Down* and *Bad credentials* for email and SMS before launch: that is what your users see the day a provider fails.
- Using sealed runs for everything. Modelled answers are free and usually enough; seal a flow when you need the exact message (each uses a single-request check).
#Coming from Firebase or Supabase?
| Platform | What this is called there |
|---|---|
| Firebase | Firebase Rules Playground |
| Sovaria | Simulate access before you ship |
Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.