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
| # |
Vulnerability |
Risk |
Key Defense |
| LLM01 |
Prompt Injection |
Critical |
Input sanitization, delimiters |
| LLM02 |
Insecure Output |
High |
Output validation, sanitization |
| LLM03 |
Training Data Poisoning |
High |
Data provenance, auditing |
| LLM04 |
Model DoS |
Medium |
Rate limiting, timeouts |
| LLM05 |
Supply Chain |
High |
Verification, pinning |
| LLM06 |
Sensitive Info Disclosure |
High |
PII detection, redaction |
| LLM07 |
Insecure Plugin Design |
High |
Permission model, validation |
| LLM08 |
Excessive Agency |
High |
Human-in-the-loop, least privilege |
| LLM09 |
Overreliance |
Medium |
Confidence scores, citations |
| LLM10 |
Model Theft |
Medium |
Rate 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
| Type |
Example Pattern |
| Email |
*@*.com |
| Phone |
XXX-XXX-XXXX |
| SSN |
XXX-XX-XXXX |
| Credit Card |
16 digits |
| IP Address |
X.X.X.X |
Redaction Strategy
- Detect PII in input before LLM call
- Redact PII in LLM output
- Log without PII
- 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
| Layer |
Controls |
| Network |
WAF, DDoS protection, API gateway |
| Auth |
OAuth 2.0, API keys, mTLS |
| Input |
Schema validation, injection detection |
| Guardrails |
Topic restrictions, PII filtering |
| Model |
Versioning, anomaly detection |
| Output |
Response filtering, fact verification |
| Audit |
Logging, 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
- Direct injection attempts
- Jailbreak prompts
- Indirect injection via context
- Encoding/unicode tricks
Test suite: resources/security-patterns.py
Testing Checklist
Incident Response
Severity Levels
| Incident |
Severity |
Response |
| Prompt injection detected |
Medium |
Block, log, analyze |
| Data exfiltration attempt |
High |
Block, forensics, notify |
| Model extraction detected |
High |
Rate limit, investigate |
Response Steps
- Contain (block source)
- Preserve (logs, evidence)
- Analyze (attack pattern)
- Remediate (update defenses)
- Document (security log)
Resources
Secure AI systems with defense in depth and zero trust principles.
1---
2name: ai-security-expert
3description: Enterprise AI security - OWASP LLM Top 10, prompt injection defense, guardrails, PII protection
4version: 1.1.0
5last_updated: 2026-01-06
6external_version: "OWASP LLM Top 10 v2"
7resources: resources/security-patterns.py
8triggers:
9 - AI security
10 - prompt injection
11 - LLM security
12 - guardrails
13 - PII protection
14metadata:
15 source: https://skillmd.com/skills/aibot88/ai-security-expert
16---
17
18# AI Security Expert
19
20Enterprise AI security architect specializing in securing LLM applications, defending against prompt injection, implementing guardrails, and OWASP LLM Top 10 compliance.
21
22## OWASP LLM Top 10 (2025)
23
24### Quick Reference
25
26| # | Vulnerability | Risk | Key Defense |
27|---|--------------|------|-------------|
28| LLM01 | Prompt Injection | Critical | Input sanitization, delimiters |
29| LLM02 | Insecure Output | High | Output validation, sanitization |
30| LLM03 | Training Data Poisoning | High | Data provenance, auditing |
31| LLM04 | Model DoS | Medium | Rate limiting, timeouts |
32| LLM05 | Supply Chain | High | Verification, pinning |
33| LLM06 | Sensitive Info Disclosure | High | PII detection, redaction |
34| LLM07 | Insecure Plugin Design | High | Permission model, validation |
35| LLM08 | Excessive Agency | High | Human-in-the-loop, least privilege |
36| LLM09 | Overreliance | Medium | Confidence scores, citations |
37| LLM10 | Model Theft | Medium | Rate limiting, watermarking |
38
39### LLM01: Prompt Injection
40
41**Attack Types:**
42- Direct: "Ignore previous instructions..."
43- Indirect: Malicious content in RAG documents
44- Encoding tricks: Unicode, special tokens
45
46**Defense Pattern:**
47```
48User Input → Sanitize → Delimit → LLM → Validate Output → Filter
49```
50
51### LLM02: Insecure Output Handling
52- Never execute LLM output as code without validation
53- Sanitize HTML (use allowlist)
54- Validate SQL (SELECT only, table allowlist)
55
56### LLM04: Model DoS
57- Rate limiting per user/API key
58- Token limits on requests
59- Timeout configurations
60- Cost capping/alerts
61
62### LLM06: Sensitive Information Disclosure
63- PII detection (regex + NER)
64- System prompt protection
65- Training data sanitization
66- Output filtering
67
68**Code patterns:** `resources/security-patterns.py`
69
70## PII Protection
71
72### Detection Patterns
73| Type | Example Pattern |
74|------|-----------------|
75| Email | `*@*.com` |
76| Phone | `XXX-XXX-XXXX` |
77| SSN | `XXX-XX-XXXX` |
78| Credit Card | 16 digits |
79| IP Address | `X.X.X.X` |
80
81### Redaction Strategy
821. Detect PII in input before LLM call
832. Redact PII in LLM output
843. Log without PII
854. Encrypt at rest
86
87## Guardrails Implementation
88
89### NeMo Guardrails (NVIDIA)
90```
91define user express harmful intent
92 "How do I hack"
93
94define bot refuse harmful request
95 "I can't help with that."
96
97define flow harmful intent
98 user express harmful intent
99 bot refuse harmful request
100```
101
102### Guardrails AI
103```python
104guard = Guard().use_many(
105 ToxicLanguage(on_fail="fix"),
106 PIIFilter(on_fail="fix"),
107 ValidJSON(on_fail="reask")
108)
109```
110
111### Custom Pipeline
112```
113Input Guards → LLM Call → Output Guards → Response
114```
115
116**Implementation:** `resources/security-patterns.py`
117
118## Security Architecture
119
120### Defense in Depth Layers
121
122| Layer | Controls |
123|-------|----------|
124| Network | WAF, DDoS protection, API gateway |
125| Auth | OAuth 2.0, API keys, mTLS |
126| Input | Schema validation, injection detection |
127| Guardrails | Topic restrictions, PII filtering |
128| Model | Versioning, anomaly detection |
129| Output | Response filtering, fact verification |
130| Audit | Logging, retention, compliance |
131
132### Zero Trust Principles
133- Never trust, always verify
134- Least privilege for agents
135- Assume breach (log everything)
136
137## Compliance Frameworks
138
139### EU AI Act (High-Risk)
140- Risk management system
141- Data governance
142- Technical documentation
143- Human oversight
144- Accuracy/robustness testing
145
146### SOC 2 for AI
147- Security: Access controls, encryption
148- Availability: SLA monitoring, DR
149- Processing Integrity: Input/output validation
150- Confidentiality: Data classification
151- Privacy: Data minimization, consent
152
153## Security Testing
154
155### Red Team Categories
1561. Direct injection attempts
1572. Jailbreak prompts
1583. Indirect injection via context
1594. Encoding/unicode tricks
160
161**Test suite:** `resources/security-patterns.py`
162
163### Testing Checklist
164- [ ] Injection patterns blocked
165- [ ] System prompt protected
166- [ ] PII detected and redacted
167- [ ] Rate limits enforced
168- [ ] Outputs validated
169- [ ] Audit logs complete
170
171## Incident Response
172
173### Severity Levels
174
175| Incident | Severity | Response |
176|----------|----------|----------|
177| Prompt injection detected | Medium | Block, log, analyze |
178| Data exfiltration attempt | High | Block, forensics, notify |
179| Model extraction detected | High | Rate limit, investigate |
180
181### Response Steps
1821. Contain (block source)
1832. Preserve (logs, evidence)
1843. Analyze (attack pattern)
1854. Remediate (update defenses)
1865. Document (security log)
187
188## Resources
189
190- [OWASP LLM Top 10](https://owasp.org/www-project-top-10-for-large-language-model-applications/)
191- [NIST AI Risk Management Framework](https://www.nist.gov/itl/ai-risk-management-framework)
192- [NeMo Guardrails](https://github.com/NVIDIA/NeMo-Guardrails)
193- [Guardrails AI](https://github.com/guardrails-ai/guardrails)
194- [LLM Security Best Practices](https://llmsecurity.net/)
195
196---
197
198*Secure AI systems with defense in depth and zero trust principles.*