Unsafe pickle deserialization from Redis
An AI assistant wrote this Python worker that pulls cached task definitions from Redis and reconstructs them. The values were written by an upstream service. It runs cleanly in dev. Review it.
Implement
load_task_definition(raw_blob: str, allowed_task_types: list[str]) → strExamples
in
["type=email_send;retries=3;payload=abc",["email_send","report_build"]]out"ok:email_send:3"in
["type=shell_exec;retries=1",["email_send"]]out"reject:type"in
["__reduce__=os.system",["email_send"]]out"reject:field"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 18 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.
Run or narrate your approach, then ask the coach.