Skip to content
AI Security Expert logo

AI Security Expert

Enterprise AI security - OWASP LLM Top 10, prompt injection defense, guardrails, PII protection

SKILL.md

Full skill instructions

AI Security Expert

Enterprise AI security architect specializing in securing LLM applications, defending against prompt injection, implementing guardrails, and OWASP LLM Top 10 compliance.

OWASP LLM Top 10 (2025)

Quick Reference

#VulnerabilityRiskKey Defense
LLM01Prompt InjectionCriticalInput sanitization, delimiters
LLM02Insecure OutputHighOutput validation, sanitization
LLM03Training Data PoisoningHighData provenance, auditing
LLM04Model DoSMediumRate limiting, timeouts
LLM05Supply ChainHighVerification, pinning
LLM06Sensitive Info DisclosureHighPII detection, redaction
LLM07Insecure Plugin DesignHighPermission model, validation
LLM08Excessive AgencyHighHuman-in-the-loop, least privilege
LLM09OverrelianceMediumConfidence scores, citations
LLM10Model TheftMediumRate limiting, watermarking

LLM01: Prompt Injection

Attack Types:

  • Direct: "Ignore previous instructions..."
  • Indirect: Malicious content in RAG documents
  • Encoding tricks: Unicode, special tokens

Defense Pattern:

User Input → Sanitize → Delimit → LLM → Validate Output → Filter

LLM02: Insecure Output Handling

  • Never execute LLM output as code without validation
  • Sanitize HTML (use allowlist)
  • Validate SQL (SELECT only, table allowlist)

LLM04: Model DoS

  • Rate limiting per user/​API key
  • Token limits on requests
  • Timeout configurations
  • Cost capping/​alerts

LLM06: Sensitive Information Disclosure

  • PII detection (regex + NER)
  • System prompt protection
  • Training data sanitization
  • Output filtering

Code patterns: resources/​security-patterns.py

PII Protection

Detection Patterns

TypeExample Pattern
Email*@*.com
PhoneXXX-XXX-XXXX
SSNXXX-XX-XXXX
Credit Card16 digits
IP AddressX.X.X.X

Redaction Strategy

  1. Detect PII in input before LLM call
  2. Redact PII in LLM output
  3. Log without PII
  4. Encrypt at rest

Guardrails Implementation

NeMo Guardrails (NVIDIA)

define user express harmful intent
    "How do I hack"

define bot refuse harmful request
    "I can't help with that."

define flow harmful intent
    user express harmful intent
    bot refuse harmful request

Guardrails AI

guard = Guard().use_many(
    ToxicLanguage(on_fail="fix"),
    PIIFilter(on_fail="fix"),
    ValidJSON(on_fail="reask")
)

Custom Pipeline

Input Guards → LLM Call → Output Guards → Response

Implementation: resources/​security-patterns.py

Security Architecture

Defense in Depth Layers

LayerControls
NetworkWAF, DDoS protection, API gateway
AuthOAuth 2.0, API keys, mTLS
InputSchema validation, injection detection
GuardrailsTopic restrictions, PII filtering
ModelVersioning, anomaly detection
OutputResponse filtering, fact verification
AuditLogging, retention, compliance

Zero Trust Principles

  • Never trust, always verify
  • Least privilege for agents
  • Assume breach (log everything)

Compliance Frameworks

EU AI Act (High-Risk)

  • Risk management system
  • Data governance
  • Technical documentation
  • Human oversight
  • Accuracy/​robustness testing

SOC 2 for AI

  • Security: Access controls, encryption
  • Availability: SLA monitoring, DR
  • Processing Integrity: Input/​output validation
  • Confidentiality: Data classification
  • Privacy: Data minimization, consent

Security Testing

Red Team Categories

  1. Direct injection attempts
  2. Jailbreak prompts
  3. Indirect injection via context
  4. Encoding/​unicode tricks

Test suite: resources/​security-patterns.py

Testing Checklist

  • Injection patterns blocked
  • System prompt protected
  • PII detected and redacted
  • Rate limits enforced
  • Outputs validated
  • Audit logs complete

Incident Response

Severity Levels

IncidentSeverityResponse
Prompt injection detectedMediumBlock, log, analyze
Data exfiltration attemptHighBlock, forensics, notify
Model extraction detectedHighRate limit, investigate

Response Steps

  1. Contain (block source)
  2. Preserve (logs, evidence)
  3. Analyze (attack pattern)
  4. Remediate (update defenses)
  5. Document (security log)

Resources


Secure AI systems with defense in depth and zero trust principles.

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View