Code RoomGuardrails agents actually honor
MediumPrep Room Coding #4379

Guardrails agents actually honor

Vibe & agenticAlgorithms & data structuresMid–Senior~18 min

Your team's Rust codebase has hard rules: all errors flow through a custom `AppError` type via `thiserror`, no `unwrap()` in non-test code, and all public functions are documented. You're giving an AI agent a task to add a new metrics-ingestion endpoint. How do you keep the agent inside these guardrails so its output doesn't need a convention-cleanup pass on review? What's the difference between a guardrail the agent will actually honor and one it'll quietly violate?

Implement
check_guardrails(lines: list[str]) → list[str]
Examples
in[["/// Ingests one metrics batch.","pub fn ingest_metrics(body: String) -> Result<usize, AppError> {"," let parsed = parse_batch(body).unwrap();"," Ok(parsed)","}"]]out["3:unwrap_in_prod"]
in[["pub fn ingest_metrics(body: String) -> Result<usize, AppError> {"," let parsed = parse_batch(body)?;"," Ok(parsed)","}"]]out["1:missing_doc"]
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.