RaksHex Security
Security Architecture Whitepaper
Last updated: May 2026 · 15 min read
Executive Summary
RaksHex is an AI Runtime Governance Platform that provides inline security scanning, cost monitoring, and compliance enforcement for production LLM applications. This document describes our security architecture, threat model, and the controls we implement to protect customer data.
1. Threat Model
We protect against the following threat categories:
Prompt Injection (LLM01)
Pattern library with severity-tiered blocking, continuously expanded as new attack vectors appear. All user inputs to LLM endpoints are scanned before reaching the model.
Insecure Output Handling (LLM02)
Response validation with JSON schema enforcement on tool calls. Blocked outputs never reach downstream systems.
Sensitive Information Disclosure (LLM06)
12-rule PII redaction engine (credit cards, SSN, Aadhaar, PAN, email, phone) with Luhn and Verhoeff verification. Streaming output redaction for SSE responses.
Insecure Plugin Design (LLM07)
MCP tool registry with risk scoring. Tools requiring network egress, file write, shell exec, or secret access are flagged and gated.
Excessive Agency (LLM08)
Per-agent tool-call allowlists. Kill switch with sub-second trip time. Budget caps with hard enforcement.
Model Theft (LLM10)
Request fingerprinting with SHA-256. Anomaly detection on request patterns. Rate limiting per tenant.
2. Encryption & Key Management
- Data in transit: TLS 1.3 enforced. HTTP Strict Transport Security (HSTS) with 1-year max-age and preload.
- Data at rest: AES-256-GCM with per-tenant key derivation. Authenticated encryption with AAD binding prevents cross-tenant access.
- Secrets: API keys stored server-side only, never logged. Pino structured logger with PII redaction. Sentry event scrubbing before egress.
- Passwords: PBKDF2-SHA512 with 100,000 iterations and per-user 32-byte salt. Never stored in plaintext.
3. Authentication & Authorization
- Session management: HTTP-only, SameSite=Lax, Secure cookies. CSRF double-submit cookie pattern. Session token rotation on password change.
- Multi-factor: TOTP-based 2FA with 6-digit codes. Verified at login and sensitive operations.
- SSO: SAML 2.0 with signed assertions. OpenID Connect with PKCE (S256). JIT provisioning with namespace-isolated subject IDs.
- RBAC: 4 roles (owner, admin, editor, viewer) × 9 resources × 3 actions. DB-backed with 60s in-process cache.
4. Infrastructure Security
- Headers: Helmet.js with strict CSP (nonce-based), COEP, COOP, CORP, Referrer-Policy, Permissions-Policy.
- Rate limiting: Redis-backed sliding window. Per-IP global limits. Per-user API limits. Stricter auth endpoint limits.
- Webhook security: HMAC-SHA-256 signature verification. Idempotency via processed_webhook_events table.
- CORS: Strict allowlist (rakshex.in, app.rakshex.in). No wildcard or dynamic reflection.
- Dependencies: npm audit run in CI. Lockfile committed. No arbitrary code execution from untrusted packages.
5. Compliance
- SOC 2: 11-control evidence pack builder covering a minimum-viable Trust Services scope. Programmatic control evaluation over 90-day windows, exported in a format Vanta/Drata can import. No certification is claimed.
- PCI DSS v4.0.1: Requirement mapping for OWASP findings. PDF report generation with compliance scores.
- GDPR: Data processing addendum available. EU/US data residency options. Right-to-erasure and data portability API.
- DPDP Act 2023 (India): Consent management. Data fiduciary obligations. Grievance redressal mechanism.
6. Incident Response
Our incident response process follows NIST SP 800-61:
- Detection: Automated alerts via PagerDuty + Slack + Discord
- Containment: Kill switch (sub-second trip), API key revocation, session termination
- Investigation: Full audit trail across auth, billing, scans, admin actions
- Notification: 72-hour supervisory authority notification. User notification without undue delay for high-risk breaches.
- Post-mortem: Blameless post-mortem with timeline, root cause, and corrective actions.