Code RoomHardcoded API key fallback
MediumPrep Room Coding #4427

Hardcoded API key fallback

Vibe & agenticSecurityMid–Senior~15 min

This Lambda (Python) was generated to call a partner API. It fetches the API key from Secrets Manager on every request, and a teammate also notices a fallback the AI added. Identify both problems.

Implement
secret_fetch_times(invocation_times: list[int], ttl_seconds: int) → list[int]
Examples
in[[0,10,300,305,700],300]out[0,300,700]
in[[1,2,3],0]out[1,2,3]
What a strong answer looks like

Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.

0:00 of about 15 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.