security
| Threat | Mitigation |
|---|---|
Tenant data leak | Tenant_id discriminator enforced in every query path; service role gated to server functions |
Cross-tenant member-data leak | person_knowings share_scope enforced in JS visibility predicate; private content visible only at origin tenant; archived rows filtered; DB check constraint blocks invalid scope values |
Credential exposure | LLM and provider keys held server-side; never returned to clients or written to logs |
Prompt injection (model-token) | Sanitize strips [INST], <|im_start|>, <s>, ### and similar tokens from every user-controlled field before prompt assembly |
Prompt injection (delimiter forge) | Sanitize also strips <<<+/>>>+ sequences from user input; system prompt frames all delimited blocks as data, not instructions; output capped at 8000 chars regardless of model response |
Concurrent budget abuse | Per-member pg_advisory_xact_lock around budget check + dedupe + insert; verified under 50-call concurrent stress |
Translation cache poisoning | Cache key includes tenant_id, so cross-tenant collisions are structurally impossible; member context changes invalidate via context_signature; member's cache wiped on GDPR erasure |
API abuse | Per-user rate limiting on all LLM and write endpoints |
XSS | CSP headers + HTML escaping on all user-generated content |
CSRF | Supabase JWT verification on every function call |
Calendar injection | All ICS fields sanitized — newlines, colons, semicolons stripped from user-provided content |
AI thread leak | Per-thread AI-off poison rule; once locked, re-enable is blocked atomically |
Endpoint ownership bypass | Surface and proposal mutation endpoints filter the lookup by (tenant_id, member_uid) from the verified token; cross-member access returns 404, cross-tenant proposal access returns 404, already-decided proposal returns 409 |
If you discover a security vulnerability, please report it responsibly. We take all reports seriously and will respond within 48 hours.
Enterprise tenants receive a full security architecture brief and a dedicated review. Get in touch.