genai-security
Skill0 starsChanged 5 months agoMITView on GitHub
Security auditing for GenAI/LLM applications. Primary focus: OWASP Top 10 for LLMs (2025). Use for LLM-powered applications, RAG pipelines, AI agents, prompt templates, and generative AI integrations. For agentic risks, prompt injection patterns, MITRE ATLAS mappings, threat modeling, or structured red teaming methodology, load specific reference documents - outputs are analysis and findings, not formal penetration test reports. NOT for: general code security (use guardian), building LLM apps (use llm-app-patterns), runtime rules (use security-boundaries), or infrastructure.
In this repository29 other files it gives its agents.
- architectSkill
- brainstormingSkill
- concise-planningSkill
- context-engineerSkill
- data-analystSkill
- data-deprecation-analysisSkill
- data-engineeringSkill
- analystSkill
- detectiveSkill
- editorSkill
- inspectorSkill
- data-narrativeSkill
- data-scienceSkill
- excalidraw-diagramSkill
- guardianSkill
- holdout-validationSkill
- implementerSkill
- llm-app-patternsSkill
- llm-memSkill
- opsSkill
- prompt-librarySkill
- security-boundariesSkill
- story-masterSkill
- story-plannerSkill
- subagent-executionSkill
- systematic-debuggingSkill
- task-routingSkill
- thinkerSkill
- verification-before-completionSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 142
Does NOT fix code or implement remediations (produces findings only)
- Distinctive: line 143
Does NOT design system architecture (consult architect)
- Distinctive: line 144
When the input is a prompt template or non-code artefact rather than source code, apply only the Prompt & I/O Security checklist items and …
- Distinctive: line 146
Does NOT replace compliance audits
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GenAI Security Skill
Version: 9.0 | Updated: 01-July-2026 | Architect: Karim Bhalwani | Tiered: core (~140 lines) + on-demand references
Specialized security reference for GenAI applications. Extends Guardian with AI-specific threat models sourced from OWASP GenAI Security Project.
Scope check: If the submitted artefact contains no LLM API calls, prompt templates, vector database interactions, or agent logic, respond with: "This artefact does not appear to be an LLM application. For general code security use the guardian skill; for infrastructure use the appropriate infrastructure security skill. No GenAI Security Review Report will be produced."
Dependencies
~/.copilot/skills/guardian/SKILL.md- baseline code review and OWASP Top 10~/.copilot/skills/llm-app-patterns/SKILL.md- production LLM architecture patterns~/.copilot/skills/security-boundaries/SKILL.md- trust boundary rules for runtime prompt handling and input validation
When to Load
- Reviewing code that calls LLM APIs (Azure OpenAI, OpenAI, Anthropic, etc.)
- Auditing RAG pipelines, embedding workflows, or vector databases
- Reviewing AI agent implementations with tool use or autonomous actions
- Evaluating prompt templates and system prompts
- Conducting AI red teaming or adversarial testing
OWASP Top 10 for LLMs (2025) - Quick Reference
| ID | Risk | Key Mitigation |
| LLM01 | Prompt Injection | Input/output filtering, privilege control, HITL |
| LLM02 | Sensitive Info Disclosure | Output scanning, data sanitization, access controls |
| LLM03 | Supply Chain | Hash verification, AI BOM, dependency scanning |
| LLM04 | Data/Model Poisoning | Data provenance, DVC, anomaly detection |
| LLM05 | Improper Output Handling | Treat output as untrusted, schema validation |
| LLM06 | Excessive Agency | Least privilege tools, loop limits, HITL |
| LLM07 | System Prompt Leakage | No secrets in prompts, output monitoring |
| LLM08 | Vector/Embedding Weakness | Document-level ACL, relevance thresholds |
| LLM09 | Misinformation | RAG with citations, human review for high-stakes |
| LLM10 | Unbounded Consumption | Token budgets, rate limits, timeouts, circuit breakers |
For full detection checklists, mitigations, and MITRE ATLAS mappings, load owasp-llm-deep-dive.md.
OWASP Top 10 for Agentic Applications (2026)
- Excessive Agency & Privilege Escalation
- Inadequate Tool Validation
- Uncontrolled Agent Chaining
- Insufficient Memory & Context Integrity
- Broken Agent Authentication
- Lack of Human Oversight
- Unsafe Code Generation & Execution
- Knowledge Poisoning
- Agent Communication Manipulation
- Unmonitored Agent Behavior
For full checklist, load agentic-top-10-checklist.md.
Mandatory GenAI Security Review Checklist
Prompt & I/O Security
- System prompts contain no secrets, keys, or sensitive architecture details
- Input validation pipeline exists (sanitization, length limits, content filtering)
- Output validation pipeline exists (encoding, schema validation, safety filtering)
- Confirm that anti-prompt-injection defenses have been tested with adversarial examples; look for test cases, CI results, or documented red-team findings as evidence. Do not execute live tests.
Data & Model Security
- Training/fine-tuning data has documented provenance
- Model integrity verified (hashes, signatures, trusted sources only)
- PII removed from training data and RAG corpus
- Vector database has document-level access controls
Agent & Tool Security
- Tools have explicit authorization scopes and input validation
- Agent loop limits enforced (hard cap on iterations)
- Human-in-the-loop required for destructive or irreversible actions
- All tool invocations logged with full audit trail
Memory Security
Evaluate the following four controls as a coordinated family; scoping and auditing controls are only meaningful if sanitization is present.
- Memory files treated as untrusted input - stored memory is read back into context and is a prompt injection vector (memory poisoning); never trust stored content as instructions
- Memory content sanitized before storage: filter injected directives, strip executable patterns, enforce max file size
- Memory scoped per-user and per-project to prevent cross-contamination between tenants or tasks
- Memory operations audited: all reads/writes logged with timestamps and source tracing
Operational Security
- Token budgets and rate limits enforced per-request and per-user
- LLM API calls have timeouts and circuit breakers
- Cost monitoring with anomaly alerting in place
- Structured logging with trace IDs for all LLM interactions
GenAI Security Report Structure
## GenAI Security Review Report
### Summary
[Overall GenAI risk assessment]
### OWASP LLM Top 10 Compliance
| Risk ID | Risk | Status | Notes |
### Agentic Security (if applicable)
| Risk ID | Risk | Status | Notes |
### Findings
| # | Severity | OWASP Risk | Component | Finding | Remediation |
### Red Teaming Results (if performed)
### Gate Status: [PASS | FAIL | NEEDS WORK]Definition of Done
- GenAI Security Review Report produced following structure above
- All 10 LLM risks assessed (Pass/Fail/N/A); each non-N/A verdict must cite a specific code location, configuration entry, or absence thereof as supporting evidence
- Agentic risks assessed if agents or tools are present
- Critical findings have specific remediation steps
- Gate status explicitly stated
Constraints
- Does NOT fix code or implement remediations (produces findings only)
- Does NOT design system architecture (consult architect)
- When the input is a prompt template or non-code artefact rather than source code, apply only the Prompt & I/O Security checklist items and note all code-dependent checklist items as N/A with the reason "no source code provided"
- Red teaming outputs are structured findings and methodology guidance; they do not constitute formal penetration test reports accepted by compliance frameworks
- Does NOT replace compliance audits
References
Load on demand for specific sub-tasks:
- owasp-llm-deep-dive.md - Full OWASP LLM Top 10 detection checklists, mitigations, MITRE ATLAS mappings, and GenAI threat modeling STRIDE table. Load for comprehensive audits.
- llm-top-10-checklist.md - Structured per-risk checklist.
- agentic-top-10-checklist.md - Agent-specific security controls.
- prompt-injection-patterns.md - Attack and defense patterns.
- red-teaming-guide.md - AI adversarial testing methodology.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

