# Sypnia Data documentation > Sypnia Data is an open-source Postgres backend: sign-in, tables, an API and SQL, ready for people and for AI agents. It runs on any Postgres, and you write your app with the ORM you want: plain SQL, Prisma, Drizzle, or Sypnorm with Sypnia Cases. Sypnia comes two ways, and every page says which one it is about: - **Sypnia Data engine** (open source, on any postgres): Ingest, storage, aggregation, problem grouping, sessions, replay data and uptime checks. You read it through: The HTTP API, the MCP server, the CLI and the Console: one built-in page with the problems list and the session replay viewer. - **Sypnia Cloud** (hosted by us, with a free tier): The same engine, run by us. You read it through: The full app: replay player, performance, uptime, daily summary, search and teams. Every page is also plain Markdown: add `.md` to its address (`https://data.docs.sypnia.com/start/open-source-and-cloud.md`). All pages in one file: https://data.docs.sypnia.com/llms-full.txt ## Start here What Sypnia Data is, how it works, what is open source and what is Sypnia Cloud, and the quickstarts. - [Start here: overview](https://data.docs.sypnia.com/start.md): Section index for Sypnia Data: an open-source Postgres backend (auth, Data API, SQL, row-level security, MCP; any ORM) that runs on any Postgres 14+, self-hosted or in Sypnia Cloud. Read what-it-is, how-it-works, open-source-and-cloud, then a quickstart; how-sypnia-uses-it shows Sypnia's own accounts and Telemetry on Data. [Engine, Cloud] - [What Sypnia Data is](https://data.docs.sypnia.com/start/what-it-is.md): Read this to understand what Sypnia Data offers: auth (e-mail, passwords, magic links, Google/GitHub, sessions with configurable lifetime including never), machine auth (OAuth client credentials, DPoP, device flow, PATs, API keys, MCP), the Data API (PostgREST-compatible REST over your schema), SQL and migrations, row-level security and @sypnia/data (client SDK), with any ORM (Sypnorm, the use-case ORM, comes with Sypnia Cases). Runs on any Postgres 14+. [Engine, Cloud] - [How it works](https://data.docs.sypnia.com/start/how-it-works.md): Read this for the end-to-end flow: the app calls https://.data.sypnia.com with a publishable key; sign-up creates a user and sends a confirmation e-mail; verifying the link returns an access token (EdDSA JWT) and a refresh token; every Data API request runs in one Postgres transaction with SET LOCAL ROLE and request.jwt.claims so row-level security applies; machines use OAuth tokens the same way. [Engine, Cloud] - [Open source and Sypnia Cloud](https://data.docs.sypnia.com/start/open-source-and-cloud.md): Comparison of the Sypnia Data engine (AGPL-3.0; @sypnia/data MIT; self-hosted, any Postgres) and Sypnia Cloud (hosted engine + console, managed databases, Sypnia Mail as an auth e-mail provider, accounts and organizations, plans). The engine and @sypnia/data are open source; the console and Cloud's control plane are not. [Engine, Cloud] - [Quickstart: Sypnia Cloud](https://data.docs.sypnia.com/start/quickstart-cloud.md): Ten-minute Sypnia Cloud quickstart: sign up at data.app.sypnia.com (e-mail first, then create a password), create an organization and a project (managed database), copy the publishable key, create a table with RLS in the SQL editor, install @sypnia/data, sign up a user and query their rows. [Cloud] - [Quickstart: self-host](https://data.docs.sypnia.com/start/quickstart-self-host.md): Self-host quickstart: clone the repository, cp .env.example .env with SYPNIA_DATA_MASTER_KEY (openssl rand -base64 32) and POSTGRES_PASSWORD, docker compose up -d (Postgres 16, the engine, Mailpit at http://localhost:8025; the schema installs on first start), keys with docker compose exec data sypnia-data keys api-key --kind publishable|secret, first request with curl to /auth/v1/settings. [Engine] - [Install with your coding agent](https://data.docs.sypnia.com/start/install-with-your-agent.md): For coding agents: in the app's folder run `npx @sypnia/data init --project ` (add --server for the backend's machine client, --cases for Sypnorm + Sypnia Cases, or --orm none|sql|prisma|drizzle, --yes to never ask). It signs in with the device flow (the person approves a code in the browser; DPoP-bound session in ~/.config/sypnia, mode 600), writes SYPNIA_URL and SYPNIA_PUBLISHABLE_KEY to .env.local, adds the MCP server https://mcp.data.sypnia.com to .mcp.json / .cursor/mcp.json, installs the sypnia-data skill into .claude/skills plus an AGENTS.md section, records choices in sypnia.toml (top-level project + [data] table), and pulls types. With --cases it also installs @sypnia/cases in the app with its package manager (npm, pnpm, yarn or bun; --no-install skips it), installs the sypnia-cases skill and writes src/use-cases/ for @sypnia/cases/sypnorm; `npx @sypnia/cases map --upload --project ` sends the map to the project's Use cases; for a Cases project the agent adds the Cases MCP server https://mcp.cases.sypnia.com and creates and links it with the Cases MCP tools create_project, link_data_project, upload_map. Idempotent. Never ask the user to paste a secret key, password or token into the conversation. [Engine, Cloud] - [How Sypnia uses it](https://data.docs.sypnia.com/start/how-sypnia-uses-it.md): Dogfooding: the Sypnia account of every product is a user of the Sypnia Data project `sypnia`, served at auth.sypnia.com, signing in with e-mail only (password or e-mail link; no Google or GitHub on Sypnia's own project, while customer projects can turn them on); after any sign-in it sets the HttpOnly refresh cookie __Secure-sypnia-rt on .sypnia.com and each product app (data.app, telemetry.app, git, …) refreshes silently with X-Sypnia-CSRF, keeps the access token in memory and verifies it with the JWKS of auth.sypnia.com; sign-out with scope=global ends it everywhere; each product keeps its own members table and a roll-in use case. Sypnia's own sign-in e-mails leave from sypnia.com through Sypnia Mail (the sypnia_mail provider), like any customer project that chooses it. Coding agents sign in with npx @sypnia/data login (device flow, DPoP, a session that never expires until revoked) and reach every project through https://mcp.data.sypnia.com. Telemetry, the pilot that uses every Sypnia product, keeps its web app's database in a Sypnia Data project of Sypnia's organization and writes its flows as use cases with Sypnorm (@sypnia/cases), linked to its Cases map; its people sign in with their Sypnia account; its spans carry sypnia.case. [Engine, Cloud] ## Auth Sign-up and sign-in for the people who use your app, with sessions you control and e-mails sent through the provider you choose. - [Auth: overview](https://data.docs.sypnia.com/auth.md): Section index for user auth in Sypnia Data: e-mail and passwords (sign-up with or without password, confirmation, recovery, magic link and 6-digit code, reauthentication), sessions and tokens (EdDSA access JWTs, rotating refresh tokens with reuse detection, session policies including never), Google and GitHub (SSO) with PKCE, e-mail providers and templates, auth users vs your product's own users, and the built-in protections. [Engine, Cloud] - [E-mail and passwords](https://data.docs.sypnia.com/auth/email-and-passwords.md): E-mail auth flows: signUp (password optional: 'e-mail first' sends a link that leads to create-your-password), confirmation required by default, signInWithPassword, signInWithOtp (one e-mail with a magic link and a 6-digit code), verifyOtp, resetPasswordForEmail (always 200), updateUser for password (recent sign-in or reauthentication nonce) and e-mail (confirmed on both addresses). Password policy: min length 10, optional character rules, breached-password check. Passwords hashed with argon2id. [Engine, Cloud] - [Sessions and tokens](https://data.docs.sypnia.com/auth/sessions-and-tokens.md): Sessions in Sypnia Data: access token = EdDSA (Ed25519) JWT, default TTL 3600 s (300–86400), claims iss/sub/aud/role/exp/iat/jti/session_id/aal/amr/email/app_metadata/user_metadata/client_id/scope/cnf.jkt; refresh token syp_rt_… opaque, stored as SHA-256, rotated on every use, reuse after the 10 s window revokes the whole session. Session policy per project: access_token_ttl, session_lifetime (or never), inactivity_timeout (or never), single_session. Logout scopes local/others/global; users list and revoke their sessions; JWKS at /.well-known/jwks.json with key rotation. [Engine, Cloud] - [SSO with Google and GitHub](https://data.docs.sypnia.com/auth/oauth-providers.md): Provider sign-in: Google (OpenID Connect) and GitHub (OAuth 2.0); signInWithOAuth({provider, redirectTo}) → GET /auth/v1/authorize with PKCE S256 → provider → /auth/v1/callback → app gets ?code= → exchangeCodeForSession (grant_type=pkce). Configure client id and secret per project; callback URL https://.data.sypnia.com/auth/v1/callback. Identities stored in sypnia_auth.identities; linking by verified e-mail only. [Engine, Cloud] - [E-mail providers and templates](https://data.docs.sypnia.com/auth/email-providers-and-templates.md): Auth e-mail delivery per project: Sypnia sends no e-mail of its own on behalf of projects (no default sender in Sypnia Cloud). Providers: smtp, resend, postmark, ses (your own credentials), sypnia_mail (Sypnia Mail, Sypnia Cloud: from on a domain verified in Sypnia Mail, paid with the organization's credits), none (provider sign-in only); self-hosted engines also have sypnia (the engine's own sender, SYPNIA_DATA_MAIL, allowed per project with SYPNIA_DATA_MAIL_DEFAULT_REFS). A project starts without a provider: mail_state provider_required, /auth/v1/settings email_ready false, and sign-up with confirmation, magic link, OTP, recovery, invite, e-mail change and reauthentication answer 409 email_provider_required before anything is written; Google/GitHub and password sign-up without confirmation work. mail_state: ready, provider_required, off, misconfigured. Errors on PATCH /auth/v1/admin/settings: 400 invalid_mail_provider, 422 provider_not_available (sypnia in Cloud), 400 mail_not_configured (no from). A failed send answers 202 email_queued_retry and is retried 3 times over about 10 minutes; bounced or complained addresses are suppressed. Templates per type (confirmation, invite, magic_link, recovery, email_change, reauthentication, password_changed, new_device) with subject/HTML/text and variables {{ .ConfirmationURL }}, {{ .Token }}, {{ .SiteURL }}, {{ .Email }}, {{ .ProjectName }}, {{ .Data.key }}; English and Spanish defaults chosen by user_metadata.locale; 400 invalid_template on save; preview and test send in the console. [Engine, Cloud] - [Users and your app's own data](https://data.docs.sypnia.com/auth/users-and-your-data.md): Pattern: sypnia_auth.users holds identity/session only (email, password hash, identities, metadata). Keep profiles, roles, plans and teams in your own tables keyed by user id (references sypnia_auth.users(id)). 'Roll-in': the first time a signed-in identity opens your app or a second product, create its row idempotently (insert … on conflict do nothing). Several apps on one domain can share a session with a refresh-token cookie on the parent domain and silent refresh; each app verifies access tokens with the project's JWKS. [Engine, Cloud] - [Built-in protections](https://data.docs.sypnia.com/auth/protections.md): Auth protections: rate limits kept in Postgres (sign-up 30/h/IP, OTP and recovery 5/h/e-mail and 30/h/IP, password sign-in 30 per 5 min per IP+e-mail with exponential lockout after 10 failures, refresh 1800/h/session, /oauth/token 600/min/client), CAPTCHA hook (Turnstile or hCaptcha), no user enumeration, audit log sypnia_auth.audit_log (IP stored as prefix + HMAC), refresh-token reuse detection, new-device e-mail (password sign-in from an unseen network), secret keys refused from browsers. [Engine, Cloud] ## Machines and agents How services, CLIs, MCP clients and AI agents sign in to a project with standard OAuth 2.0, and which credential to use when. - [Machines and agents: overview](https://data.docs.sypnia.com/machines.md): Section index for machine auth: OAuth 2.0 authorization server per project at /auth/v1/oauth (token, authorize, device_authorization, register, revoke, introspect) with metadata at /.well-known/oauth-authorization-server. Credentials: OAuth client with private_key_jwt (recommended) or secret, DPoP sender-constrained tokens, device flow for CLIs/agents, personal access tokens (syp_pat_, optional expiry), project API keys (publishable syp_pk_, secret syp_sk_), one MCP server for every project at https://mcp.data.sypnia.com (the token says the project). Pick: service → client credentials; CLI/agent acting for you → device flow; quick script → PAT; browser app → publishable key + user session; server with full access → secret key. Privileged scopes (sql:*, auth:admin, project:admin): machine clients from their registration; people only via app_metadata.scopes set by an admin, else 403 scope_not_allowed. [Engine, Cloud] - [Client credentials](https://data.docs.sypnia.com/machines/client-credentials.md): OAuth 2.0 client credentials in Sypnia Data: create an OAuth client (cli_…) with token_endpoint_auth_method private_key_jwt (public JWK registered, private key stays with the service) or client_secret_basic/post (syp_cs_… shown once, argon2id at rest). POST /auth/v1/oauth/token grant_type=client_credentials with client_assertion (RFC 7523: iss=sub=client_id, aud=token endpoint, exp ≤ 5 min, unique jti) and optional scope/resource (RFC 8707). Response: access_token (EdDSA JWT, default 15 min for clients), token_type Bearer or DPoP. Client database role default authenticated with sub=client_id; project:admin → service_role. [Engine, Cloud] - [DPoP, tokens bound to a key](https://data.docs.sypnia.com/machines/dpop.md): DPoP (RFC 9449) in Sypnia Data: the client sends a DPoP proof JWT (typ dpop+jwt, jwk header, htm, htu, iat, jti; ath on resource calls) to /oauth/token; the engine issues token_type DPoP with cnf.jkt (JWK thumbprint). Resource calls need Authorization: DPoP plus a fresh proof (iat within 60 s, jti single-use for 5 minutes). DPoP-Nonce supported. Per client: optional or required (dpop_bound_access_tokens). Refresh tokens of public clients are bound to the same key. [Engine, Cloud] - [The device flow, for CLIs and AI agents](https://data.docs.sypnia.com/machines/device-flow-and-agents.md): Device authorization grant (RFC 8628) for agents: `npx @sypnia/data login --project ` generates an Ed25519 key, POST /auth/v1/oauth/device_authorization, shows verification_uri + user_code; the user approves while signed in; the CLI polls /oauth/token with grant_type=urn:ietf:params:oauth:grant-type:device_code and a DPoP proof; receives DPoP-bound access + refresh tokens in an agent session whose policy is the client's (can be never). Stored in ~/.config/sypnia/credentials.json and agent-key.json, mode 600. Revoke in the console (Agents and devices), with `npx @sypnia/data logout`, or by deleting the key. Never paste keys into a chat. [Engine, Cloud] - [Personal access tokens and API keys](https://data.docs.sypnia.com/machines/tokens-and-api-keys.md): PATs: syp_pat_ + 40 base62 + 6-char checksum (secret-scanning friendly), stored as SHA-256 + last 4, owner user, scopes, optional resource, expires_at nullable (never), shown once, used as Authorization: Bearer; acts as its user limited by scopes. Project API keys: publishable syp_pk__… (browser-safe, role anon) and secret syp_sk__… (server only, role service_role, bypasses RLS, several per project, hashed, revocable); sent as apikey header or Authorization: Bearer; secret keys from a browser (Origin header) are refused. Protected keys: protected true, DELETE answers 409 protected_key, POST /auth/v1/admin/api-keys/{id}/rotate-protected replaces it atomically; the Cloud console key is protected. [Engine, Cloud] - [MCP](https://data.docs.sypnia.com/machines/mcp.md): One MCP server (Streamable HTTP, JSON responses, stateless) for every project: https://mcp.data.sypnia.com in Sypnia Cloud (self-hosted: SYPNIA_DATA_MCP_URL, default /mcp). The token decides the project and the rights. Project token (user JWT under RLS, OAuth client token, PAT syp_pat__…, secret key syp_sk__…): works on that project only; a project argument must match. Sypnia account token (auth.sypnia.com session, device-flow agent session, Sypnia PAT): works on every project of the person's organizations by role (viewer reads; developer/admin/owner write; data:read-only tokens read), tools take project (ref or name), extra tools list_projects, get_project, create_project. OAuth: 401 + WWW-Authenticate resource_metadata → RFC 9728 (resource https://mcp.data.sypnia.com, authorization server auth.sypnia.com; ?project= on the MCP URL shows that project's auth instead) → RFC 8414 → DCR (public PKCE clients, scopes data:read data:write offline_access) → authorization code + PKCE with resource indicator (RFC 8707). Tools: list_tables, describe_table, select, insert, update*, delete*, query (sql:read), execute* (sql:write), list_migrations, apply_migration*, list_users, invite_user*, revoke_sessions* (auth:admin), list_use_cases; * needs confirm: true. Annotations readOnlyHint/destructiveHint; audit row per call (mcp_tool); 120 calls/min; 500 rows per page with next_cursor. Resources sypnia:///schema and sypnia:///use-cases; prompt explore_project. [Engine, Cloud] ## Data Your tables as an API, protected by row-level security, plus SQL and migrations over HTTPS, on any Postgres. - [Data: overview](https://data.docs.sypnia.com/data.md): Section index for data access in Sypnia Data: the Data API (/rest/v1, PostgREST-compatible filters, embedding, upsert, rpc), row-level security (SET LOCAL ROLE + request.jwt.claims, auth.uid()/auth.role()/auth.jwt()), the SQL endpoint (/sql/v1/query, migrations, schema), running on any Postgres 14+ (installed schemas and roles, privileges, manual install), the @sypnia/data package, and using any ORM. [Engine, Cloud] - [The Data API](https://data.docs.sypnia.com/data/rest-api.md): Data API at https://.data.sypnia.com/rest/v1 (PostgREST-compatible subset): GET /{table}?select=cols,rel(cols)&col=op.value with eq neq gt gte lt lte like ilike in is cs cd ov fts plfts phfts wfts and not./or=(…); order=col.desc.nullslast; limit/offset or Range header; Prefer: count=exact|planned|estimated → Content-Range; POST insert (bulk), Prefer return=representation, upsert with resolution=merge-duplicates + on_conflict; PATCH/DELETE need a filter; POST /rpc/{fn}; POST /transaction; GET / (OpenAPI); Accept-Profile/Content-Profile for schemas; max_rows 1000; statement_timeout 8 s (30 s service_role); schema cache refreshed on DDL. [Engine, Cloud] - [Row-level security](https://data.docs.sypnia.com/data/row-level-security.md): RLS in Sypnia Data: each Data API request is one transaction: SET LOCAL ROLE anon|authenticated|service_role|custom; set_config('request.jwt.claims', claims, true); set_config('request.sypnia.principal', …). Helpers: auth.uid() uuid, auth.role() text, auth.jwt() jsonb, auth.email() text, sypnia.client_id() text, sypnia.scopes() text[]. Same names as Supabase, so existing policies port. service_role bypasses RLS. Console creates tables with RLS on. Patterns: owner column, team membership via your own members table, machines via sypnia.client_id()/scopes(). [Engine, Cloud] - [SQL and migrations](https://data.docs.sypnia.com/data/sql-and-migrations.md): SQL endpoint: POST /sql/v1/query {query, params?, read_only?, row_limit?} → {results:[{command, columns, rows, row_count}], duration_ms}; auth: secret key, sql:read/sql:write scopes, or the owner in the console; runs as sypnia_admin (not superuser); statement_timeout 15 s (max 60), ≤ 5000 rows; read_only uses SET TRANSACTION READ ONLY; audited in sypnia_data.sql_audit. Migrations: GET/POST /sql/v1/migrations {name, sql} applied in a transaction, recorded in sypnia_data.migrations (version, name, checksum, applied_at, applied_by). GET /sql/v1/schema returns tables, columns, keys, relations, policies, functions. [Engine, Cloud] - [Any Postgres](https://data.docs.sypnia.com/data/any-postgres.md): Requirements: PostgreSQL 14 or later, reachable by connection string with TLS. No extensions required (gen_random_uuid is core; pg_trgm and citext used if present). Install creates schemas sypnia_auth, sypnia_data, auth (helper functions), sypnia (helpers) and roles anon, authenticated, service_role (NOLOGIN), sypnia_authenticator (LOGIN, NOINHERIT), sypnia_admin. Automatic install needs CREATEROLE and CREATE on the database (RDS master user is enough); manual mode: sypnia-data install --print-sql for a DBA. Tested targets: RDS, Aurora, Cloud SQL, Azure, Neon, Supabase, Crunchy, self-managed. [Engine, Cloud] - [@sypnia/data, the package](https://data.docs.sypnia.com/data/sdk.md): @sypnia/data (MIT, Node 20+), subpaths /client and /server, and the CLI npx @sypnia/data (login, logout, whoami, init, pull, migrate, version; map only runs npx @sypnia/cases map). Sypnorm, the use-case ORM, and the use-case map are not part of it: they come with Sypnia Cases as @sypnia/cases (a dependency of @sypnia/data since 0.3.0; npx @sypnia/cases map). @sypnia/data/sypnorm and createServer from @sypnia/data/server are deprecated re-exports of @sypnia/cases/sypnorm (DeprecationWarning, SYPNIA_NO_DEPRECATION=1 silences it): import from @sypnia/cases/sypnorm. Client: createClient(url, publishableKey, {auth: {storage, crossSubdomain, autoRefresh, persistSession, detectSessionInUrl, storageKey, httpOnlyRefresh}, db: {schema}, fetch}). auth: signUp, signInWithPassword, signInWithOtp, verifyOtp, signInWithOAuth, exchangeCodeForSession, linkIdentity, unlinkIdentity, getSession, getUser, refreshSession, setSession, updateUser, resetPasswordForEmail, reauthenticate, signOut({scope}), onAuthStateChange, getSettings, sessions.list/revoke, tokens.list/create/revoke, devices.lookup/approve. Data: from(table) select/insert/upsert/update/delete with eq neq gt gte lt lte like ilike is in contains containedBy overlaps textSearch not or match order limit range single maybeSingle; rpc(fn, args); schema(name); transaction(operations). Server (@sypnia/data/server): createClient(url, {secretKey} | {client: {id, privateKey|secret, dpop, scope, resource}} | {accessToken} | {source}) adds sql`…`, query, sqlTransaction, schema, migrations.list/apply, admin (users, invite, generateLink, settings, clients, apiKeys); fromCredentials() uses the session saved by login. Refresh 60 s before expiry, one refresh at a time across tabs. CLI env: SYPNIA_SECRET_KEY, SYPNIA_CONFIG_DIR, SYPNIA_CLOUD_API. [Engine, Cloud] - [Use any ORM](https://data.docs.sypnia.com/data/any-orm.md): Sypnia Data is the data layer (auth, tables, Data API, SQL, row-level security, MCP) and has no ORM of its own. Options on the same tables: @sypnia/data/client (Data API with the person's token, under RLS), plain SQL (/sql/v1 or a direct connection), Prisma or Drizzle (direct connection: your own Postgres or a dedicated database; managed shared has none; migrations through their tools or npx @sypnia/data migrate), Sypnorm (the use-case ORM, part of Sypnia Cases: @sypnia/cases/sypnorm, runs through the Data API or a direct connection; a case other cases listen to runs in its area's service, POST /_cases/; https://cases.docs.sypnia.com/sypnorm/). Through a direct connection, row-level security applies only if you set the role (SET LOCAL ROLE authenticated + request.jwt.claims). [Engine, Cloud] ## The console Sypnia Cloud's web app for Sypnia Data, at data.app.sypnia.com, and the rule that everything it does is also in the API. - [The console: overview](https://data.docs.sypnia.com/console.md): The console (data.app.sypnia.com, Sypnia Cloud only): sign-up/sign-in, onboarding (organization, first project), project home (address, keys, quickstarts), table editor, SQL editor, schema and policies, auth (users, providers, e-mail, templates, session policy, redirect URLs), machines (OAuth clients, PATs, API keys, device approvals, dynamic registration), use cases (map per table), MCP and API docs, settings. Every action is an API call; nothing is console-only. [Cloud] - [Tables and SQL](https://data.docs.sypnia.com/console/tables-and-sql.md): Console data tools: table editor (virtualised grid, inline edit, insert, delete, filter, sort, paginate; create/alter tables and columns, foreign keys, RLS toggle on by default), SQL editor (CodeMirror with schema autocomplete, run all or selection, multiple results, saved snippets personal/shared, history, read-only toggle), schema view (tables and relations with a small diagram), policies (list per table, templates owner-only/read-all/team, edit SQL). [Cloud] - [Auth, machines and use cases](https://data.docs.sypnia.com/console/auth-machines-and-use-cases.md): Console auth area: users (search, invite, confirm, ban, delete, list and end sessions), providers (e-mail, Google, GitHub), e-mail provider with test send, templates editor with live preview in each language, session policy, redirect URLs, CAPTCHA. Machines area: OAuth clients (public key or secret, scopes, DPoP required, session policy), PATs, API keys (rotate, revoke), Agents and devices (device-flow sessions, revoke), dynamic client registration toggle and initial access tokens. Use cases area: the map uploaded with npx @sypnia/cases map --upload --project (count of cases and tables touched; each case with actor, tables read and written, failures), the upload command to copy, and a plain-words explanation of Sypnia Cases linking to cases.sypnia.com; when the project is linked to a Cases map, each upload is also forwarded there as a draft proposal. [Cloud] ## Sypnia Cloud Sypnia Data run for you: projects and their databases, addresses, limits and plans. - [Sypnia Cloud: overview](https://data.docs.sypnia.com/cloud.md): Section index for Sypnia Cloud's Sypnia Data: organizations and projects, three kinds of database (managed shared, your own Postgres, dedicated), addresses (data.sypnia.com landing, data.app.sypnia.com console, data.api.sypnia.com Cloud API, .data.sypnia.com project API), limits of the free tier, plans (per product, a global Sypnia subscription, extra capacity, prepaid with credits). [Cloud] - [Projects and databases](https://data.docs.sypnia.com/cloud/projects-and-databases.md): Database kinds: managed shared (free tier; one Postgres database per project on a shared server, its own roles, reached through the Data API + SQL endpoint, no direct connection), your own Postgres (paste a connection string; tested for TLS, version ≥ 14, privileges; install automatic or manual; credentials encrypted with KMS), dedicated (pick instance class, storage and region; direct connections with TLS and IP allow list; priced by size, shown before you confirm, paid from credits). Moving: pg_dump/pg_restore and switching the project's database keeps users and signing keys. [Cloud] - [Addresses and limits](https://data.docs.sypnia.com/cloud/endpoints-and-limits.md): Addresses: data.sypnia.com (landing), data.docs.sypnia.com (docs), data.app.sypnia.com (console), data.api.sypnia.com (Cloud API: organizations, projects, keys management, the link to a Cases project: PUT/DELETE /v1/projects/{ref}/cases-map { map, url } written by Cases; PUT /v1/projects/{ref}/use-cases stores the uploaded map and forwards it to the linked Cases map as a draft proposal, answering { stored, cases: { status: forwarded|failed|not_available, map, proposal } | null }; GET …/use-cases → { uploaded_at, use_cases, cases: { map, url } | null }; earlier uploads are not imported into Cases; Cases calls with Authorization: Service on behalf of a verified person, accepted only on GET /v1/me, GET /v1/projects/{ref}, PUT|DELETE …/cases-map and the linked project's sql/v1/schema and sql/v1/query, still checking the person's role), https://.data.sypnia.com (a project: /auth/v1, /rest/v1, /sql/v1, /mcp, /.well-known). Free tier limits: 2 projects per organization, managed shared database up to 500 MB, 50,000 monthly active users, Data API 100 requests/second per project, SQL endpoint 60 statements/minute, paused after 14 days without requests. [Cloud] - [Plans](https://data.docs.sypnia.com/cloud/plans.md): How Sypnia Data is paid for in Sypnia Cloud, starting on the free tier: each Sypnia product has its own plans (Data, Telemetry, …); a global Sypnia subscription includes every product with several tiers; any plan can buy extra capacity per item (more storage, more active users); auth e-mails sent through Sypnia Mail are paid with credits added to the monthly subscription or paid with credits; everything prepaid (monthly in advance, or credits topped up with PayPal, at least USD 5; credits expire 12 months after purchase, oldest spent first; no refunds unless the mistake is Sypnia's, and then only in credits); when credits run out: notices at 80 % (of the balance after the last top-up) and 100 %, 7 days of grace with the project working, then the free tier's limits without deleting data. [Cloud] ## Architecture How the engine is built, where Rust runs and where the logic lives, how requests flow, what is stored, how it runs on AWS, what happens when something fails, and how it scales. - [Architecture: overview](https://data.docs.sypnia.com/architecture.md): Section index for Sypnia Data's architecture: one Rust binary (axum, sqlx, tokio) with modules core, auth, mail, rest, sql, install, server; stateless; all state in the project's Postgres; runs as a Lambda (arm64) behind CloudFront in Sypnia Cloud or as a container/binary self-hosted. Pages: components, request paths, data model, reference implementation on AWS, failures, scaling and pooling, codebase. [Engine, Cloud] - [Components](https://data.docs.sypnia.com/architecture/components.md): Engine modules (Rust crates): core (configuration, project registry: host → project → database, per-project connection pools, the AuthContext that turns a key/token/PAT/DPoP proof into a principal and a database role, envelope encryption, rate limits, audit, error shape), auth (/auth/v1 users and /auth/v1/oauth machines), mail (SES, SMTP, Resend, Postmark; templates), rest (Data API, schema cache), sql (query, transactions, migrations, schema JSON), mcp (the MCP server: tools, resources, prompt, account and project tokens), install (SQL migrations of the engine's own schemas and roles), server (HTTP router by host, Lambda adapter, CLI). Around it: @sypnia/data (TypeScript; subpaths /client, /server), and in Sypnia Cloud the console and the Cloud API. [Engine, Cloud] - [Request paths](https://data.docs.sypnia.com/architecture/request-paths.md): Request paths: (1) password sign-in: host → project via registry, rate limit check in Postgres, argon2id verify, session row + refresh token row (hash), access JWT signed with the project's Ed25519 key, audit row. (2) refresh: hash lookup, reuse window check, rotate (new row with parent), revoke old, new JWT; reuse after window → revoke session. (3) client credentials with private_key_jwt + DPoP: verify assertion against client JWKS, jti single-use, DPoP proof, issue JWT with cnf.jkt. (4) Data API: AuthContext from key/token (JWKS cached), parse URL, schema cache, one transaction with SET LOCAL ROLE and request.jwt.claims, one statement, JSON. Typical latencies: sign-in 120–250 ms (argon2id), refresh 15–30 ms, Data API 5–20 ms plus the query. [Engine, Cloud] - [The data model](https://data.docs.sypnia.com/architecture/data-model.md): sypnia_auth tables: users (identity, argon2id hash, confirmation timestamps, app_metadata, user_metadata, banned_until, deleted_at), identities (provider, provider_id, user_id), sessions (user_id or client_id, policy snapshot, aal, last_refresh_at, not_after, user agent, ip prefix), refresh_tokens (token_hash, session_id, parent_id, revoked_at), one_time_tokens (type, token_hash, code_hash, attempts, expires_at), flow_state (PKCE), oauth_clients, assertion_jti, device_codes, personal_access_tokens, api_keys, rate_limits, audit_log. sypnia_data: migrations, sql_audit, settings, signing_keys (encrypted). Roles anon/authenticated/service_role (NOLOGIN), sypnia_authenticator (LOGIN NOINHERIT), sypnia_admin. Secrets are stored as hashes; signing keys and provider credentials encrypted. [Engine, Cloud] - [A reference implementation on AWS, service by service](https://data.docs.sypnia.com/architecture/reference-implementation-aws.md): AWS deployment of the engine (template sypnia-data-aws.yaml; Sypnia Cloud runs the same shape): CloudFront (wildcard host *.data.example.com, forwards Host, caches only /.well-known/jwks.json for 5 min), one Lambda function (arm64, provided.al2023, the Rust binary, 512 MB, reserved concurrency to protect the database) with a Function URL, Amazon RDS for PostgreSQL (or any Postgres), AWS KMS (one key for envelope encryption of signing keys and credentials), SSM Parameter Store (connection strings, master settings), Amazon SES or another provider (e-mail), CloudWatch (logs 30 days, alarms on errors, throttles, database connections). No VPC, NAT, load balancer or queue required. Idle cost is a few dollars a month plus the database. [Engine, Cloud] - [When something fails](https://data.docs.sypnia.com/architecture/failures.md): Failure modes: database unreachable → 503 database_unavailable with Retry-After, nothing half-written (one transaction per request), sessions stay valid until access tokens expire; connections exhausted → wait up to 2 s for a pooled connection then 503; e-mail provider down → the one-time token is kept, the call answers 202 email_queued_retry and the engine retries 3 times over 10 min, then audit email_failed and a console warning; bounce/complaint → address suppressed; Google/GitHub down → provider sign-in fails with provider_unavailable, other methods work; signing-key rotation → overlap in JWKS, no sign-outs; KMS unavailable → cached data keys keep signing, cold instances answer 503; engine crash → stateless, the next instance serves; refresh reuse → session revoked; Lambda throttled → 429/503 with Retry-After. No dead-letter queues: the engine has no queues; e-mail retries are rows in Postgres. [Engine, Cloud] - [Scaling and connection pooling](https://data.docs.sypnia.com/architecture/scaling-and-pooling.md): Connection budget: each engine instance keeps a pool per project database (default max 2 when serverless, 10 when long-running) plus one registry connection; idle connections close after 30 s; worst case = instances × (projects active in each × pool size + 1). On Lambda, cap instances with reserved concurrency. db.t4g.micro ≈ 80 usable connections, small ≈ 190, medium ≈ 400. Add PgBouncer in transaction mode or RDS Proxy when many projects or high concurrency; the engine only uses SET LOCAL inside transactions, so transaction pooling is safe. Long-running mode (container, Fargate) shares one pool across requests and scales by CPU. [Engine, Cloud] - [The codebase](https://data.docs.sypnia.com/architecture/codebase.md): Repository sypnia-data (engine AGPL-3.0, packages/data MIT): crates/{core,auth,mail,rest,sql,mcp,install,server,testkit} (Rust workspace), packages/data (@sypnia/data: src/client, src/server, src/cli, skills/), spec/{openapi.yaml,auth-schema.sql,introspect.sql} (the contract), Dockerfile and docker-compose.yml at the root, deploy/{aws.yaml,aws/sypnia-data-cloud.yaml}, examples/espiga, tests/mcp-sdk, docs/ARCHITECTURE.md. Build: cargo build --release (cargo lambda build --arm64 for AWS); pnpm -r build. Tests: cargo test with a throwaway Postgres (initdb/pg_ctl), pnpm -r test against a local engine. Start reading at crates/core/src/context.rs (who is calling) and crates/rest/src/parse.rs + build.rs (URL to SQL). [Engine] ## Self-hosting Run the open-source engine yourself, with Docker or on AWS, against your own Postgres. - [Self-hosting: overview](https://data.docs.sypnia.com/self-hosting.md): Self-hosting index: the engine is one binary or the image ghcr.io/sespinosav/sypnia-data; needs a Postgres 14+, a 32-byte master key (SYPNIA_DATA_MASTER_KEY) and an e-mail provider; one project or many (projects.toml). Pages: Docker, AWS (template), configuration (every setting), upgrades and backups. [Engine] - [Docker](https://data.docs.sypnia.com/self-hosting/docker.md): Docker: image ghcr.io/sespinosav/sypnia-data: (linux/amd64 and linux/arm64, distroless, non-root, port 8080, healthcheck `sypnia-data health`). The repository's docker-compose.yml runs Postgres 16, the engine and Mailpit (e-mails at http://localhost:8025); copy .env.example to .env and set SYPNIA_DATA_MASTER_KEY (openssl rand -base64 32) and POSTGRES_PASSWORD. SYPNIA_DATA_INSTALL_ON_START=true installs or upgrades the schema before serving (waits for the database). Keys: `docker compose exec data sypnia-data keys api-key --kind publishable|secret`. Users: `docker compose exec -e SYPNIA_DATA_NEW_PASSWORD=… data sypnia-data users create `. MCP at /mcp. SYPNIA_DATA_TICK=internal for e-mail retries and cleanup. Put TLS in front and forward Host. [Engine] - [AWS](https://data.docs.sypnia.com/self-hosting/aws.md): AWS self-host: CloudFormation template deploy/aws.yaml. Creates the engine Lambda (arm64, function URL, install on cold start), an events Lambda (minute tick, SES bounces, admin actions), CloudFront at DomainName with your us-east-1 certificate (origin secret in Secrets Manager), optional Route 53 records, an optional Lambda@Edge that restores WWW-Authenticate, RDS PostgreSQL 16 (DatabaseMode=create: generated password in Secrets Manager, public with TLS, DbAllowedCidr, final snapshot on delete) or your Postgres (DatabaseMode=existing: SSM SecureString DatabaseUrlParameter), SES configuration set + bounce topic and an optional domain identity with DKIM. Prerequisites: the Lambda package in an S3 bucket of the region, a master key in SSM SecureString (MasterKeyParameter), a certificate in us-east-1. Keys: aws lambda invoke on the events function with {action: api_key, ref: default, kind}. [Engine] - [Configuration](https://data.docs.sypnia.com/self-hosting/configuration.md): Engine environment: SYPNIA_DATA_MASTER_KEY (required, 32 bytes base64) or SYPNIA_DATA_MASTER_KEY_KMS (+ SYPNIA_DATA_KMS_KEY_ID), SYPNIA_DATA_PUBLIC_URL, DATABASE_URL or DATABASE_URL_AUTHENTICATOR + DATABASE_URL_ADMIN, SYPNIA_DATA_PROJECTS_FILE (projects.toml: [[project]] ref, host/hosts, public_url, database_url, database_url_admin, database_url_authenticator, admin_role, authenticator_role), SYPNIA_DATA_LISTEN (0.0.0.0:8080), SYPNIA_DATA_POOL_MAX (2 Lambda / 10 server), SYPNIA_DATA_TICK (internal|external), SYPNIA_DATA_MAX_ROWS (1000), SYPNIA_DATA_MAIL (smtp|resend|postmark|ses|none) with SYPNIA_DATA_SMTP_URL, _RESEND_API_KEY, _POSTMARK_TOKEN, _SES_REGION, _SES_CONFIGURATION_SET, SYPNIA_DATA_MAIL_FROM, SYPNIA_DATA_MAIL_DEFAULT_REFS, SYPNIA_DATA_MAIL_DEFAULT_HOURLY_CAP (0 = none), SYPNIA_DATA_MAIL_UNCAPPED_REFS, SYPNIA_DATA_LOG (info), SYPNIA_DATA_INSTALL_ON_START, _SSM for DATABASE_URL/MASTER_KEY/SMTP_URL/RESEND_API_KEY/POSTMARK_TOKEN/ORIGIN_SECRET, SYPNIA_DATA_DATABASE_SECRET_ARN + _HOST/_PORT/_NAME, SYPNIA_DATA_ORIGIN_SECRET, SYPNIA_DATA_MCP_URL, SYPNIA_DATA_ACCOUNT_PROJECT, SYPNIA_DATA_CONTROL_PLANE_URL, SYPNIA_DATA_ROLE=events, SYPNIA_DATA_OFFLINE, SYPNIA_DATA_NEW_PASSWORD; Sypnia Cloud's: SYPNIA_DATA_REGISTRY_URL(_SSM), SYPNIA_DATA_PROJECT_DOMAIN, SYPNIA_DATA_PROJECTS_SSM, SYPNIA_DATA_MASTER_URL / SYPNIA_DATA_PROVISIONER_URL_SSM. Commands: sypnia-data serve [--install], health, install [--print-sql] [--ref], provision , keys rotate|api-key, users create, registry seal, tick. Events function actions: provision, install_byo, deprovision, api_key, protect_key, rotate_protected_key, upgrade. Project settings in sypnia_data.settings via GET/PATCH /auth/v1/admin/settings: session_policy, require_email_confirmation, signup_open, password_policy, site_url, redirect_urls, providers, mail, templates, captcha, exposed_schemas, rate_limits, dynamic_client_registration, cross_subdomain, otp_ttl, project_name, device_verification_uri, consent_url, cors_origins. [Engine] - [Upgrades and backups](https://data.docs.sypnia.com/self-hosting/upgrades-and-backups.md): Upgrades: read the changelog, run `sypnia-data install` with the new version (migrations are additive within a minor version, run in a transaction, recorded in sypnia_data.migrations), then roll out the new binary; old and new engines run side by side during the rollout. Backups: the project's database holds everything (pg_dump or your provider's snapshots); also keep SYPNIA_DATA_MASTER_KEY (or the KMS key) — without it the signing keys cannot be decrypted and every session ends. Restore = restore the database + same master key. [Engine] ## API reference The addresses, how to authenticate, the error shape and the limits shared by every endpoint. - [API reference: overview](https://data.docs.sypnia.com/api.md): API overview: base https://.data.sypnia.com (self-hosted: your SYPNIA_DATA_PUBLIC_URL). Families: /auth/v1 (users), /auth/v1/oauth (machines), /auth/v1/admin (secret key), /rest/v1 (Data API, transactions, the OpenAPI description at /rest/v1/), /sql/v1 (SQL, transactions, migrations, schema), /mcp, /.well-known (jwks.json, oauth-authorization-server, openid-configuration, oauth-protected-resource), /health. Auth: apikey header (publishable or secret), Authorization: Bearer or DPoP + DPoP proof. Errors: {"error":{"code","message","hint"}}; OAuth endpoints use RFC 6749 {error, error_description}. Rate-limited answers 429 with Retry-After. Every error code and limit: /api/errors-and-limits. The machine-readable contract is spec/openapi.yaml. [Engine, Cloud] - [Auth endpoints](https://data.docs.sypnia.com/api/auth-endpoints.md): Endpoints: POST /auth/v1/signup {email, password?, data?, redirect_to?, captcha_token?}; POST /auth/v1/token?grant_type=password|refresh_token|pkce; POST /auth/v1/otp (alias /auth/v1/magiclink) {email, create_user?, data?, redirect_to?, captcha_token?}; POST/GET /auth/v1/verify {type, token_hash | email+token}; POST /auth/v1/recover; GET/PUT /auth/v1/user; POST /auth/v1/reauthenticate; POST /auth/v1/logout?scope=local|others|global; GET /auth/v1/sessions, DELETE /auth/v1/sessions/{id}; GET/POST /auth/v1/tokens, DELETE /auth/v1/tokens/{id} (PATs {name, scopes, resource?, expires_at?}); GET /auth/v1/authorize?provider=&redirect_to=&code_challenge=; GET /auth/v1/user/identities/authorize (link, answers {url}); DELETE /auth/v1/user/identities/{provider} (422 last_identity); GET /auth/v1/callback; GET /auth/v1/settings (providers, signup_open, require_email_confirmation, password_min_length, password_requirements, captcha, project_name, email_ready); admin with a secret key: GET/POST /auth/v1/admin/users (search, page, per_page ≤ 1000), GET/PUT/DELETE /auth/v1/admin/users/{id} (ban_duration), POST /auth/v1/admin/users/{id}/logout, POST /auth/v1/admin/invite, POST /auth/v1/admin/generate_link {type signup|invite|magiclink|recovery, email}, GET/PATCH /auth/v1/admin/settings, /auth/v1/admin/oauth/clients, POST /auth/v1/admin/oauth/registration-tokens, /auth/v1/admin/api-keys (protected, rotate-protected), POST /auth/v1/admin/keys/rotate. Session response {access_token, token_type, expires_in, expires_at, refresh_token, user}. E-mail flows answer 202 email_queued_retry when the provider failed, 409 email_provider_required without a provider. [Engine, Cloud] - [OAuth endpoints](https://data.docs.sypnia.com/api/oauth-endpoints.md): OAuth endpoints per project: GET /.well-known/oauth-authorization-server and /.well-known/openid-configuration (issuer https://.data.sypnia.com/auth/v1, endpoints, grant types, token_endpoint_auth_methods_supported [private_key_jwt, client_secret_basic, client_secret_post, none], dpop_signing_alg_values_supported [EdDSA, ES256], code_challenge_methods_supported [S256]); GET /.well-known/oauth-protected-resource; GET /.well-known/jwks.json (also /auth/v1/.well-known/jwks.json and /auth/v1/.well-known/openid-configuration); POST /auth/v1/oauth/token (client_credentials, authorization_code, refresh_token, urn:ietf:params:oauth:grant-type:device_code); GET /auth/v1/oauth/authorize; POST /auth/v1/oauth/device_authorization; POST /auth/v1/oauth/register (RFC 7591); POST /auth/v1/oauth/revoke (RFC 7009); POST /auth/v1/oauth/introspect (RFC 7662, client auth required). For the approval screens (a signed-in person): GET /auth/v1/oauth/device?user_code=, POST /auth/v1/oauth/device/approve {user_code, decision}, GET /auth/v1/oauth/flows/{id}, POST /auth/v1/oauth/authorize/decision {flow_id, decision}; the engine's own minimal pages GET /auth/v1/device and GET /auth/v1/oauth/consent. scopes_supported: data:read data:write sql:read sql:write auth:admin project:admin openid email offline_access. [Engine, Cloud] - [Data and SQL endpoints](https://data.docs.sypnia.com/api/data-endpoints.md): Data API: GET/HEAD/POST/PATCH/DELETE /rest/v1/{table}, POST /rest/v1/rpc/{fn}, POST /rest/v1/transaction {operations: [{name?, method, table, schema?, query?, body?, increment?, expect?, on_error?, returning?}] ≤ 100}, GET /rest/v1/ (OpenAPI 3.1 of the exposed schema; not with a publishable key alone); query params select, filters (col=op.value: eq neq gt gte lt lte like ilike in is cs cd ov fts plfts phfts wfts, not.), or, and, order, limit, offset, on_conflict, columns; headers Prefer (return=minimal|representation, count=exact|planned|estimated, resolution=merge-duplicates|ignore-duplicates, missing=default), Range/Range-Unit, Accept-Profile/Content-Profile, Accept: application/vnd.pgrst.object+json; response Content-Range. Errors invalid_query, invalid_body, empty_update, filter_required, table_not_found, column_not_found, function_not_found, relationship_not_found, permission_denied (RLS/grants), statement_timeout, expectation_failed, insufficient_scope. SQL: POST /sql/v1/query {query, params?, read_only?, row_limit? ≤ 5000, timeout_ms? ≤ 60000}, POST /sql/v1/transaction {statements: [{sql, params?, expect?}] ≤ 100, read_only?, timeout_ms?}, GET/POST /sql/v1/migrations, GET /sql/v1/schema?schemas=; auth secret key, sql:* scopes or console owner. [Engine, Cloud] - [Errors and limits](https://data.docs.sypnia.com/api/errors-and-limits.md): Every Sypnia Data error code. Shape {error:{code,message,hint}}; OAuth endpoints use RFC 6749 {error,error_description}; MCP tool refusals come back as isError results with text ': ()'. Groups: credentials and requests (missing_host, missing_api_key, invalid_api_key, invalid_token, invalid_dpop_proof, secret_key_in_browser, not_signed_in, invalid_role, secret_key_required, person_required, scope_not_allowed, direct_access, csrf_failed, origin_not_allowed, unknown_project, rate_limited, internal_error, database_unavailable, pool_exhausted, keys_unavailable, aws_unavailable, statement_timeout); auth; OAuth; Data API (invalid_query, invalid_body, empty_update, filter_required, table_not_found, column_not_found, function_not_found, function_arguments, relationship_not_found, embedding_too_deep, generated_column, not_insertable, on_conflict_required, invalid_increment, invalid_transaction, expectation_failed, schema_not_exposed, not_single, method_not_allowed, insufficient_scope, token_required); database errors mapped from Postgres (unique_violation, foreign_key_violation, not_null_violation, check_violation, exclusion_violation, invalid_value, permission_denied, undefined_table, undefined_function, undefined_column, datatype_mismatch, cardinality_violation, read_only_transaction, serialization_failure, raised_exception, database_error); SQL (empty_query, params_need_one_statement, one_statement_each, invalid_name, scope_required, sql_not_allowed, migration_checksum_mismatch); install (invalid_url, invalid_identifier, postgres_too_old); MCP refusals. Limits: 1000 rows per Data API response, 8 s / 30 s statement time, 2 MB body, 100 operations per transaction, 4 embedding levels, SQL 15 s default up to 60 s and 5000 rows, 100 statements per SQL transaction, MCP 500 rows per page, 200 kB per tool answer, 120 calls/min. [Engine, Cloud] ## Security How Sypnia Data protects people's accounts, your data and its own secrets, in the engine and in Sypnia Cloud. - [Security: overview](https://data.docs.sypnia.com/security.md): Security overview: passwords argon2id + breached check, short EdDSA access tokens, rotating refresh tokens with reuse detection, DPoP for machines, secrets stored as hashes, signing keys and credentials encrypted (KMS or master key), one database per project, no superuser, row-level security enforced by Postgres, rate limits and audit, TLS everywhere. Pages: threat model, how secrets and projects are isolated, checklist. [Engine, Cloud] - [The threat model](https://data.docs.sypnia.com/security/threat-model.md): Threats and controls: credential stuffing/brute force (rate limits, exponential lockout, CAPTCHA, breached passwords, no enumeration); stolen refresh token (rotation + reuse detection revokes session, HttpOnly cookie, short access tokens); stolen access token (1 h TTL, DPoP for machines); token forgery (Ed25519 per project, kid, JWKS); phishing links/open redirect (redirect allow list, single-use hashed tokens, 1 h expiry); CSRF on cookie mode (SameSite=Lax + double-submit header + CORS allow list); secret key leak (refused from browsers, hashed, revocable, secret scanning); SQL injection via the Data API (parameterised single statements, identifiers checked against the schema cache); privilege escalation in DB (no superuser, NOINHERIT authenticator, SET LOCAL ROLE per transaction); cross-project access (host→registry, one DB and keys per project); malicious agents (scopes, consent, audit, revocation); DoS (rate limits, statement timeouts, row caps, concurrency caps). Privileged scopes need an entitlement (app_metadata.scopes set with the secret key), checked at issuance (403 scope_not_allowed) and at use; fixed finding 2026-11-17 (self-granted sql:write via PAT/device flow). [Engine, Cloud] - [Checklist before production](https://data.docs.sypnia.com/security/checklist.md): Production checklist: RLS on every exposed table and tested with two users; secret keys only on servers (env/secrets manager); your own e-mail provider and domain (SPF, DKIM, DMARC); redirect URLs exact; e-mail confirmation on; CAPTCHA if public sign-up; session policy chosen; master key or KMS key backed up separately (self-host); TLS verify-full to the database; database backups tested; alarms on errors and connections; audit log reviewed; DPoP required for machine clients; PATs with expiry where possible. [Engine, Cloud] ## Reference The glossary, the design decisions, the changelog and common questions. - [Reference: overview](https://data.docs.sypnia.com/reference.md): Reference section of Sypnia Data: glossary (one name per thing), design decisions (what was chosen and why), changelog, FAQ. [Engine, Cloud] - [Glossary](https://data.docs.sypnia.com/reference/glossary.md): Sypnia Data vocabulary: project, project ref, engine, Sypnia Cloud, console, user, session, access token, refresh token, session policy, publishable key, secret key, personal access token, OAuth client, DPoP, device flow, Data API, row-level security, database role, use case, managed database, your own Postgres, MCP server. [Engine, Cloud] - [Design decisions](https://data.docs.sypnia.com/reference/decisions.md): Design decisions of Sypnia Data: free tier of 2 projects, 500 MB, 50,000 monthly active users and 100 requests per second; paid per product, in the whole Sypnia subscription or with extra capacity, always prepaid (monthly in advance or credits); managed shared databases are reached through the Data API and SQL, while dedicated databases and your own Postgres take direct connections; engine AGPL-3.0, @sypnia/data MIT. [Engine, Cloud] - [Changelog](https://data.docs.sypnia.com/reference/changelog.md): Changelog of Sypnia Data. 2026-11-18: @sypnia/data 0.3.1 (init installs @sypnia/cases with the app's package manager, --no-install skips it; depends on @sypnia/cases 0.2), the Data project ↔ Cases map link both ways (PUT/DELETE /v1/projects/{ref}/cases-map; uploaded maps forwarded to the linked Cases map as draft proposals; Cases' service calls on behalf of a person on a few routes); @sypnia/data 0.3.0, @sypnia/data/sypnorm a deprecated re-export of @sypnia/cases/sypnorm (a dependency), npx @sypnia/data map runs npx @sypnia/cases map, init --cases writes src/use-cases/ and the sypnia-cases skill, a case some case listens to runs in its area's service (POST /_cases/), not over the Data API runner. 2026-11-17: documentation published (auth, machines, Data API, SQL, console, Sypnia Cloud, architecture, self-hosting, API reference, security). 2026-11-17 security fix: privileged scopes (sql:*, auth:admin, project:admin) need app_metadata.scopes set by an admin; 403 scope_not_allowed otherwise; account changes need the person's session; CLI default scope data:read data:write offline_access. 2026-11-17: no e-mail on behalf of customer projects (409 email_provider_required without a provider; email_ready, mail_state); protected API keys (409 protected_key, rotate-protected). [Engine, Cloud] - [Common questions](https://data.docs.sypnia.com/reference/faq.md): FAQ: difference with Supabase (same shapes for auth API, PostgREST syntax and auth.uid(); different: Rust engine, EdDSA tokens, OAuth for machines with DPoP and device flow, any Postgres without lock-in); can I use Prisma/Drizzle (yes); can I migrate from Supabase (dump/restore your tables; users sign in again with a magic link or reset their password); where is data (your Postgres; Cloud in us-east-1); can sessions never expire (yes, policy); do I need to send e-mails (no if Google/GitHub only); is it free (engine yes; Cloud free tier, then prepaid plans or credits). [Engine, Cloud]