Regex and string intercept rules were matched on the raw tool input,
but Bash removes quotes and backslashes and decodes $'...' before it
runs a command: r\m -rf, r''m -rf, rm -r''f, rm -R -$'f' and a
backslash-newline inside a word all ran rm -rf while the built-in
recursive-force-delete rule did not match, and so did rm -rf on the
line after another command, because the JSON escape of the newline
glued an "n" to the command name.
A deny or ask rule on a Bash call now also meets the command decoded
with the argv word decoder, the simple commands joined by "; ". Allow
rules are still matched on the text as written. The word decoder now
decodes ANSI-C strings instead of treating them as opaque, which also
lets argv deny and ask rules meet $'nmap' and bash -c $'nmap x'.
- Priority 95-96 -> 70-72, below the built-in destructive denies (80/90/100),
so 'pip install x && curl -X DELETE ...' still hits the DELETE deny instead of
being downgraded to an approval (intercept.Match is priority-DESC).
- apply-intercept-rules.sh no longer sources .env as shell (code execution / $
expansion). It reads POSTGRES_USER/DB from the postgres container's own env.
- Add a 'deny' rule for reading /app/keys, /proc/<pid>/environ and the DSN, so
the key/DSN prohibition is enforced, not prose.
- Close named regex bypasses (pip3.12, git -c, bash -c "$(curl)", curl | tar);
document the remaining open bypasses, the false positive, and the target-only
limitation in the skill.
- Add hardening/rulecheck: compiles the patterns from the SQL (RE2) and asserts
positives, closed bypasses, and documented open cases (18 cases, 0 failures).
Add opt-in intercept rules (action ask, timeout -> deny) that pause the agent
before it downloads from code/exploit hosts, runs git clone, installs packages,
or pipes remote content into a shell, plus a third-party-code-review skill
(hash, blocklist-check, read and summarize the code before running it).
Nothing is seeded: the rules change no behavior until hardening/apply-intercept-rules.sh
is run, and code the agent writes itself is not gated -- only the point where
untrusted code enters. Regex patterns are RE2 (verified to compile); the apply
script is idempotent.