Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ai-security

БесплатноЗапускает вложенные скриптыНе проверен

Static scan of AI/ML code for prompt injection, unsafe model loading, data poisoning, model extraction and insecure serving, plus an agent and tool-use threat…

borgheiот borghei★ 1 250 звёзд на GitHub

Об этом скилле

AI Security

Category: Engineering Domain: AI/ML Security

Overview

The AI Security skill provides specialized threat scanning for AI and machine learning systems. It identifies vulnerabilities unique to AI workloads including prompt injection, data poisoning, model extraction, adversarial inputs, and insecure model serving configurations.

When to Use

  • Reviewing an LLM feature, RAG app, agent or model-serving API before release.
  • Auditing an ML pipeline's data sources and model loading.
  • Adding a pre-deployment gate for AI-specific code risks.
  • Threat-modelling an agent that calls tools or MCP servers.

Clarify First

Before running the scan, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

  • Scan target & path: which codebase or directory to analyze (sets --path and what gets scanned).
  • Threat categories: all, or specific (prompt-injection, data-poisoning, model-extraction, adversarial-input, insecure-serving) (sets --category).
  • Severity threshold & context: full audit vs pre-deployment gate (sets --min-severity and whether zero high/critical findings is a hard gate).

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Quick Start

# Scan a codebase for AI-specific security threats
python scripts/ai_threat_scanner.py --path ./my-ai-project

# Scan with JSON output
python scripts/ai_threat_scanner.py --path ./my-ai-project --format json

# Scan only for prompt injection vulnerabilities
python scripts/ai_threat_scanner.py --path ./src --category prompt-injection

# Scan with severity threshold, skipping tests and fixtures
python scripts/ai_threat_scanner.py --path ./src --min-severity high --exclude 'tests/*' --exclude '*_fixture.py'

# Bundled vulnerable sample: 8 findings (2 critical), exit 1
python scripts/ai_threat_scanner.py --path assets/sample_vulnerable_app.py

Exit codes. 0 no critical or high finding; 1 at least one critical or high finding; 2 the path does not exist.

Tools Overview

Tool Purpose Key Flags
ai_threat_scanner.py Scan code for AI-specific security threats --path, --category, --min-severity, --exclude GLOB, --format

ai_threat_scanner.py

Performs static analysis of source code by matching regular expressions one line at a time. A finding means a line matched a known risky pattern. The scanner cannot see that something is absent (for example rate limiting, authentication, integrity checks or signature verification), so it flags the places where those controls belong and leaves the confirmation to you:

  • Prompt Injection: Flags user input placed into prompts through f-strings, concatenation or .format(), chat message lists extended with user content, and template engines rendering user input
  • Data Poisoning: Flags data loaded from remote URLs or buckets, training and fine-tuning calls (as a prompt to check data validation), pickle/joblib/torch.load calls, and scraped data feeding a training set
  • Model Extraction: Flags confidence scores or logits returned from inference, inference routes (@app.post("/predict") and similar) so you can confirm rate limiting and authentication exist, model weights returned through an API, and error handling that mentions model internals
  • Adversarial Input: Flags predict/classify/detect calls with no validation keyword on the same line, request data converted straight to arrays or tensors, and images opened from uploads or requests
  • Insecure Model Serving: Flags pickle.load/loads on file, request or body data, permissive CORS, debug mode left on, and eval/exec with user-controlled input

Agent and tool-use threats (review by hand)

The scanner sees single lines of code; the highest-impact risks in agents are about data flow and authority, so check these yourself for any system where a model calls tools:

  • Indirect prompt injection. Tool results, retrieved documents, web pages, emails and file contents are untrusted input. Does the agent treat instructions inside them as data? Can a fetched page make it call another tool?
  • Tool and MCP server trust. Tool descriptions are part of the prompt. Is every MCP server from a source you trust, pinned to a version, and reviewed for descriptions that try to steer the model? Do two servers expose confusingly similar tool names?
  • Excessive agency. Does each tool have the narrowest scope it needs (read-only where possible, per-user credentials, no shell)? Are irreversible actions (send, pay, delete, deploy) behind a human confirmation?
  • Data exfiltration paths. Can the model put secrets or user data into a URL, image link, email or outbound tool call? Is outboun
Полный SKILL.md на GitHub

Установить ai-security в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/sample_vulnerable_app.pyreferences/ai-threat-landscape.mdscripts/ai_threat_scanner.py

FAQ

Что делает скилл ai-security?

Static scan of AI/ML code for prompt injection, unsafe model loading, data poisoning, model extraction and insecure serving, plus an agent and tool-use threat checklist. Use when reviewing an LLM app, model API or ML pipeline for security.

Как установить скилл ai-security?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ai-security запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить ai-security с