<aside> ⚠️
Honest framing. No app is "impossible to fail or get hacked." Two exposures here are irreducible: the pasted posting leaves the device to OpenRouter once that step was chosen, and no gate proves the absence of all bugs. What this design does is contain failure, layer security, and catch a class of regression by construction. Each control below is written now (documented); it becomes proven when the code and CI gates exist. Record of decision: ADR-0009.
</aside>
| Threat | Rank | Countermeasure | OWASP sheet |
|---|---|---|---|
| Prompt injection via the posting | High | Posting delimited as untrusted; system rule forbids following it; output schema-constrained; never reflected into an executable sink | LLM Prompt Injection Prevention |
| Model fabricates a hat or quote | High | Every hat validated against the framework; quote must occur verbatim in the posting; invalid dropped | Grounding (ADR-0007) |
| Secret exposure | High | Keys only in Vercel env, never in the client or logs; least privilege; rotation | Secrets Management |
| SSRF from the server | Medium | Egress allowlist = OpenRouter and Supabase only; no user-controlled URLs | SSRF Prevention |
| XSS on render | Medium | Posting and model output rendered as text, never HTML; strict CSP; SRI; secure headers | XSS Prevention, CSP |
| Cost abuse / denial of service | Medium | Posting length cap; rate limit per hashed IP + daily cap (fail-closed); hard OpenRouter spend cap | Denial of Service |
| Disclosure to the third party | Medium | Send only posting + resolved function, never identity; provider no-training setting on; never log the posting; tell the person at submit | User Privacy Protection |
| Vulnerable dependency | Medium | Pinned deps, audit + scan in CI, SBOM, reproducible snapshot with checksum | Vulnerable Dependency Management |
Eliminated by design: no accounts means no auth, session, or access-control surface. The decode cache is keyed by a content hash with no user identifier, so there is nothing to enumerate.
Each countermeasure ships an executable @security test in the shared feature index, wired into CI. Until those run, each is documented, not proven.