Skip to main content
A workspace is the tenant in OASM. Targets, assets, findings, jobs, workflows, projects, files, integrations and settings all belong to exactly one workspace, and nothing in the platform reads or writes across that boundary on a user’s behalf. This page explains how that boundary is enforced, from the HTTP request down to the database row. Managing members and permission groups from the console is covered in Members and Permissions.

Layers of the boundary

Isolation is not a single check. It is enforced at four layers, so a bug in one layer does not open the boundary on its own:

Identities

Three kinds of caller reach the core API, each over its own channel:
  • Users sign in to the console. Authentication is handled by better-auth: an httpOnly session cookie (SameSite=Lax, Secure behind https), with the database as the source of truth and a short-lived Redis cache in front of it. Revoking a session writes a revocation marker so the cache can never resurrect it.
  • MCP clients send the workspace API key in the x-oasm-api-key header. The key is accepted only on the MCP endpoint and maps the request to the key’s workspace. See API keys and MCP.
  • Workers never use a user session or the API key. They join with a single-use join key and then authenticate every gRPC call with their own worker token. See Worker and connector runtime.
Each user also has a platform role: user or admin. The role controls the administration area only; it does not grant access to anyone’s workspace data. Admin endpoints live under a separate /admin prefix, require the admin role, and additionally check the client IP against the admin IP allow-list when one is configured.

Sign-in protection

  • Rate limiting — 100 requests per minute per client IP and path, with much stricter budgets on sign-in, sign-up and password changes. Counters live in Redis, so every API replica shares the same budget.
  • Origin checks — cookie-carrying requests are accepted only from trusted origins (BASE_URL and TRUSTED_ORIGINS), which also form the CORS allow-list for the API and the storage buckets.
  • Gated sign-up — public sign-up is off by default. When it is on, new accounts wait for admin approval. See Authentication.

The workspace permission check

Every workspace-scoped route declares the permission it needs, in the form <resource>.<action>, for example asset.read, target.write or workspace.apikey. Before the handler runs, a guard:
  1. resolves the workspace from the route or the X-Workspace-Id header,
  2. loads the caller’s membership and the union of the permission keys of all their groups,
  3. passes the request only when the keys contain every required key (or the wildcard *).
Two rules keep the check predictable:
  • write implies read for the same resource. Nothing else is implied.
  • Non-members get 403, never 404, and an id that is not a UUID is a 400. The response never reveals whether a workspace exists.
The full list of keys is a fixed catalog; a permission group can only hold keys from it. See Permissions.

No privilege escalation

Permission groups are how access is delegated, so the platform makes sure delegation cannot grow access:
  • You can only grant permission keys — or assign groups — whose keys you already hold.
  • The built-in Admin group (holding *) is a system group: it cannot be edited, deleted or handed out by invitation.
  • You cannot change your own membership, the workspace owner’s, or that of any holder of a system group.
  • Invitations go only to existing accounts, and the response returns counts only, so it does not reveal which email addresses have accounts.
Some destructive operations — creating and deleting targets, managing internal networks — additionally require the caller to be the workspace owner, whatever their permission keys say.

Scoping inside the core API

The workspace id a service works with always comes from the permission check (or, for workers and agents, from their authenticated context). It is never taken from a request body. From there:
  • Tables that carry workspaceId filter on it directly (targets, projects, issues, workflows, files).
  • Tables that do not are scoped through their parent. Jobs, for example, are scoped through asset → target → workspace.
  • A lookup of another workspace’s id returns 404, so ids from one tenant are indistinguishable from ids that do not exist.
  • User data returned by the API is limited to id, name and image; email addresses and account fields are visible to platform admins only.
The Security Agent and the MCP endpoint go through the same services, so they inherit the same scoping. An agent tool runs with the workspace of the conversation, never a workspace the model names.

Scoping in the database

The attack surface tables — assets, services, HTTP responses and their TLS, technology, IP and status-code facets, DNS records, discovered URLs, tags and vulnerabilities — each carry their own workspaceId column. Three mechanisms keep it correct:
  • Composite foreign keys. A child references its parent by (parentId, workspaceId), and the parent is unique on (id, workspaceId). A service row whose workspace differs from its asset’s is rejected by Postgres.
  • Fill triggers. When a writer leaves the column empty, a BEFORE INSERT trigger copies it from the parent, so older code paths stay correct.
  • Row-level security. Queries from the Attack Surface Query engine run as a dedicated asq_reader role with the workspace set on the transaction. Row-level security policies on these tables then hide every row of other workspaces, even if a compiled query were wrong.

Scoping on the real-time stream

The console keeps one Server-Sent Events connection open (GET /events/stream) for live updates. Because any member can open it regardless of permissions, it follows two rules:
  • Allowlist. Only a small set of event families (notifications, workers, targets, workflows) reach browsers. Every other event on the event bridge stays server-side.
  • Ids only. A browser receives the event name, ids and time — never a payload. It then refetches through REST, which applies the permission check above.

Accountability

Membership, permission and configuration changes are recorded in the audit log. The audit table is append-only at the database level; see Secrets and encryption.

Secrets and encryption

How credentials are encrypted per workspace and released to workers

Permissions

Permission groups and the full list of permission keys

Data model

The tables the boundary protects

Attack Surface Query engine

How tenant scope is compiled into every query