Skip to main content

Threat model

Français : ../threat-model.md

Assets​

AssetWhere
Tenant data (conversations, documents, memory, embeddings)PostgreSQL (RLS), Qdrant, S3 storage
Secrets (LLM provider keys, connector OAuth tokens, API keys)OpenBao, or encrypted with EAI_MASTER_KEY
System prompts and canariesControl Plane, eai.domains.llm.guard
Audit chainPostgreSQL, verified by eai.domains.observability.audit_api.verify
Budget and quotas (LLM cost)Control Plane, LiteLLM
Images and delivery chainHarbor, Forgejo and GitLab CI, GitOps

Trust boundaries​

  1. Internet to portal and APISIX gateway (TLS, Coraza WAF + OWASP CRS).
  2. Gateway to Control Plane API (only peers in EAI_TRUSTED_PROXIES may set X-Forwarded-For and X-SPIFFE-ID).
  3. Control Plane to databases (TLS, sslmode=verify-full, per tenant RLS).
  4. Control Plane to LLM providers, tools, MCP, connectors (egress filtered by eai.security.egress and Cilium).
  5. Untrusted content (documents, tool results, web pages) to the model (injection detection, nonce wrapping).
  6. Model output to the user (link and image filtering, canary).
  7. Source code to production (CI, signing, SBOM, Kyverno).

Attacker profiles​

ProfileTypical goalMain controls
Anonymous internetDenial of service, brute force, scanningWAF, AnonymousRateLimitMiddleware, EAI_RATE_LIMIT_AUTH_FAILURES_PER_MINUTE, LimitsMiddleware
Malicious tenant userIDOR, role escalation, SSRF through a tool, cross tenant accessRLS, require_role, set_clause with allowed columns, EgressPolicy
Compromised agent or toolExfiltration, internal callsEgress guard, per tenant egress_allowed_hosts, secrets outside prompts, safe_exec.run
Poisoned document or promptIndirect injection, exfiltration through markdown linkeai.domains.privacy.injection.detect, guard.wrap_messages, OutputGuard, StreamGuard
Compromised providerMalicious answers, leakageOutput treated as untrusted, OutputGuard, Cilium deploy/cilium/egress-providers.yaml
InsiderReading secrets, tampering with auditOpenBao, verifiable audit chain, Kyverno, code review and CI

STRIDE per layer​

S = spoofing, T = tampering, R = repudiation, I = information disclosure, D = denial of service, E = elevation of privilege.

LayerMain threatsControls
PortalS: session theft; T/I: XSS; E: open redirectportal/src/middleware.ts (CSP with nonce), buildCsp, safeHref, safeReturnTo, SECURITY_HEADERS in portal/src/lib/security.ts
API gateway and WAFD: flooding; T: injection payloadsdeploy/apisix/apisix.yaml, deploy/apisix/config.yaml, waf-gateway
Control Plane APIS: forged JWT; E: IDOR; D: huge bodies; I: error leakageeai.auth, eai.security.limits, eai.security.ratelimit, eai.security.headers, eai.errors
LLM gateway and providersI: system prompt leakage; D: costguard.add_canary, quotas, EAI_RATE_LIMIT_GATEWAY_PER_MINUTE
Agent runtimeE: hijack through injection; I: exfiltrationprompt_injection_mode, untrusted_content_wrapping, output_links
Tools, MCP and connectorsI/E: SSRF, DNS rebinding; T: forged webhookseai.integrations.outbound, eai.security.egress.GuardedTransport, signatures (connectors.service._parse_signature, channels.service._check_signature)
DataI: cross tenant access; T: SQL injectionRLS through eai.db.tx, ident, qualified, frag, set_clause, like_pattern, int_limit
RAG and memoryT: poisoned documentsInjection detection at ingestion (test_rag_injection_risk_and_ingestion_flag)
Multimodal and realtimeE: command injection through ffmpegsafe_exec.media_input, safe_exec.run (argument list, no shell)
Network and DNSI: DNS tunneling, cloud metadata; S: ARP/DNS spoofingCilium default deny and DNS L7, network-dns-hardening, pod-security
Supply chain and CI/CDT: trapped image or dependencyTrivy, SBOM and signing (sbom-sign), Kyverno, ci-security-gates