# AI/ML Security Assessment

> Use when assessing AI/ML or LLM systems for prompt injection, jailbreak, model inversion, data poisoning, or agent tool abuse — maps findings to MITRE ATLAS and recommends guardrails.

- Skill: `aashutosh396/ai-ml-security-assessment` (Agent Skill)
- Install (CLI): `npx get-skill add aashutosh396/ai-ml-security-assessment`
- Raw SKILL.md: https://api.skillmd.com/api/skills/aashutosh396/ai-ml-security-assessment/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: aashutosh396 (https://skillmd.com/u/aashutosh396)
- Updated: 2026-11-24
- Page: https://skillmd.com/skills/aashutosh396/ai-ml-security-assessment

---


# AI/ML Security Assessment

Security assessment for LLMs, classifiers, and agents — distinct from general app security and infra anomaly detection. Static signature matching assesses inputs *before* they reach the model. Gray-box/white-box testing requires written authorization.

## Prompt Injection Signatures (→ ATLAS)
| Signature | Severity | ATLAS | Examples |
|---|---|---|---|
| direct_role_override | Critical | AML.T0051 | system-prompt override, role-replacement |
| indirect_injection | High | AML.T0051.001 | template tokens `<system>`,`[INST]`,`###system###` |
| jailbreak_persona | High | AML.T0051 | "DAN mode", "developer mode" |
| system_prompt_extraction | High | AML.T0056 | "repeat your initial instructions" |
| tool_abuse | Critical | AML.T0051.002 | "call delete_files", "bypass approval" |
| data_poisoning_marker | High | AML.T0020 | "inject into training data" |

**Indirect injection (RAG/agents):** all retrieved external content (web pages, docs, email, API responses) is untrusted user input, never trusted context.

## Jailbreak Taxonomy
Persona framing · hypothetical framing · developer mode · token manipulation (base64/rot13) · many-shot (volume-detected). Test known templates through the scanner before prod; any `critical` template needs guardrails first.

## Model Inversion Risk by Access
- **white-box** (Critical 0.9): gradient inversion, membership inference via logits → remove gradient access, differential privacy.
- **gray-box** (High 0.6): confidence-based membership inference → disable logit outputs, rate limit.
- **black-box** (Low 0.3): label-only, high query volume → monitor systematic querying.

Detect membership inference: high query volume from one identity, perturbed repeats, grid-search coverage, confidence-boundary probing.

## Data Poisoning Risk by Fine-Tuning Scope
fine-tuning High 0.85 (audit examples, provenance) · rlhf High 0.70 (vet contributors) · retrieval-augmented Med 0.60 (validate before indexing) · pre-trained-only Low 0.20 · inference-only Low 0.10. Signals: trigger-pattern behavior, distribution deviation per entity, systematic class bias, training-loss anomalies.

## Agent Tool Abuse
Direct injection · indirect hijack via retrieved docs · approval-gate bypass · privilege escalation. Mitigations: human approval gates for destructive/exfil calls; minimal tool scope; validate tool params before invocation; audit-log every call with triggering prompt; filter tool outputs.

## Guardrail Patterns
- **Input:** injection-signature filter, embedding similarity to jailbreak templates, length limit, dedicated content-policy classifier.
- **Output:** redact system-prompt leakage, PII detection, URL/code validation.
- **Agent:** tool-param validation, human-in-loop gates, resource allowlist per session, mid-session role-change detection.

## Workflow (CI gate)
Run seed + domain prompts; review injection_score and ATLAS coverage. Critical = block deploy. High = deploy with monitoring, remediate in sprint.

## Anti-Patterns
Testing only published templates (DAN/STAN already blocked) · treating static matching as complete (add red-team + semantic filter) · ignoring indirect injection for RAG · not testing with production system prompt · no output filtering · assuming model updates fix injection (it's input validation, fix at app layer) · skipping authorization for gray/white-box.

