Skip to content
Docs

Technical Architecture

┌────────────────────────────────────────────────────────────── ──┐
│ AGENTWATCH │
│ │
│ ┌──────────────────────────────────────────────────────── ─┐ │
│ │ API Gateway │ │
│ │ (OpenAI-Compatible REST API) │ │
│ │ POST /v1/chat/completions │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ WAF Layer │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ SQLi │ │ XSS │ │ Command │ │ Path │ │ │
│ │ │ Detect │ │ Detect │ │ Injection│ │ Traversal│ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ OAuth2 / OIDC Auth Layer │ │
│ │ (OIDC Discovery, JWKS Validation, SSO) │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ Security Layer │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Auth │ │ Rate │ │ Budget │ │ DLP │ │ │
│ │ │ Check │ │ Limit │ │ Check │ │ Scan │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ Schema Validation Layer │ │
│ │ (JSON Schema / AJV Request & Response Validation) │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ Plugin System │ │
│ │ (Sandboxed JS Hooks: pre/post request/response) │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ Provider Router / Load Balancer │ │
│ │ (Weighted, Header-based Routing, Failover, Cost Opt.) │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ Redis Distributed State (Optional) │ │
│ │ (Rate Limits, Circuit Breaker, Response Cache) │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ Observability Layer │ │
│ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │
│ │ │ Audit │ │ Metrics │ │ Alerts │ │ Analytics│ │ │
│ │ │ Log │ │Collection│ │ Engine │ │Dashboard │ │ │
│ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │ │
│ └─────────────────────────┬────────────────────────────── ─┘ │
│ │ │
│ ┌─────────────────────────▼────────────────────────────── ─┐ │
│ │ OpenAPI / Swagger Docs │ │
│ │ (Auto-generated spec, Swagger UI, 60s cache) │ │
│ └──────────────────────────────────────────────────────── ─┘ │
│ │
└──────────────────────────────────────────────────────────── ────┘