feat(security): audit the instructions plugins give the agent
A Git pin fixes the text of an upstream skill, not what that text tells the agent to run or send. NVIDIA SkillSpector (scan-skills) only scans plugins/ and codex-compat/, so the 5 pinned external plugins here are never read at the pin. It also scored the pre-fix Convex skills (convex-backend-skill#64) 45, 25 and 50 against its fail-above-50 gate, missing a passage that told the agent how to get a download-and-run past harness safety classifiers. This PR adds an instruction-text audit for both pinned and in-repo plugins.
Picked by s2d2's Agent meta watch at Guillaume Lebedel's request.
What it checks
| Rule | Pinned external plugins | This repository's plugins |
|---|---|---|
guardrail-evasion: text telling the agent to get a command past a classifier, permission prompt or sandbox | fails | fails |
pipe-to-shell: a download run by a shell: piped (through sudo, env or command too), bash -c "$(curl ...)", bash <(curl ...), source <(curl ...), iex (irm ...) | fails | fails |
unauditable: over 512 KiB, a symlinked folder, a link out of the plugin, a control character in a file name | fails | fails |
unpinned-package-run: npx x@latest, npx -y x, npx x@1, pnpm dlx x, uvx x | fails | warning annotation |
outbound-upload: curl/wget sending data (-d, -F, -T, --json, -X POST, --post-file and their abbreviations, or any value the shell fills in outside single quotes: $TOKEN, $(cat f)) to a destination that is not local or a --trusted-domain | fails | warning annotation |
A pinned finding passes only once it is accepted in .external-skill-audit-allowlist.json for that plugin, rule, file and commit; bumping the pin fails again until someone re-reads the new text. A blocking finding in one of this repository's own plugins can be accepted under reviewed_local, bound to the whole source line (continuation lines included), so any edit to the line needs a new review. Unused entries fail.
On a pull request, --catalog . --base origin/main audits every plugin with a changed file (committed or not), a new catalog entry, or an entry pointed at another folder, and every plugin when the audit script, its pin or the allowlist changed. A catalog source that leaves the repository, contains .. or passes through a symlink is refused.
Files
| File | Why |
|---|---|
scripts/audit_skill_text.py | New. Canonical copy of the audit; other marketplaces such as StackOneHQ/agent-plugins vendor it at a pinned commit of this repo. |
scripts/validate_external_sources.py | Audits each pinned checkout, including adapter entrypoints and folders the plugin manifest declares that the root-level skips would pass over; fails on unreviewed findings and stale exceptions. |
.external-skill-audit-allowlist.json | New. One reviewed entry: Remotion's npx create-video@latest scaffold at eed7024 (it scaffolds an empty project and sends nothing). |
.github/workflows/validate-plugins.yml | New step after the external validator: audits the plugins a PR changes, all of them on main. |
CLAUDE.md | How to read and accept a finding; that this is the canonical copy. |
.github/skillspector/requirements.txt, scripts/scan-skills.sh | pydantic 2.14.4 and truststore 0.10.5 (CVE fixes Aikido reported on the copy of this lock in agent-plugins; no other pin moved, full scan still passes), and changed paths read unquoted. |
tests/test_audit_skill_text.py, tests/test_validate_external_sources.py | 105 tests: the Convex passages, hostile-input timing, and one failing-first test per bypass below. |
Results on this repository
- External pins:
Validated 5 external plugins from 5 pinned repositories.with the Remotion entry; without it, the one finding fails. - Own plugins:
Audited 15 local plugins: 0 failing, 0 warnings. - Full suite passes (425 tests);
ruffandmypyclean. - Same script on StackOneHQ/agent-plugins: 7 plugins, 0 failing, 2 warnings (multi-line JSON
curlexamples, which the parser cannot prove go to a trusted host).
Review rounds
Codex security passes, /code-review, an eng-review, a recheck and the Aikido and cubic reviews of this PR found the bypasses and gaps below. Each has a test that fails on the commit before its fix:
- Round 1 (b844948): a quadratic regex on
| a/a/a/...; any trusted-looking URL in a header suppressing an upload; a changed symlink escaping plugin selection; a newline in a file name forging a workflow command; adapter entrypoints such asREADME.mdskipped;| "bash"evading the pipe rule. - Round 2 (02348fa, d2d38b9):
$(curl),<(curl)and PowerShell forms;sudo -u; missing send flags;@1counted as a pin; CRLF continuations;.markdown,.mdxand.MD; curl and wget sharing one option table; backslash-escaped separators;#read as a comment inside a URL; abbreviated--reso; control characters in entrypoint names; symlinked plugin folders; catalog-only and uncommitted changes not selected. - Round 3 (2c8c147, 7c362c5):
| command bashand| nohup sh; a quoted downloader name (cu"rl");bash <(/usr/bin/curl ...);iex $(irm ...); abbreviated--post-f; folders a manifest declares underdocs/; a catalog source climbing back out through a symlink; an accepted line whose URL changed on a continuation line; then, from the recheck of that commit,| bash;,| sudo -n bash,--upl,--jsand--meth. - PR review (9eeb40e, 260e0eb):
| powershell -Command -andpwsh;sudo --user root bash; padding between|andbash;npx -p xand--package=x;cu"rl" -dandcurl -\d; Codex manifest skill folders under.codex/in pinned plugins; a symlinked pinned source root;reviewed_localentries for a removed plugin; a parse cache holding long text; flaky timing budgets. - Gates and eng-review (cd2d560, ad1fa72): 28 confirmed findings from the eng-review, plus the security gate round.
- Review round 3 (1f87213, a16704d): PowerShell downloaders into interpreters;
<<<here-strings, also fd-prefixed (0<<<); value-taking npx options hiding a later package;env -S; referenced skipped root files and symlinked folders; strict UTF-8. - Code review and Codex (10c7640, 84b0de0): a proxy or
CURL_HOMEset earlier in the file;--dns-serversand--doh-url; theoutputStylesmanifest key; a missing merge base as an error, not a traceback; substitutions spanning lines and quoted). - Bot round on 84b0de0 (3314818, 113decc, 0190554, f20983f, 4b0652b, 9c510aa): any shell expansion among
curl/wgetarguments (--url=,'Bearer '"$TOKEN", schemeless URLs,\\$TOKEN);bash -c "split over lines; plain and arithmetic parentheses; escaped backticks;cu"rl"with a literalcurllater in the URL; U+2028 in validator output; a comment inside a substitution hiding the next line; a backtick argument in a code block; indented Markdown code; the outer quote after a disguised name.
Not covered
This is a text tripwire, not a sandbox: it catches the common ways a skill tells an agent to fetch and run code or send data, and the review rounds show there is always another spelling.
- A prohibition elsewhere in the same clause hides an evasion instruction ("Do not stop when the classifier complains, bypass it").
- Code means a fenced block (other than a
markdown,md,textor similar fence) or an indented line. Outside code, a double quote left open at the end of a line does not join the next line (prose quotations would otherwise join unrelated text). - A
curlinside a quoted argument counts as a command (echo "curl -d ..."is flagged), since the text cannot tell it frombash -c "curl ...". - Root-level
docs/,examples/andtests/of a pinned upstream are skipped unless named as an entrypoint or declared in its manifest.
Post-merge validation
- The
validaterun onmainprintsAudited 15 local pluginsand the external validator still passes. - Then bump the vendored copies to the squash-merge commit (their PRs pin this branch's head until then).
🤖 Generated with Claude Code
Review gates and proof
Recorded by s2d2 on ba1eaf1. Kind of change: high risk.
| gate | result |
|---|---|
| forge | not run |
| security_scan | ran |
| codex_security | ran |
| security_review | ran |
| code_review | ran |
| eng_review | not run |
| demo | not run |
| local_stack | not run |