audit-agent-code

audit-agent-code is a skill for Claude Code from William2333ZZ/trustshell. It costs 102 tokens per session (1,403 once invoked), scanned A, original, MIT.

A security-audit workflow for the ordinary application code around an AI agent, such as message channels, file handlers, configuration loaders, and sandbox controls. It looks for classic software flaws including path traversal, command injection, server-side request forgery, missing authentication, and unsafe data loading.

In plain words
What is it for?
Use it to inspect an agent's own source code for security weaknesses at untrusted-input boundaries and other framework-level control points.
Why use it?
It checks attack surfaces that an AI model's refusal behavior may not protect. An attacker can sometimes bypass the model by exploiting the surrounding framework code directly.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the trustshell plugin — 12 skills, 2 commands, 1 agent shipped together

Good fit Use it to inspect an agent's own source code for security weaknesses at untrusted-input boundaries and other framework-level control points.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/william2333zz/trustshell/audit-agent-code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add William2333ZZ/trustshell --skill audit-agent-code
Clone the repo
git clone --depth 1 https://github.com/William2333ZZ/trustshell

Made for: Claude Code.

Or install trustshell, the plugin that ships this one along with the rest of its 12 skills, 2 commands, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for audit-agent-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/william2333zz/trustshell/audit-agent-code/github.svg)](https://agentmods.dev/skills/william2333zz/trustshell/audit-agent-code)
Your own site
<a href="https://agentmods.dev/skills/william2333zz/trustshell/audit-agent-code"><img src="https://agentmods.dev/badge/skills/william2333zz/trustshell/audit-agent-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for audit-agent-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/william2333zz/trustshell/audit-agent-code"><img src="https://agentmods.dev/badge/skills/william2333zz/trustshell/audit-agent-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,403 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00102 $0.01403
Opus 5.5 $0.00041 $0.00561
Sonnet 5.5 $0.00020 $0.00281
Haiku 4.5 $0.00010 $0.00140

Measured 1mo ago against content hash 1435dd02c68a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

audit-agent-code scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **Python**: `os.system`, `subprocess(..., shell=True)`, `Path(x) / untrusted`, `open(untrusted,'w')`,
skills/audit-agent-code/SKILL.md · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Audit the agent's code · framework appsec

The companion to redteam-an-agent. That skill breaks the running agent through the model. This one breaks it through its own source code — the classic appsec layer the model's judgment never touches.

Written from real engagements: two well-defended agents whose LLM refused every prompt-injection attempt were broken here instead — one by an unauthenticated path traversal in a channel's file handler, one by a fail-open sandbox. The model can't defend a code path it never sees.

Why this layer

Flagship agents increasingly harden the LLM layer: they refuse injected commands, resist memory poisoning, even decode obfuscated payloads to inspect them. Good. But the code around the model — the channel that parses an inbound message, the handler that saves an attachment, the loader that reads config/skills, the toggle that turns the sandbox on — is ordinary software, and it is frequently not hardened. An attacker who reaches those paths bypasses the model entirely. Audit them like you'd audit any web app.

Authorization & safety

Follow every rule in ../README.md: authorized target, disposable environment, harmless proof, responsible disclosure. Reading source is safe; never run untrusted target code on a machine you care about.

The untrusted-input boundaries (where to look)

Trace every place external, attacker-influenced data enters, and follow it to a dangerous sink:

  • Channel / message handlers — attachment filename → file write (path traversal); sender_id → path; message body → any sink. These run on every inbound message, often before auth.
  • File / media / download tools — path built from untrusted input; write/read outside the intended dir; symlink following.
  • Config / skill / MCP / plugin loaders — untrusted content → deserialization (pickle, yaml.load, eval), dynamic import, or a path.
  • The security controls themselves — the sandbox toggle, the guard, the auth gate. Audit the control, not just the happy path.

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 86 lines · 102 tokens per session scan A 1435dd02c68a

Subscribe to this mod's changes

audit-agent-code is a skill published in the GitHub repository William2333ZZ/trustshell (1 stars, last pushed 3mo ago), licensed MIT. It adds 102 tokens to every session and 1,403 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.