Appearance
Security & Compliance
AgentWatch is designed with enterprise security requirements in mind.
Core Security Principles
Prompt Content Never Stored
AgentWatch's primary security promise: prompt content is never stored persistently.
- The Edge Proxy extracts text from messages for transient in-memory PII scanning
- PII scanner returns risk tags (e.g.,
PII_EMAIL), not the content itself - Only token counts, model names, and risk tags are logged to Supabase
- Raw prompt text exists transiently in memory and is discarded
Tenant Isolation
All data is isolated by tenant at every layer:
- KV keys: Namespaced as
tenant:token:{token},tenant:plan:{tenantId} - Database: Row Level Security enabled on all tables
- Authentication: Tenant ID extracted from token, never from client headers
- Rate limiting: Per-tenant limits, not global
Timing-Safe Authentication
Token comparison uses crypto.subtle.timingSafeEqual to prevent timing attacks.
SOC 2 CC6.1 Compliance
| Control | Implementation |
|---|---|
| Logical access controls | Bearer token authentication on all endpoints |
| Authentication mechanism | Timing-safe token comparison, KV + static map dual lookup |
| Tenant isolation | KV namespace prefix prevents cross-tenant access |
| Encryption in transit | HTTPS via Cloudflare edge, TLS to Supabase |
| Encryption at rest | Cloudflare KV and Supabase encrypt data at rest |
| Audit logging | auth_events (SSO), api_access_log (API calls), llm_request_logs (telemetry) |
| Data retention | 90-day telemetry, 1-year auth logs, automated purge |
| Least privilege | SECURITY DEFINER on purge functions, service_role-only RLS policies |
Data Retention
| Data Type | Retention | Auto-Purge |
|---|---|---|
| Telemetry logs | 90 days | pg_cron daily |
| Auth audit logs | 1 year | pg_cron daily |
| API access logs | 90 days | pg_cron daily |
| Session state (KV) | 24 hours | KV TTL |
| Compliance reports | Indefinite | Manual |
Secrets Management
- API keys stored as Cloudflare Worker secrets (encrypted at rest)
TENANT_TOKEN_MAPis a Worker secret, not in source code- Supabase service role key is a Worker secret
- No secrets are logged or exposed in error messages
Security Contact
For security vulnerabilities, contact security@agent-watch.dev with "SECURITY" in the subject line. We will respond within 24 hours.