prompt-injection-defense

Solid

Threat-model and harden AI agents, RAG systems, assistants, and tool-using workflows against direct, indirect, stored, cross-agent, and multimodal prompt injection. Use when reviewing an agent architecture, isolating untrusted content, constraining tools and egress, protecting secrets, adding injection-focused tests, investigating a suspected injection incident, or documenting residual prompt-injection risk.

AI & Automation 161 stars 32 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
74
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Prompt Injection Defense Design for compromise of model reasoning. Prompt text and classifiers can reduce attack success, but they do not create a reliable security boundary. Keep consequential authority, authorization, validation, and policy enforcement outside the model. ## Inputs Collect or infer, and label assumptions for: - Agent purpose, system/developer instructions, models, memory, and orchestration - Every input source, including users, web pages, email, documents, images, audio, tool results, RAG, and other agents - Tool list, privileges, identities, targets, write effects, and network egress - Secrets, private data, system prompts, policy data, and other protected assets - Output sinks such as UI rendering, code execution, messages, databases, and downstream agents - Authorization model, human gates, monitoring, incident history, and risk tolerance - Representative benign tasks and a safe evaluation environment Do not request production secrets or malicious artifacts in chat. Use redacted samples or synthetic fixtures. ## Output contract Deliver: 1. A data-flow and trust-boundary map covering protected assets, all modalities, sinks, memory stores, agent hops, approved destinations, and credential boundaries 2. A threat model listing protected assets, attacker-controlled channels, injection paths, and security invariants 3. A prioritized defense plan that maps each path to preventive, limiting, detective, and recovery controls, each marked `missing`, `plan...

Details

Author
seb1n
Repository
seb1n/awesome-ai-agent-skills
Created
6 months ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

prompt-injection-defense

Contain direct and indirect prompt injection in LLM-integrated applications. Covers source-of-trust tagging, tool-use confirmation after untrusted input, output validation, markdown-image exfiltration prevention, and context-window hygiene. Invoke when building any app where untrusted text reaches an LLM, when the LLM has tools that act on real systems, or after a suspected injection incident.

15 Updated 2 weeks ago
GoldenWing-360
AI & Automation Listed

prompt-injection

Expert methodology for testing direct and indirect prompt injection vulnerabilities in LLM-powered applications, agents, and pipelines. Covers payload construction, context manipulation, cross-agent propagation, and exfiltration triggers.

1 Updated yesterday
sunilgentyala
AI & Automation Listed

defending-against-prompt-injection

Keep an agent from obeying instructions hidden in the content it reads. Covers placing fetched pages, emails, and API responses in tool_result blocks instead of the system prompt; wrapping that content as JSON with explicit source fields; labeling its provenance; screening tool output with a fast classifier before the agent acts; and stating an untrusted-content policy in the system prompt. Use this when someone builds an agent that reads the web, email, shared files, or any third-party text, asks how to stop indirect or cross-content prompt injection, or finds an agent following instructions buried in a fetched page. Trigger on "indirect prompt injection," "agent followed instructions in a web page," "untrusted tool output," and similar. This is content handling inside the context window; limiting the damage once an attack lands is environment containment (sandboxing-agentic-systems), and gating outbound commands is action gating.

1 Updated 4 weeks ago
Hoja-Solutions