Security|~3 min read

6. Security, Compliance & Governance

Zero-trust BYOK encryption, PostgreSQL RLS, multi-tenant isolation, anti-prompt injection, and GDPR compliance.

01

Zero-Trust Security & Encryption

Field-level AES-256-GCM encryption for API keys, in-transit TLS 1.3, and strict query isolation.

Security Architecture

SRA enforces defense-in-depth across all system layers:

  1. Field-Level Encryption: All customer provider API keys are encrypted with AES-256-GCM using unique initialization vectors. The master encryption key is managed via environment variables and never checked into source control.
  2. Multi-Tenant Row-Level Isolation: Every Prisma query enforces where: { id, userId }. A request referencing another tenant's ID receives a 404 response without leaking resource existence.
  3. RAG Corpus Tenant Scoping: Vector similarity searches explicitly filter by userId. No customer's requirement chunks or project titles can ever appear in another organization's RAG context.
  4. Anti-Prompt Injection Sanitization: All user inputs entering system prompts pass through choke-point sanitizers (constructMasterPrompt) in utils/promptSanitizer.js.

GDPR Article 17 (Right to be Forgotten) Purge Engine

SRA implements transactional, cascading account deletion:

  • accountDeletionService.hardDeleteUser cascades across foreign keys in a single database transaction:

KnowledgeChunksAnalysesProjectsUser

  • Vector embeddings and graph entities are wiped completely, fulfilling GDPR Article 17 and CCPA requirements.
Was this page helpful?

Help us improve the SRA enterprise documentation.