Security & Privacy Architecture
At Chatty, security is not an afterthought — it is embedded into every layer of our distributed stack. Whether you use Chatty to automate customer support or index proprietary enterprise knowledge, your data is isolated, encrypted, and protected by defense-in-depth controls.
Security Pillars at a Glance
Tenant Data Isolation
Strict PostgreSQL Row-Level Security (RLS) guarantees cross-tenant data leaks are physically impossible at the database engine level.
Anti-SSRF IP Pinning
All outbound URL crawlers resolve DNS pre-flight and block internal subnets (RFC 1918) and cloud metadata services.
Cryptographic Integrity
Asymmetric JWKS validation for user sessions, SHA-256 API key hashing, and AES-256-GCM encryption for customer BYOK keys.
DoS & Stream Protection
Stream-capped 20MB upload ceilings and distributed Upstash Redis token-bucket rate limiters prevent resource exhaustion.
Outbound Network Defense: Anti-SSRF Engine
When a bot indexes a website or fetches a webhook URL, naive HTTP fetchers are vulnerable to Server-Side Request Forgery (SSRF), which attackers exploit to query cloud metadata services or internal microservices.
Chatty implements an Anti-SSRF IP Pinning Fetcher:
Prohibited Subnets
Any address falling within the following ranges is rejected immediately:
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16(RFC 1918 Private Networks)127.0.0.0/8(Localhost loopback)169.254.169.254/32(AWS, GCP, Azure Instance Metadata Services)::1,fc00::/7,fe80::/10(IPv6 loopback, unique local, and link-local)
Furthermore, the socket connection is pinned directly to the resolved IP address to defeat DNS rebinding attacks.
Authentication & Cryptography Standards
User sessions authenticate using asymmetric JSON Web Key Sets (JWKS). The backend verifies RSA/ECDSA digital signatures using rotating public keys provided by our authentication service, eliminating shared-secret vulnerabilities.
Secret API keys (chatty_sk_...) are displayed to developers only once upon generation. The database stores only a salted SHA-256 hash. API authentication validates incoming tokens using constant-time string comparison (hmac.compare_digest) to prevent timing side-channel attacks.
If you supply your own OpenAI, Anthropic, or Google Gemini API keys, they are encrypted with AES-256-GCM using an isolated master key stored in secret management. Keys are decrypted solely in volatile worker RAM during an active inference call and are never exposed via APIs.
Calendar scheduling and rescheduling links use cryptographically random session tokens bound to specific meeting UUIDs, preventing Insecure Direct Object Reference (IDOR) attacks.
Frame & Cross-Origin Security
To protect your brand and prevent malicious third parties from hijacking your AI bot, Chatty enforces strict frame-ancestor rules:
- Domain Allowlist: Every bot configuration includes an approved list of origins (e.g.
yourcompany.com,app.yourcompany.com). - CSP Header Injection: When the widget loads inside an iframe, the backend verifies the parent origin and injects:
Content-Security-Policy: frame-ancestors https://yourcompany.com https://app.yourcompany.com; - Unauthorized Embed Defense: If an unapproved domain attempts to frame your widget, browsers enforce the CSP policy and blank the iframe.
Resource Protection & DoS Ceilings
AI models and vector databases are computationally intensive. Chatty deploys multiple guardrails to guarantee 99.9% uptime:
- Streaming Upload Limit: Multimodal document and voice uploads are piped through a streaming chunk counter. If any upload exceeds 20MB, the stream terminates immediately.
- Distributed Redis Rate Limiting: Every public endpoint is protected by an Upstash Redis token bucket algorithm partitioned by client IP (for widget sessions) or API key.
- Strict Query Length: Inbound user prompt texts are capped at 4,000 characters. Null bytes, control characters, and recursive escape sequences are stripped before reaching the LLM tokenizer.
Payment Security & Zero Cardholder Footprint (PCI-DSS)
Chatty provides in-chat payment checkout cards powered by Stripe, Lemon Squeezy, and Polar.sh with an uncompromising fintech security architecture:
- Zero Cardholder Data (PAN/CVV) Storage: Chatty servers never capture, transmit, or store primary account numbers, cardholder names, expiration dates, or CVVs. All transactions execute on gateway-hosted checkout sessions certified to PCI-DSS Level 1.
- Fernet AES-256 Symmetric Encryption: All sensitive payment gateway credentials (Stripe Secret Keys, Lemon Squeezy API Keys, Polar Access Tokens, and Webhook Secrets) are encrypted at rest using AES-256 in CBC mode with HMAC-SHA256 authenticated encryption before persisting to the database.
- Masked Previews: Dashboard integration screens only expose truncated key identifiers (sk_live_••••••4821). Cleartext keys are permanently write-only.
- AI Agent Financial Policy Boundaries: Bots cannot autonomously trigger unauthorized checkouts or generate discounts unless explicitly permitted via the i_payment_allowed policy and capped by i_max_amount_cents.
- HMAC Webhook Signature Verification: Inbound payment webhook callbacks are cryptographically verified using gateway secret signatures (Stripe-Signature, Lemon Squeezy HMAC, Polar HMAC) to defend against replay and forgery attacks.
High Reliability & Fault Tolerance (Enterprise Grade)
Chatty includes carrier-grade availability controls to prevent cascading failures across distributed microservices:
Circuit Breakers
Protects against downstream outages (OpenAI, Gemini, WooCommerce, Slack). Fast-fails calls when a service is degraded, preventing thread pool starvation.
Request Idempotency
Strict Idempotency-Key caching ensures retried network requests, payment checkouts, and customer webhooks never execute twice.
Zero Secret Leaks in Logs
Structured JSON loggers scrub Bearer tokens, API keys (chatty_sk_, ck_, cs_, xoxb-), and credit cards in memory before outputting.
Deep Health & Readiness Probes
/health/live, /health/ready, and /health/deep provide instant health telemetry for Kubernetes, ECS, and APM monitors.
Kubernetes & Container Probes
Chatty provides standard enterprise probes for zero-downtime rolling deploys:
| Endpoint | Probe Type | Purpose |
|---|---|---|
GET /health/live | Liveness Probe | Verifies process event loop responsiveness. |
GET /health/ready | Readiness Probe | Verifies database connectivity and circuit breaker states before routing traffic. |
GET /health/deep | Diagnostics Probe | Returns comprehensive latency, cache status, and circuit breaker metrics for APM synthetic monitors. |
Compliance, Privacy & GDPR
Chatty empowers enterprise teams to meet global regulatory standards including GDPR, CCPA, and HIPAA privacy rules:
- Right to Access & Portability: Export all data associated with a bot, visitor session, or conversation thread via
GET /api/admin/gdpr/export. - Right to Erasure: Permanently purge an individual visitor's entire conversation and lead record using
DELETE /api/v1/conversations/{session_id}or directly through the Live Inbox. - Configurable Retention: Define automated data retention windows (e.g. 30, 60, or 90 days) to automatically drop historical chat logs.
Need an enterprise Data Processing Agreement (DPA) or SOC2 report? Contact our compliance team at security@personaliai.com.