Rate limiting lab
Secure rate limiting operations
Least privilege, negative probes, and a timed rollback beat a security essay about layered token-bucket limiter for multi-tenant RAG API.
1Learn the idea
Read
Least privilege for this lab
Separate runtime and operator roles for layered token-bucket limiter for multi-tenant RAG API. Runtime may only perform the narrow actions that platform SRE stopping noisy neighbor tenant StormCo needs; operators get audited break-glass with TTL. Encode a negative probe that denies the privilege trick related to Redis down → fail-open floods provider → shared 429s.
Read
Data and secret hygiene
Redact prompts/PII at collection. Secrets enter via a manager or workload identity — never source, fixtures, or exception strings. Incident RL-FAILOPEN-61 should be impossible if these controls hold. Output allowlists and schema checks stay in force on error paths.
Read
Implementation artifact
Read
API keys map to tenants server-side; client-supplied tenant header is ignored.
Read
Rollback drill
Rehearse the rollback or kill switch timed against a clock. Record actor, reason, prior revision/secret/flag, and verification query. Invariant reminder: tenant RPM soft=60 hard=100; global 5k RPM; 429 includes Retry-After.
Read
Stage depth
Abuse cases unique to this lab include the privilege path implied by Redis down → fail-open floods provider → shared 429s. Prove a read-only role cannot mutate. Break-glass tokens expire; leftover tokens fail the drill. Dependency pin/digest story matters when images or models move under you. Document how to rotate the credential that layered token-bucket limiter for multi-tenant RAG API uses without a full outage window longer than your dual-run plan. Security evidence is part of ship, not an appendix nobody reads.
Read
Field notes for `rate-limiting-lab` / `security-ops`
List network egress destinations and justify each. Ensure debug endpoints are off by default in the shipping config. Verify that error responses do not echo secrets or raw stack frames to clients. For multi-tenant paths, add a cross-tenant probe fixture. Time the rollback drill twice — once with the author, once with a peer. Store the drill transcript beside the threat notes for the incident id. In this chapter the product is layered token-bucket limiter for multi-tenant RAG API, the human stakeholder is platform SRE stopping noisy neighbor tenant StormCo, and the incident id you design against is RL-FAILOPEN-61. Re-state the oracle in your notes — StormCo at 200 RPM gets 429 after burst; Globex at 40 RPM unaffected — and keep the invariant visible: tenant RPM soft=60 hard=100; global 5k RPM; 429 includes Retry-After. Track 429_ratio_by_tenant and provider_429_ratio ≤ 0.01 as the scoreboard. Surface under change control: POST /v1/rag/answer. If you only have forty minutes, finish the fixture for Redis down → fail-open floods provider → shared 429s before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Go deeper
Before you start
Why this matters
Threat-model layered token-bucket limiter for multi-tenant RAG API in five minutes: who can change config, who can read secrets, what a malicious payload tries to do. Write one negative probe that must yield deny with zero side effects. Reference RL-FAILOPEN-61 as the story you refuse to repeat.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.