Skip to content

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.

  1. The Edge Proxy extracts text from messages for transient in-memory PII scanning
  2. PII scanner returns risk tags (e.g., PII_EMAIL), not the content itself
  3. Only token counts, model names, and risk tags are logged to Supabase
  4. 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 ​

ControlImplementation
Logical access controlsBearer token authentication on all endpoints
Authentication mechanismTiming-safe token comparison, KV + static map dual lookup
Tenant isolationKV namespace prefix prevents cross-tenant access
Encryption in transitHTTPS via Cloudflare edge, TLS to Supabase
Encryption at restCloudflare KV and Supabase encrypt data at rest
Audit loggingauth_events (SSO), api_access_log (API calls), llm_request_logs (telemetry)
Data retention90-day telemetry, 1-year auth logs, automated purge
Least privilegeSECURITY DEFINER on purge functions, service_role-only RLS policies

Data Retention ​

Data TypeRetentionAuto-Purge
Telemetry logs90 dayspg_cron daily
Auth audit logs1 yearpg_cron daily
API access logs90 dayspg_cron daily
Session state (KV)24 hoursKV TTL
Compliance reportsIndefiniteManual

Secrets Management ​

  • API keys stored as Cloudflare Worker secrets (encrypted at rest)
  • TENANT_TOKEN_MAP is 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.