Priority: P0 — launch blocker
Parent: #34
Promotes: D-3 from #32
Context
API Gateway throttling is global (100 burst / 50 rate) and does not bind per Cognito user. nodeChat passes user messages directly into Bedrock with no max length, and capture enforces only text.length >= 10 with no upper bound. A single authenticated user can trigger Bedrock spend unbounded.
Requirements
Input length caps (src/shared/validate.ts or per-handler)
Per-user rate limits
WAF additions
Acceptance criteria
- Synthetic test: 21 captures in one hour from a single user yields a 429 on the 21st
- Synthetic test: 50 001-char capture returns 413 without calling Bedrock
- CloudWatch metric emitted per rate-limit rejection for observability
References
Priority: P0 — launch blocker
Parent: #34
Promotes: D-3 from #32
Context
API Gateway throttling is global (100 burst / 50 rate) and does not bind per Cognito user.
nodeChatpasses user messages directly into Bedrock with no max length, andcaptureenforces onlytext.length >= 10with no upper bound. A single authenticated user can trigger Bedrock spend unbounded.Requirements
Input length caps (
src/shared/validate.tsor per-handler)text: hard cap 50 000 chars, return 413 abovemessage: hard cap 10 000 chars, return 413 abovePer-user rate limits
POST /capture: 20 / hour / userPOST /capturechat action: 60 / hour / userRetry-AfterWAF additions
AWSManagedRulesAnonymousIpList(optional — evaluate false-positive rate)Acceptance criteria
References