Skip to content

The thesis

Read it before you run it

A model’s output is executed directly against your machine with your privileges, usually pasted without being read. A person who can read a generated script first is the entire mitigation — and reading one requires knowing the expansion order.

The cleanup script

You asked for a script that clears a build directory. This is what came back.

#!/bin/sh

# Clean the build output
rm -rf "$BUILD_DIR/"
echo "cleaned"

Before it runs — 1 of 2

BUILD_DIR is not set. What does line 4 remove?

Before it runs — 2 of 2

Which single line, added at the top, would have stopped it?

Answer first.
$

Files

The files in the sandbox, with their modes, link counts and sizes
ModeLinksSizeName
drwxr-xr-x4project/
-rw-------166.env
-rw-r--r--144README.md
drwxr-xr-x2build/
-rw-r--r--16cache.tmp
-rw-r--r--19output.bin
-rw-r--r--1100notes.txt
drwxr-xr-x2src/
-rw-r--r--129lib.sh
-rwxr-xr-x141main.sh