Swift: Simulation
Check who can do what in your project without changing anything with the Swift SDK.
Check who can do what in your project without changing anything. Every call runs as the client's signed-in user, so your project's policies and row-level security apply. Types and members are listed in source order; each one links to its HTTP endpoint where it maps to one.
#Types and members
SovariaSimulation
Who can do what in the live project — as visitors, the app's users and the team — with nothing written (Echo's simulation API). Call it as a team member (a console or CLI session), not as an app user.
A full run uses one simulation from the plan's allowance and runs one at a time per organization (409 SIMULATION_RUN_IN_PROGRESS); a filter that covers at most 25 request types is a free single-request check. Only the manifest_id from discover() is sent, never manifest content.
public final class SovariaSimulation: @unchecked SendableSovariaSimulation.pollInterval
How often a background run is polled, and for how long (a run is stopped server-side after 10 minutes).
public var pollInterval: TimeIntervalSovariaSimulation.timeout
A property.
public var timeout: TimeIntervalSovariaSimulation.SovariaSimulation.init
Create an instance.
public init()SovariaSimulation.discover
What a run would test (user types, resources, rules), trimmed to what you may read; its manifest_id can be passed to run for an hour.
public func discover() async throws -> [String: Any]SovariaSimulation.run
Run the simulation.
public func run(manifestId: String? = nil, filter: [String: String]? = nil) async throws -> [String: Any]With a filter (resource, action, role — role is __guest__, __app_user__, app:<role> or a team role) the answer comes back at once; a full run starts in the background and is polled until it is complete (or throws when it failed).
SovariaSimulation.change
Try a change before making it; nothing is written.
public func change(_ payload: [String: Any]) async throws -> [String: Any]["kind": "policy", "policy": ["spl_source": …]] lists who gains and who loses access; ["kind": "sql", "sql": …] runs the script with every check and rolls it back.
SovariaSimulation.plan
Trace planned operations through every layer without sending them.
public func plan(_ payload: [String: Any]) async throws -> [String: Any]SovariaSimulation.listRuns
The project's runs, newest first (limit 1–100).
public func listRuns(limit: Int? = nil, offset: Int? = nil) async throws -> [String: Any]SovariaSimulation.quota
Real runs used and allowed today (UTC) and this month: ["day": [used, limit, resets_at], "month": …].
public func quota() async throws -> [String: Any]SovariaSimulation.listIntended
Outcomes the team marked as intended: ["intended": [[mark_id, role, action, resource, outcome, note, …]]].
public func listIntended() async throws -> [String: Any]SovariaSimulation.markIntended
Mark an outcome as intended (outcome "ALLOW" or "DENY"): matching cases show green on every run and leave the findings.
public func markIntended(role: String, action: String, resource: String, outcome: String, note: String? = nil) async throws -> [String: Any]Needs policies.write; marking the same role/action/resource again replaces it.
SovariaSimulation.unmarkIntended
Remove an intended-outcome mark; matching cases show as measured again.
public func unmarkIntended(_ markId: String) async throws -> [String: Any]SovariaSimulation.topology
Callers, gateway checks, sign-in, resources and connectors (platform defences as "Platform protection").
public func topology() async throws -> [String: Any]SovariaSimulation.limits
Every limit the project lives under, with its value and how it is counted.
public func limits() async throws -> [String: Any]SovariaSimulation.integrationRun
One integration flow under a programmed outcome: modelled (free, nothing sent) or sealed (real code path, recorded, one single-request check).
public func integrationRun(connectorId: String, flowId: String, outcome: String = "", mode: String = "") async throws -> [String: Any]SovariaSimulation.drillsRun
The 14 security drills judged from the project's configuration, with an optional what-if draft (never saved).
public func drillsRun(drillIds: [String]? = nil, overrides: [String: Any]? = nil) async throws -> [String: Any]SovariaSimulation.runArtifacts
What a run's sealed send points would have sent (secrets masked).
public func runArtifacts(_ runId: String) async throws -> [String: Any]SovariaSimulation.getRun
One run with every case's result.
public func getRun(_ runId: String) async throws -> [String: Any]SovariaSimulation.compareRuns
What changed between two runs: regressions, improvements, new failures.
public func compareRuns(_ targetRunId: String, baseline baselineRunId: String) async throws -> [String: Any]