prompt-injection
БесплатноЗапускает вложенные скриптыНе проверенAudit applications for AI prompt injection, agent security, and LLM permission boundary vulnerabilities, including chatbots and agents hijacked by what they…
от briiirussell★ 541 звезда на GitHubОб этом скилле
Prompt Injection — AI/LLM Security Audit
Audit applications that use AI features, LLM integrations, or AI agents for prompt injection, privilege escalation, and authorization bypass vulnerabilities.
Cross-references: threat-modeling for design-time AI risk modeling on new AI features (before this skill applies); owasp-audit for the XSS / output-rendering patterns that overlap when LLM output reaches the browser (sanitize on render, JSON-LD breakout); api-audit for the API surface that LLM tools and MCP servers expose; ai-risk-management for the broader governance frame this skill sits within — prompt injection is the security slice of AI risk; AI RMF covers the rest (fairness, robustness, transparency, drift, lifecycle); agent-supply-chain-audit for the same hidden-instruction and tool-poisoning checks applied to the developer's own coding-agent environment (skills, plugins, hooks, MCP servers, CLAUDE.md / AGENTS.md); log-watch and personal-opsec for two everyday agents that read attacker-controlled text — a log-review agent and a personal inbox assistant.
Authorization
Audit only AI features, agents and integrations the user owns or is authorized to test. Source and prompt review needs nothing more. For live tests, use a test or staging deployment and test accounts, keep payloads benign (a canary string, not a real exfiltration), and never aim an injection at production users, third-party AI services you don't control, or other people's agents. See Boundaries.
Background
Prompt injection is the #1 vulnerability in LLM-integrated applications (OWASP Top 10 for LLM Applications 2025, LLM01). It occurs when untrusted input influences the instructions an LLM follows, causing it to ignore its system prompt, leak secrets, or take unauthorized actions.
Three attack classes:
- Direct injection: Attacker provides malicious input directly to the LLM (e.g., chat input, form field processed by AI)
- Indirect injection: Attacker plants malicious instructions in data the LLM will later consume (e.g., web pages, emails, documents, database records, tool outputs, RAG chunks)
- Cross-privilege injection: Lower-privileged user plants injection in shared data that a higher-privileged user's AI session consumes, escalating privileges through the AI layer
Methodology
Step 1: Map the AI Attack Surface
Identify every place the application uses AI. This includes direct LLM API calls AND higher-level AI features:
Grep for LLM API calls:
- openai, anthropic, cohere, replicate, ollama
- ChatCompletion, messages.create, generate, complete
- langchain, llamaindex, autogen, crewai
Also look for AI features that may not be obvious LLM calls:
- AI-powered search or recommendations
- AI content generation (summaries, descriptions, emails)
- AI chatbots or copilots embedded in the app
- AI-assisted form completion or auto-fill
- AI moderation or classification
- AI-driven workflow automation
- MCP (Model Context Protocol) servers and tool registrations
For each AI integration, document:
- What is the system prompt? Read it fully.
- What user input reaches the prompt? Trace every variable interpolated into the prompt template.
- What external data reaches the prompt? (RAG results, tool outputs, web scrapes, database records, file contents, emails)
- What actions can the LLM take? (tool/function calls, code execution, database writes, API calls, email sending)
- How is the LLM output used downstream? (rendered as HTML, executed as code, used in SQL, passed to another LLM)
- What user role/permissions context does the AI operate under? (its own service account? the requesting user's session? an admin context?)
Step 2: Audit Prompt Construction
Check how prompts are assembled. Look for:
Unsanitized interpolation:
# VULNERABLE — user input directly in prompt
prompt = f"Summarize this: {user_input}"
# VULNERABLE — external data injected without marking
prompt = f"Answer based on this context: {rag_results}"
Missing input/output boundaries:
# BETTER — clear delimiters separating instructions from data
prompt = f"""Summarize the text between the <document> tags.
<document>
{user_input}
</document>"""
Secrets in system prompts:
# VULNERABLE — API keys, database credentials, or internal URLs in system prompt
system = f"You are a helper. Use API key {API_KEY} to call..."
Check for these patterns:
- User input concatenated or f-string interpolated into prompts without delimiters
- RAG/retrieval results injected without sanitization or boundary markers
- Tool/function outputs fed back into prompts without validation
- System prompts containing secrets, internal URLs, or sensitive business logic
- Chain-of-thought or scratchpad content exposed to the user
Step 3: Inspect Instruction-Bearing Content for Concealment
The model reads bytes a human reviewer never sees. Run these checks on e
Установить prompt-injection в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGrepGlobWebSearchВложенные файлы
FAQ
Что делает скилл prompt-injection?
Audit applications for AI prompt injection, agent security, and LLM permission boundary vulnerabilities, including chatbots and agents hijacked by what they read: a malicious web page in a browsing agent, incoming emails, documents or tickets reaching an agent that can send replies, write files or call tools. Use when the user mentions 'prompt injection,' 'LLM security,' 'AI security,' 'jailbreak,' 'indirect prompt injection,' 'prompt leaking,' 'AI red team,' 'LLM vulnerabilities,' 'AI input validation,' 'system prompt extraction,' 'agent security,' 'MCP security,' 'AI permissions,' 'AI privilege escalation,' or needs to secure any application with AI features, AI agents, or LLM integrations.
Как установить скилл prompt-injection?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл prompt-injection запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic