Docs

CLI: Policies, rules tests, simulation, audit and compliance

Manage access policies, test who can do what with rules tests, run access simulations and change previews (with CI exit codes), read the audit trail, and download your organization's compliance evidence pack with sov.

Updated Nov 25, 2026

sov sim run --fail-on critical exits with status 1 when a run finds critical problems, so it can stop a CI pipeline. sov rules test checks a file of expectations (who may do what) and exits 1 when one fails; both run in the Sovaria GitHub Action (Tutorial: prove your table is private before you ship). Background: Simulate access before you ship.

sov sim run --fail-on critical
sov sim change --sql-file migrations/20261016_add_note.sql

#sov policy

Access policy commands

sov policy templates

List built-in SPL policy templates.

sov policy templates [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy list

List active policies in scope.

sov policy list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy get

Fetch a policy by ID.

sov policy get [OPTIONS] POLICY_ID

Arguments and options

POLICY_IDtextrequired
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy upsert

Create or update a policy (tries create then update).

sov policy upsert [OPTIONS] POLICY_ID

Policies apply to the project in scope (--project or sov scope set).

Arguments and options

POLICY_IDtextrequired
--nametextrequired
--spltextrequired
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy delete

Delete (deactivate) a policy.

sov policy delete [OPTIONS] POLICY_ID

Arguments and options

POLICY_IDtextrequired
--yes / -yflagoptional
Don't ask
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy history

List policy version history.

sov policy history [OPTIONS] POLICY_ID

Arguments and options

POLICY_IDtextrequired
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy rollback

Rollback policy to a historical version.

sov policy rollback [OPTIONS] POLICY_ID

Arguments and options

POLICY_IDtextrequired
--versionintegerrequired
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy evaluate

Evaluate policy against an explicit context.

sov policy evaluate [OPTIONS] POLICY_ID

Arguments and options

POLICY_IDtextrequired
--contexttextrequired
JSON object
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy check

Preflight an action/resource against the active access policies.

sov policy check [OPTIONS]

Arguments and options

--actiontextrequired
Action, e.g. sql:select or nosql:write
--resourcetextrequired
Resource name, table, or collection
--contexttextoptional
Optional JSON context object
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov policy simulate

Dry-run operations against the project's active access rules (nothing is changed).

sov policy simulate [OPTIONS]

Example: sov policy simulate --action PUBLISH --resource book:42 --context '{"actor": {"roles": ["librarian"]}, "realtime": {"prefix": "book"}}'

Try a rule before saving it: --draft 'DENY IF ctx.action == "DELETE"' [--replaces pol_123] --explain

The actor is one of your app's users unless you pass --as team: team members and app users are judged by different rules, exactly as their real requests are.

Arguments and options

--actiontextrequired
Action to test, e.g. PUBLISH, storage:upload, sql:insert (repeatable)
--resourcetextrequired
Resource for each --action: channel, bucket, table… (repeatable, same order)
--contexttextoptionaldefault {}
JSON context shared by every operation (actor roles, realtime prefix…)
--astextoptionaldefault app-user
Who asks: app-user (one of your app's users, the default) or team (a member of the project's team, who also gets the organization's baseline access)
--explainflagoptional
Show the steps that decided each operation, in order
--drafttextoptional
What-if: an unsaved SPL rule tried with the live ones (repeatable; nothing is saved)
--replacestextoptional
With --draft: the live rule id the draft stands in for
--withouttextoptional
What-if: leave this live rule id out (repeatable)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov rules

Test access rules: who can do what (CI-ready)

sov rules init

Write a starter rules test file to edit.

sov rules init [PATH]

Arguments and options

PATHpathoptional
Where to write the starter test file

sov rules test

Check every case against the project's rules; exit 1 if any case fails.

sov rules test [OPTIONS] [PATH]

Arguments and options

PATHpathoptional
YAML file of cases
--draftspathoptional
Folder of <policy id>.spl files to test in place of the live ones
--junitpathoptional
Write a JUnit XML report (for CI)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov sim

Scenario discovery, runs, and comparisons

sov sim discover

What a run would cover: personas, tables, collections, buckets, channels, functions, settings.

sov sim discover [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim quota

Real simulation runs left today (UTC) and this month.

sov sim quota [OPTIONS]

A full run uses one of each; narrow runs use one from the day per 5 checks; a failed run gives them back.

  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim limits

Every limit the project lives under: value, unit, what it is counted per and how.

sov sim limits [OPTIONS]

Free.

  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim integrations

What happens in one integration flow when the outside service answers a certain way.

sov sim integrations [OPTIONS]

Modelled by default (free, nothing sent); --sealed shows the exact message that would have gone out.

Arguments and options

--connectortextrequired
Connector id from the topology, e.g. smtp, sms, db_webhook:<id>
--flowtextrequired
Flow id, e.g. password_reset, row_inserted
--outcometextoptionaldefault ok
ok, slow, down, limit, creds, ours, dup, unsigned, revoked, approval, bot
--sealedflagoptional
Run the real code path (recorded, never sent; one single-request check)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim drills

Security drills judged from the project's configuration, with a readiness score.

sov sim drills [OPTIONS]

With --fail-on it is a CI gate: exposed fails on exposed drills, partial fails on partial or exposed ones.

Arguments and options

--onlytextoptional
Comma-separated drill ids (default all)
--sealedflagoptional
Ask for a sealed confirmation (answers modelled for now)
--fail-ontextoptional
Exit 1 when a drill is exposed (or partial and exposed)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim runs

List simulation runs for the current project.

sov sim runs [OPTIONS]

Arguments and options

--limitint rangeoptionaldefault 20
How many runs (1-100), newest first
--offsetint rangeoptionaldefault 0
Skip this many runs
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim get

Fetch one simulation run by ID.

sov sim get [OPTIONS] RUN_ID

Arguments and options

RUN_IDtextrequired
Simulation run ID
--expandflagoptional
Show nested run details
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim compare

Compare two simulation runs.

sov sim compare [OPTIONS] TARGET_RUN_ID BASELINE_RUN_ID

Arguments and options

TARGET_RUN_IDtextrequired
Run to inspect
BASELINE_RUN_IDtextrequired
Baseline run
--expandflagoptional
Show full comparison tree
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim checks

What is wrong or at risk in the project, worst first, each with a fix.

sov sim checks [OPTIONS]

Free: reads configuration, runs nothing.

Arguments and options

--severitytextoptional
critical, warning or info: that level and worse
--areatextoptional
database, functions, storage, auth, edge, plan, realtime, resilience, integrations, design
--fail-ontextoptionaldefault none
Exit 1 when a check is at or above this severity (critical, warning, info; none = never). For CI.
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim inventory

Everything the project has, read from every engine: every schema it created, collections, buckets, secret names, functions with schedules, queues, workflows and triggers, sign-in, webhooks, channels, limits, backups and more.

sov sim inventory [OPTIONS]

Arguments and options

--includetextoptional
Sections, comma-separated (rel, doc, storage, functions, auth, messaging, edge, data, policies, plan)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim map

The architecture map as text: each layer's parts with their status (the console draws it).

sov sim map [OPTIONS]

--json for the graph.

  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim run

Check who can do what in the live project — as visitors, your app's users and your team — with nothing written.

sov sim run [OPTIONS]

A full run uses one simulation from your plan's allowance and runs one at a time per organization. A narrow run (--resource/--action/--role matching at most 25 request types) doesn't use the allowance; a wider one is charged as a full run.

Arguments and options

--resourcetextoptional
Only this table, collection, bucket, channel or function
--actiontextoptional
Only this action, e.g. sql:delete
--roletextoptional
Only this persona: __guest__, __app_user__, app:<role> or a team role
--fail-ontextoptionaldefault critical
Exit 1 on findings at this level or worse: critical, warning, info, none
--manifest-idtextoptional
Reuse a discovery from sov sim discover (kept for an hour)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.
sov sim run --fail-on critical
sov sim run --resource public.orders --role __guest__

sov sim change

Try a policy or SQL change before making it: who gains or loses access, what the script changes.

sov sim change [OPTIONS]

Nothing is written.

Arguments and options

--policy-filetextoptional
SPL of a new or replacement rule
--nametextoptional
Name of the draft rule
--replacestextoptional
Live policy id the draft stands in for
--disabletextoptional
Live policy id to leave out (repeatable)
--sqltextoptional
SQL script to try
--sql-filetextoptional
File with the SQL script to try
--fail-ontextoptionaldefault critical
Exit 1 on violations at this level or worse
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.
sov sim change --policy-file draft.spl --name "staff edit books" --fail-on warning
sov sim change --sql "alter table orders add column note text"

sov sim intended list

Outcomes marked as intended in this project.

sov sim intended list [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim intended mark

Mark an outcome as intended (needs permission to change policies).

sov sim intended mark [OPTIONS]

Arguments and options

--roletextrequired
__guest__, __app_user__, app:<role> or a team role
--actiontextrequired
e.g. sql:select, doc:write, storage:download
--resourcetextrequired
e.g. public.products
--outcometextrequired
ALLOW or DENY: the result that is on purpose
--notetextoptional
Why (shown next to the case)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov sim intended unmark

Remove a mark; matching cases show as measured again.

sov sim intended unmark [OPTIONS] MARK_ID

Arguments and options

MARK_IDtextrequired
From sov sim intended list
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov simulate

Offline simulation from a project snapshot

sov simulate snapshot

Record the project's access surface for offline runs: tables, row policies, SQL functions and every case of the simulation matrix with the project's rules' verdict.

sov simulate snapshot [OPTIONS]

Counts against sim.snapshot_exports_month.

Arguments and options

--rowsflagoptional
Include sample rows (needs database read access; plan caps rows)
--out / -opathoptionaldefault .sovaria/sim/snapshot.json
Where to write the snapshot
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov simulate offline

Run the SQL part of the simulation matrix on a throwaway Postgres built from a snapshot — no live project, nothing sent anywhere.

sov simulate offline [OPTIONS]

With --migration, runs before and after and lists every access change.

Arguments and options

--snapshot / -spathoptionaldefault .sovaria/sim/snapshot.json
Snapshot from sov simulate snapshot
--migration / -mpathoptional
SQL file(s) to apply; reports what changes
--pg-urltextoptional
Use this Postgres (a scratch database is created) instead of a Docker container
--imagetextoptionaldefault postgres:16-alpine
Docker image for the throwaway database
--fail-ontextoptionaldefault none
Exit 1 on: deviation, change, any (deviation or change), none
--jsonflagoptional
Print the full report as JSON
--verbose / -vflagoptional
List every SQL case

#sov audit

Audit trail and simulations

sov audit append

Append an immutable audit entry.

sov audit append [OPTIONS]

Arguments and options

--event-typetextrequired
--actor-idtextrequired
--sourcetextrequired
--actiontextrequired
--resource-idtextoptional
--metadatatextoptional
JSON object
--ip-addresstextoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov audit list

Query audit log entries.

sov audit list [OPTIONS]

Arguments and options

--actor-idtextoptional
--event-typetextoptional
--sourcetextoptional
--resource-idtextoptional
--limitintegeroptionaldefault 50
--offsetintegeroptionaldefault 0
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov audit verify

Verify audit hash-chain integrity.

sov audit verify [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov audit count

Return audit log entry count.

sov audit count [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov audit sim-run

Run a phantom simulation.

sov audit sim-run [OPTIONS] SIMULATION_NAME OPERATIONS

Arguments and options

SIMULATION_NAMEtextrequired
OPERATIONStextrequired
JSON array operations
--contexttextoptional
JSON object
--include-execution-treeflagoptional
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov audit sim-plan

Preview a simulation plan.

sov audit sim-plan [OPTIONS] SIMULATION_NAME OPERATIONS

Arguments and options

SIMULATION_NAMEtextrequired
OPERATIONStextrequired
JSON array operations
--contexttextoptional
JSON object
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

#sov compliance

Compliance center: your organization's evidence pack for audits

sov compliance status

What the evidence pack shows now: audit log, own key, regions, backups, PITR, Security Advisor, access.

sov compliance status [OPTIONS]
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov compliance export

Download the evidence pack (ZIP) and check every file against its MANIFEST.json SHA-256.

sov compliance export [OPTIONS]

Arguments and options

--output / -opathoptional
Where to write the ZIP (default: the server's file name)
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.
sov compliance status
sov compliance export -o acme-evidence.zip          # whole organization
sov compliance export --project <project-id>       # one project

sov compliance hipaa

HIPAA status (Enterprise): HIPAA mode (BAA signed), session limits, retention and PHI projects.

sov compliance hipaa [OPTIONS]

With --report, download the safeguards report: each HIPAA Security Rule technical safeguard judged from live data (counts toward the plan's packs per day; audited). Evidence for your own risk analysis, not a certification. Plans without HIPAA get PLAN_FEATURE_REQUIRED: HIPAA comes with Enterprise and a signed BAA.

Arguments and options

--reportflagoptional
Download the HIPAA safeguards report (ZIP) instead
--output / -opathoptional
Where to write the report ZIP
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.

sov compliance audit-log

Export the organization's tamper-evident audit log (within the plan's retention).

sov compliance audit-log [OPTIONS]

Each export is itself written to the log. Check the chain with sov audit verify.

Arguments and options

--formattextoptionaldefault csv
csv or json
--sincetextoptional
From (ISO 8601)
--untiltextoptional
To (ISO 8601)
--phi-onlyflagoptional
Only requests to projects marked as holding PHI
--staff-access-onlyflagoptional
Only Sovaria staff access under a support grant
--output / -opathoptional
Where to write the file
  • Also takes --profile, --org, --project and --env to act on another account, organization, project or environment.