Trust
Security for a system that touches pricing, brand voice and customer channels
The controls are designed around a simple rule: secrets stay in the environment or encrypted per tenant, decisions stay in the audit trail, and no model output reaches a customer without a human decision.
Access and identity
-
Short-lived access tokens
JWT access tokens expire in minutes. Refresh tokens rotate on every use and reuse is detected and revoked.
-
Tenant isolation
Every authenticated request carries a tenant claim. Repositories pass the tenant into stored procedures, which scope reads and writes to that tenant, so a mistake in one query cannot widen the blast radius.
-
Roles with a narrow default
Public sign-up creates a viewer account that cannot act until an administrator promotes it. Admin-only routes cover configuration, models, embeddings, feature flags and user management.
-
Fail-closed feature authorization
Campaign agent and channel features are enabled only when the tenant flag, the user grant and the role all allow it. A failed lookup denies access rather than defaulting to enabled.
-
Verified email and recoverable accounts
Verification and reset tokens are single-use, stored as hashes, and expire quickly. Completing a reset revokes existing sessions.
Secrets, credentials and channels
-
Encrypted at rest
User API keys and tenant social credentials are sealed with AES-256-GCM using a master key held only in the environment. The database stores ciphertext, never plaintext.
-
Bound to the owner
User key ciphertext is authenticated with the user and provider identity, and tenant credentials with the tenant and provider, so a copied row cannot be decrypted for another owner.
-
Metadata, not secrets
The API and dashboard show a provider, the last four characters, a validation status and an expiry. Plaintext is never returned, logged or placed in workflow state.
-
Rotation without loss
A keyring identifier supports rotating the master key while existing keys remain readable, and keys can be re-encrypted with a rekey utility.
-
WhatsApp webhook verification
Inbound Meta webhooks are checked against the app secret using the X-Hub-Signature-256 header over the raw body, and unknown phone numbers cannot start a conversation.
-
No secrets in configuration
Configuration stores environment variable names or ciphertext. Provider tokens, SMTP passwords and webhook secrets never appear in the config file or the API response.
Application hardening
- Database access goes through stored procedures; repositories are the only layer that touches SQL.
- Rate limits apply to login, password reset, verification resend, key writes, key tests, chat sends, the chat stream and WhatsApp webhooks.
- Chat input and output are capped by configuration; a request above the cap is rejected with a specific code.
- Quotas block model, media and publish calls per tenant before the cost is incurred, and the usage ledger records what was actually consumed.
- Security events such as login outcomes and account changes are written to an audit log.
- Provider key validation distinguishes invalid credentials from rate limits and access errors, so a transient 429 does not revoke a working key.
- Administrators never receive user ciphertext or fingerprints through the API.
Human control over risky actions
Discount proposals are checked against permitted percentages, margin rules and prohibited deep discounts before a reviewer sees them. In staging and production, policy verification and guardrails cannot be switched off by configuration.
Approval is required before publishing, and the chat agent cannot approve or publish. Regeneration is a budget, not an unlimited retry: it can be capped or disabled, and a disabled stage rejects the action at the API rather than failing silently.
What this page does not claim
Retail AI OS is self-hosted software, not a certification. Infrastructure hardening, network controls, database backups, master key escrow, platform app review and regulatory review belong to the deployment. This page describes behaviour in the codebase so your own review starts from facts.
Questions for your security review
Open an issue with the threat model you need to satisfy, or read the FAQ for deployment, tenancy and data questions.