moai-ref-llm-security

Provides defensive security patterns for hardening LLM applications against prompt injection and agentic risks.

1.2k|222|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/modu-ai/moai-adk --skill moai-ref-llm-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-ref-llm-security
Source: https://github.com/modu-ai/moai-adk/tree/main/internal/template/templates/.claude/skills/moai-ref-llm-security
Command: npx skills add https://github.com/modu-ai/moai-adk --skill moai-ref-llm-security

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

LLM-backed applications and agents face unique threats like prompt injection, training-data poisoning, and excessive tool permissions that traditional web security guidance does not cover. This Skill gives engineers a structured defensive reference to detect, prevent, and govern these risks.

Core Features & Use Cases

  • OWASP LLM Top 10 Defensive Mapping: Maps each LLM risk (prompt injection, sensitive data disclosure, excessive agency, and more) to concrete detection checks and hardening controls.
  • Prompt-Injection and MCP Hardening: Covers layered defenses for direct and indirect injection, least-privilege tool scoping, human-in-the-loop gates, and tool-output re-validation for agentic systems.
  • Governance Frameworks: Correlates defenses to MITRE ATLAS technique IDs and maps controls onto the NIST AI RMF functions (GOVERN, MAP, MEASURE, MANAGE), with severity levels, red flags, and a verification checklist.
  • Use Case: When reviewing a RAG-based chat product before release, load this reference to verify that retrieved content is isolated and provenance-tagged, model output is schema-validated, and agent tools follow least-privilege scoping.

Quick Start

Ask the agent to review your LLM application's design against the OWASP LLM Top 10 using this defensive security reference.

Frequently Asked Questions about moai-ref-llm-security

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

FAQPage Schema
How do I defend an LLM application against prompt injection?

Prompt injection defense requires layered controls: enforce instruction hierarchy so downstream text cannot override system instructions, screen inputs for injection markers, isolate and provenance-tag retrieved content, and validate model output before acting on it. No single control is sufficient.

What is the OWASP LLM Top 10 and how do I apply it?

The OWASP Top 10 for LLM Applications is the canonical risk index for LLM systems, covering prompt injection, sensitive data disclosure, supply chain, poisoning, and more. Map each risk to a defensive check and hardening control during design review.

How do I secure MCP servers and agentic tool calls?

Apply least-privilege tool scoping so agents only hold capabilities the task needs, require human-in-the-loop confirmation for high-impact actions, schema-validate tool results before re-prompting, and bound tool-call loops to prevent unbounded action chains.

Does this reference cover offensive techniques like jailbreak authoring?

No. The reference is strictly defensive, covering detection, hardening, and governance. It explicitly excludes offensive techniques such as jailbreak authoring, attack-payload crafting, and red-team exploitation, as well as model training methodology.

How do MITRE ATLAS and NIST AI RMF relate to LLM security?

MITRE ATLAS technique IDs correlate each defense with the adversarial technique it counters, such as AML.T0051 for prompt injection. NIST AI RMF organizes LLM risk governance into four functions: GOVERN, MAP, MEASURE, and MANAGE.

Why should model output never be executed directly?

Raw model output is untrusted and may carry injected commands. Feeding it directly into a shell, eval, query, or innerHTML enables remote code execution or XSS. Always schema-validate and context-encode output before any downstream use.