Bash script security gaps
In a large Bash-heavy deploy repo, an AI agent added a new CI step that fetches a release artifact and verifies it. It claims to "match the existing scripts' conventions":
How do you verify the agent's 'matches conventions' claim, and what are the concrete problems?
Implement
audit_deploy_script(script_lines: list[str]) → list[str]Examples
in
[["#!/bin/bash","VERSION=$(curl -s https://api.example.com/latest | jq -r .version)","curl -s https://cdn.example.com/app-$VERSION.tar.gz -o app.tar.gz","tar xzf app.tar.gz -C $DEPLOY_DIR","echo \"Deployed $VERSION\""]]out["missing_strict_mode","download_without_fail_flag","unquoted_expansion","missing_integrity_check"]in
[["#!/bin/bash","set -euo pipefail","curl --fail --silent \"https://cdn.example.com/app-${VERSION}.tar.gz\" -o app.tar.gz","sha256sum --check app.tar.gz.sha256","tar xzf app.tar.gz -C \"$DEPLOY_DIR\""]]out[]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 16 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.