agentleFS
hemapriyan-rkhemapriyan-rk/claude-rigor-skills/skills/ml-security-audit/SKILL.md

ml-security-audit

Skill1 starsChanged 50 days agoMITView on GitHub

Audit code for adversarial-ML and model-security risk — evasion, data poisoning, model/IP extraction, prompt injection in LLM-agent code, and sensor spoofing in fusion pipelines. Use for any inference pipeline, training loop, LLM agent with tool access, or sensor-fusion/vision code, especially before treating it as production-ready. This is distinct from general security review — it targets attack classes specific to ML systems.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Only report attack classes that are actually reachable given the code's real data flow — don't pad the report with theoretical ML-security …

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ML Security Audit

General code review checks whether the code does what it's supposed to. This checks whether the model can be steered, stolen, or fed false confidence by an attacker who never touches the codebase at all — the attack surface is the data, not just the code.

Map the attack surface first

Before checking anything, find every point where data an attacker could influence reaches a model: a sensor reading, a user upload, an API request body, a retrieved document, another agent's tool output feeding an LLM's context. Each of these is a separate surface to check below.

Check each relevant attack class

  1. Evasion — is there any input validation or sanity bound before inference, or does raw input go straight to the model? Is there confidence thresholding, and does the code have a defined fallback for low-confidence or out-of-distribution predictions — or does it silently trust whatever the model outputs? A safety-relevant system with no low-confidence fallback is a critical finding, not a style note.
  2. Poisoning — if the pipeline retrains or fine-tunes on live/user-submitted data, is there any provenance or anomaly check before that data enters the training set? "We retrain nightly on production data" with no filtering is an open poisoning vector.
  3. Model / IP extraction — if the model is exposed as an API or on-device artifact, is there rate-limiting, query budgeting, or output perturbation against extraction via repeated querying? For on-device deployment (a model file shipped inside a mobile app package or firmware image), is the model file itself protected at all, or trivially extractable once the package is unpacked?
  4. Prompt injection (LLM-agent code specifically) — does tool output, retrieved content, or any external document get concatenated into the model's context in a way that lets attacker-controlled text be read as instructions rather than data? Check for an actual structural separation between "trusted instruction" and "untrusted data" in how the prompt is assembled — not just a comment saying to be careful.
  5. Sensor spoofing (fusion/physical systems) — for any multi-sensor decision system, does a single spoofed or failed sensor override the fused decision, or is there cross-sensor consistency checking before acting on the result? Relevant to any vision-based or multi-modal sensing system — surveillance, autonomous navigation, biometric authentication, industrial monitoring, and similar.

Output format

## [Attack class]
- Surface: [exact code location / data path]
- Exploit scenario: [concretely, what an attacker does and what they get]
- Current mitigation: [none / partial / description]
- Fix: [specific]

Only report attack classes that are actually reachable given the code's real data flow — don't pad the report with theoretical ML-security trivia that doesn't apply to this pipeline's actual inputs.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.