ai-security

Detect prompt injection attempts in AI and LLM applications.

2|Updated Nov 13, 2025
One-click install
npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill ai-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ai-security
Source: https://github.com/ricardoroche/ricardos-claude-code/tree/main/.claude/skills/ai-security
Command: npx skills add https://github.com/ricardoroche/ricardos-claude-code --skill ai-security

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pydantic.

What problem does it solve?

This Skill addresses critical security vulnerabilities in AI and LLM applications, such as prompt injection, PII leakage, and generation of unsafe content. It provides robust patterns to protect your applications and users, ensuring compliance and trust.

Core Features & Use Cases

  • Prompt Injection Detection: Identifies and mitigates attempts to manipulate LLM behavior through malicious inputs.
  • PII Redaction: Automatically redacts sensitive Personally Identifiable Information from prompts before sending to LLMs, and unredacts outputs when safe.
  • Output Content Filtering: Filters LLM-generated content for violence, hate speech, sexual content, or illegal activities.
  • Secure Prompt Construction: Guides on building prompts with clear boundaries and integrated security checks.
  • Use Case: An LLM application processes user queries that might contain sensitive data or malicious instructions. This skill helps implement a SecurePromptBuilder to detect injection, redact PII, and filter the LLM's response for harmful content, ensuring a safe interaction.

Quick Start

Implement prompt injection detection for user inputs in my LLM application.

Frequently Asked Questions about ai-security

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

FAQPage Schema
How do I detect prompt injection attempts in my LLM application?

Prompt injection detection identifies malicious inputs designed to manipulate LLM behavior. This Skill implements rule-based detectors that scan user queries for injection patterns, flagging suspicious instructions before they reach your model. Apply it at API endpoints and orchestration layers to block threats early.

Can I automatically redact PII from prompts before sending them to an LLM?

Yes. PII redaction automatically removes sensitive personally identifiable information from prompts and unredacts outputs when safe. This prevents accidental data leakage to external LLMs and ensures compliance with privacy regulations across prompt handling and response generation.

What's the best way to filter harmful content from LLM-generated outputs?

Output content filtering screens LLM responses for violence, hate speech, sexual content, and illegal activities. This Skill applies configurable sensitivity rules to generated text, catching unsafe outputs before they reach users and maintaining application safety standards.

How do I build secure prompts with integrated security checks?

Secure prompt construction combines clear boundaries and built-in validation through a SecurePromptBuilder pattern. It detects injection attempts, redacts sensitive data, and filters responses in a single workflow, reducing manual security configuration across your application.

Does this work for multi-layer AI deployments like agents and APIs?

Yes. The Skill spans API endpoints, agents, and orchestration layers with structured diagnostics and configurable sensitivity. It integrates with security engineers and ML-system architectures, supporting both simple endpoints and complex multi-component deployments.

What dependencies does this Skill require?

This Skill depends on Pydantic for data validation and structured configuration. Pydantic provides the schema enforcement needed for rule-based detection and diagnostic output, enabling integration with existing Python LLM frameworks.