Docs

Security, policies and audit

How access is decided, how to test it before you ship, and where every change is recorded.

Updated Oct 13, 2026

Every request to your project is decided on the server, in three layers. Nothing in a browser or an app can skip them.

LayerAnswersWhere
IdentityWho is calling: a signed-in user, an anonymous visitor, a server key or a team memberSessions and keys (Keys, tokens and credentials)
Access policiesMay this caller use this service and action: read a table, write a document, upload to a bucket, join a channel, run a functionPolicies, in Sovaria's policy language (Policy language (SPL))
Row-level securityWhich rows of a tablePostgres policies on each table (Row-level security and access)

#Project access policies

Policies are short rules managed under Policies. They cover tables, documents, storage, realtime channels and functions. Templates cover the common cases: owners only, signed-in read, staff write, own folder, own channel.

# Signed-in users may read the catalogue; only staff may change it
ALLOW IF ctx.actor.is_anonymous == False AND ctx.action == "SELECT"
ALLOW IF "STAFF" IN ctx.actor.roles

#Test before you ship

  • Simulation runs requests as different people against your policies without touching data, and shows which rule decided each one (Simulate access before you ship).
  • Rules tests keep those expectations in your repository and run them in CI (Access rules tests).
  • Security advisor flags tables without row-level security, public buckets and risky keys (Security advisor).
  • Test session on a user runs real queries as that user.

#Before you go to production

#What Sovaria does and what you do

SovariaYou
Checks every request against your policies and row-level security on the serverWrite the policies and rules that fit your app, and test them
Encrypts secrets at rest and never returns them after you save themKeep service keys out of apps and repositories; rotate them when people leave
Isolates projects: they never share data, users or keysGive each teammate the smallest role that works
Binds query values in the database, never splicing them into SQLAvoid building SQL strings from user input in your own functions
Records security events in the audit logRead alerts and review the log

#Audit log

Sign-ins, key and policy changes, deploys, migrations and admin actions are recorded. See them in Logs & Audit and export them; request and function logs can also stream to your own tools (Datadog, Loki and log drains).

sov logs api

Found a vulnerability? See Reporting a vulnerability.

#Coming from Firebase or Supabase?

PlatformWhat this is called there
FirebaseFirebase Security Rules
SupabaseSupabase RLS
SovariaSecurity, policies and audit

Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.