All skills
hardw00t avatar

/llm-security

@f9bb3b2

LLM and AI application security testing skill for prompt injection (direct, indirect, multimodal), system-prompt extraction, RAG poisoning, memory poisoning, MCP server injection, skill-file injection, agentic tool misuse, computer-use UI injection, and excessive agency. Authorization required — this skill tests AI systems you are explicitly permitted to assess. Triggers on requests to test LLM / AI-agent / RAG / MCP / computer-use security, perform prompt injection, extract system prompts, poison RAG or memory, audit agent tool use, or evaluate AI guardrails.

Use this Skill: https://skilld.dev/gh/hardw00t/ai-security-arsenal/llm-security

This session only. Nothing lands on disk.

workflowsindirect_injection_testing.md

≈1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Workflow: Indirect Prompt Injection Testing

Tests whether attacker-controlled content in non-primary channels (retrieved documents, web pages, email, tool outputs, file attachments) can influence the agent. This is usually the highest-impact class of AI-app bug in 2026 because agents routinely ingest untrusted external content.

Parallelism: doc authoring & upload can be parallel; retrieval observation must be sequential (you need to see the effect of each doc on retrieval). Reasoning budget: extended thinking when deciding where in the pipeline to plant content, and when interpreting subtle effects.


1. Map the ingestion surface

Before crafting payloads, identify every channel that feeds model context:

Channel Example vectors
RAG corpus Vector DB, document upload, SharePoint sync
Web browse tool Pages the agent fetches
Email assistant Inbox messages the agent summarizes
Calendar / docs Meeting notes, shared docs
Code tool output git log, grep, test output
API tool output JSON bodies the model parses
File-read tool Attachments, local files
MCP server Any connected MCP tool's text output

Rank by attacker-controllability. For each channel, test at least one payload.

2. Craft payloads per channel

Base templates in payloads/injection_2026.txt and examples/indirect_injection_doc.md. Per channel:

  • RAG: use examples/poisoned_rag_chunk.md. Payload must survive chunking. Test chunk-boundary splitting — place injection in middle of a chunk vs. start.
  • Web: HTML with hidden text (see payloads/encoding_obfuscation.txt → Markdown / HTML invisibility).
  • Email: use realistic signature blocks, reply-chain formatting.
  • Tool output: if the attacker controls an API the agent calls, put the payload in the response body in a plausible-looking field.
  • MCP: see workflows/mcp_server_injection.md.

Every payload MUST contain a unique canary so you can distinguish retrieved content from model hallucination.

3. Sequential retrieval observation

For each planted payload, drive the legitimate user flow and observe:

  1. Does the payload get retrieved/ingested?
  2. Does the model quote it (ok — means it's in context)?
  3. Does the model act on it (bug — means trust boundary is broken)?

Sequential because: plant payload → query → observe → adjust → re-plant. Parallelism here causes cross-contamination and noisy results.

4. Measure "instruction uptake rate"

Against the same underlying question, compare:

  • Query with benign retrieved content
  • Query with injection-bearing retrieved content

Difference in behavior (tool calls, refusals, canary emission) quantifies the bug. Aim for 10–30 trials per payload for statistical validity.

5. Escalation: chained indirection

  • Injection in doc A instructs agent to fetch doc B (which contains the real payload). Tests whether defenses only inspect first-hop content.
  • Injection instructs agent to use a "safe" tool (e.g. search) with an attacker-crafted query that causes a second retrieval loop.

6. Sub-agent strategy

One sub-agent per attack surface:

  • Agent A: RAG poisoning (see workflows/rag_poisoning.md)
  • Agent B: web content
  • Agent C: email / calendar
  • Agent D: tool-output spoofing
  • Agent E: MCP (see workflows/mcp_server_injection.md)

7. Evidence & remediation

Finding record must include:

  • attack_class = "indirect-injection" (or specific variant)
  • payload.delivery_vector — rag-chunk | web-page | email | tool-output | etc.
  • target_surface.retrieval_source if applicable
  • success_indicator — canary emission vs. tool invocation vs. data leak

Typical remediations:

  • Spotlighting (mark retrieved content as untrusted)
  • Strict separation of data-channel vs. instruction-channel
  • Source allowlisting for retrieval
  • Output classifier tuned to detect injected-intent follow-through
  • HITL gate on any tool call that touches sensitive resources

See references/defense_patterns_2026.md for detail.

Source: SKILL.md on GitHub

1 alert16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill is a comprehensive security auditing and red-teaming toolkit designed to test LLM applications for vulnerabilities like prompt injection, RAG poisoning, and tool misuse. While it contains many examples of malicious payloads and attack patterns, these are provided for defensive testing purposes within a clearly defined security research framework that requires explicit authorization. No actual malicious code or unauthorized data exfiltration logic is executed by the skill itself; it serves as a guide and resource for security professionals.

  • Socket16d

    5 alerts: gptSecurity, gptAnomaly

  • Snyk16d

    Risk: MEDIUM · 1 issue

  • Runlayer7mo

    1/1 file flagged

Signed by skilld at f9bb3b2. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 6 months ago

README badge

README badge for hardw00t/ai-security-arsenal/llm-security