prompt-injection-guard

Validate and sanitize user inputs to defend against prompt injection attacks.

5|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/latestaiagents/agent-skills --skill prompt-injection-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-injection-guard
Source: https://github.com/latestaiagents/agent-skills/tree/main/skills/mlops/llmops-guardian/prompt-injection-guard
Command: npx skills add https://github.com/latestaiagents/agent-skills --skill prompt-injection-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill protects AI applications from malicious prompt injection attacks, ensuring the integrity and security of AI-driven systems.

Core Features & Use Cases

  • Input Validation: Detects and sanitizes potentially harmful user inputs before they reach the LLM.
  • Output Validation: Verifies that the LLM's output does not contain sensitive information or unintended instructions.
  • Defense Strategies: Implements layered security including blocklists, prompt structuring, canary tokens, and LLM-based detection.
  • Use Case: When building a customer-facing chatbot that processes user queries, use this skill to prevent users from manipulating the chatbot into revealing sensitive data or performing unauthorized actions.

Quick Start

Use the prompt-injection-guard skill to validate and sanitize user input before processing it with an LLM.

Frequently Asked Questions about prompt-injection-guard

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is prompt injection and how does it compromise LLM security?

Prompt injection is an adversarial attack where malicious inputs manipulate an LLM's behavior. It compromises LLM security by causing unauthorized actions, jailbreaks, or the leaking of sensitive system instructions and data.

How do I prevent prompt injection attacks in my AI chatbot?

Prevent prompt injection in AI chatbots by applying multi-layered security strategies. This includes sanitizing user inputs via blocklists, structuring prompts defensively, embedding canary tokens, and using LLM-based detection before processing queries.

Does input validation alone stop indirect prompt injection?

Input validation alone does not stop indirect prompt injection. Comprehensive defense requires output validation to verify LLM responses, canary tokens to detect instruction leaking, and LLM-based detection to catch layered adversarial inputs.

What is the best way to secure AI applications against jailbreaking and prompt leaking?

The best way to secure AI applications against jailbreaking and prompt leaking is implementing a multi-layered defense. This combines input validation, prompt structure defense, output validation, canary tokens, and LLM-based detection.

Can I use canary tokens to detect if an LLM is leaking sensitive instructions?

Yes, you can use canary tokens to detect prompt leaking. Embedding these markers in system prompts allows you to scan LLM outputs, verifying that sensitive instructions are not inadvertently exposed to users.

Why does my LLM output validation fail to catch certain adversarial inputs?

Output validation fails when adversarial inputs bypass basic blocklists. Upgrade to multi-layered defense combining prompt structuring, canary token tracking, and LLM-based detection to identify complex, direct, and indirect injection vectors.