Tenant isolation
Every organization stream and product resource has an owningorg_id. Query planning injects the
authorized organization boundary before execution. Resource handlers also load the target and
verify the organization before reads or mutations.
Cross-workspace access must use an explicit IAM grant or supported resource share. A mismatched
resource lookup does not silently switch organizations.
The _sys organization is a protected platform scope. Tenant JWTs and ms_* API tokens cannot
enumerate platform administrators, or MoleSignal self-telemetry.
Authentication and authorization
MoleSignal accepts:- login JWTs, including newly scoped JWTs after a workspace switch;
- API tokens shaped
ms_<prefix>_<secret>; - dedicated self-authenticating tokens for narrowly scoped public or integration routes.
JWT signing keys
JWT signing keys are bootstrapped into the database on the first start. Raw key bytes are never returned by the metadata endpoint. A rotation signs new tokens with a new key, and tokens signed with the retired key stay valid for 24 hours. Listing or rotating signing keys requires the platform permissionsys.settings.manage:
MS_AUTH_JWT_SECRET_OVERRIDE only when deployment policy requires a fixed bootstrap key.
Audit
Security-relevant and product mutation paths record actor, organization, action, target, time, and safe metadata. Query organization events under Settings → Audit withaudit.read.
Audit records are kept for 90 days by default. Once a day, records older than the retention period
are deleted for every organization and for the platform, and cannot be recovered. Set the period
under Settings → Audit retention in the _sys organization, which requires
sys.settings.manage; 0 keeps records forever. Each change of the period is recorded in the
platform audit as audit_retention.update.
Credentials, model keys, sensitive webhook headers, and raw signing material are
excluded from audit payloads.
Resource sharing
Public dashboard and report links are bearer credentials, but public links do not become organization tokens. MoleSignal exchanges a link for a short-lived HttpOnly share session and constrains access to one saved resource. Public dashboard panels can execute only server-stored queries through a restricted proxy. Shares can expire, require a password, enforce a maximum view count, disable downloads, and be revoked or rotated. See Resource sharing.Field-level encryption
Mark fields as encrypted when creating a stream. MoleSignal encrypts them with AES-256-GCM before the values reach Parquet, and a plain query returns ciphertext. SQL restores the plaintext withdecrypt(field). See Streams.
Organization data keys are wrapped with the cipher root key from MS_CIPHER_KEY, and key material
is not returned after creation. Reading key metadata requires org.settings.read; creating,
rotating, or deleting keys requires org.settings.manage.
Secret and telemetry hygiene
- Store database, object-store, SMTP, SSO, model-provider, and webhook credentials in a secret manager.
- Use
env:orsecret:references for sensitive external trace-export headers. - Keep internal gRPC
5082on a trusted network because the port includes cluster protocols. - Put TLS in front of external HTTP, OTLP gRPC
4317, and Flight SQL5083. - Keep the pprof listener on loopback unless remote diagnostics are explicitly protected.
- Backend tracing excludes request bodies, SQL values, credentials, prompts, model output, and tool arguments.
Rate and size limits
Therouter role applies per-organization token buckets to intake and query requests and answers
429 with a Retry-After header. A standalone node does not apply them. See
Role-based deployment. An intake request body above
2 MiB is rejected with 413.
Hardening for production
Replace the sandbox defaults before real data arrives: the root account,MS_CIPHER_KEY, database
and object storage credentials. See the
Production checklist.
Self-observability
Configure protected
_sys telemetry, tail sampling, and node-local diagnostics.