Code RoomDeploy script shell injection
MediumPrep Room Coding #4258

Deploy script shell injection

Vibe & agenticSecurityMid–Senior~18 min

As the staff engineer setting up guardrails, you're reviewing the infra-automation scripts your team has started generating with agents. This deploy helper is typical of what's landing in PRs across the org:

It works in the demo. What's dangerous here, and what guardrail do you institute so agent-generated shell/infra code can't ship this class of problem across the team?

Implement
build_deploy_command(service: str, version: str, host: str, allowed_services: list[str]) → list[str]
Examples
in["web","v1.2.3","host1.internal",["web","api"]]out["ssh","deploy@host1.internal","/usr/local/bin/deploy","web","v1.2.3"]
in["web; rm -rf /","v1","host1.internal",["web","api"]]out["error:service_not_allowed"]
in["web","../../etc","host1.internal",["web","api"]]out["error:invalid_version"]
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.