跳到正文
cccskills
免费在 GitHub 公开

ai-guardrails

Use when building autonomous LLM agents operating in live environments. Protects against prompt injection, tool abuse, data exfiltration, and runaway loops. Keywords: guardrails, prompt injection, IPI, safety, sandboxing, NeMo, LLM Guard.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md4.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

AI Guardrails & Defense-in-Depth

Overview

The ai-guardrails skill provides a comprehensive framework for securing autonomous LLM agents. As agents interact with untrusted external data sources and perform actions on behalf of users, the attack surface expands significantly. This skill focuses on implementing multi-layered defenses to ensure agent safety, reliability, and integrity in live environments.

Threat Model

Autonomous agents face unique security challenges that require a proactive defense strategy:

  1. Direct Prompt Injection (DPI): Malicious input explicitly attempting to hijack the agent's core instructions.
  2. Indirect Prompt Injection (IPI): Injected instructions hidden in retrieved web pages, emails, or files that the agent processes.
  3. Prompt Leaking: Attempts to extract system instructions, internal reasoning paths, or proprietary data.
  4. Data Exfiltration: Unauthorized access and transfer of PII or sensitive internal data to external endpoints.
  5. SSRF (Server-Side Request Forgery) via Tool Use: Leveraging agent-enabled tools to probe internal networks or access forbidden resources.
  6. Agent Loop Exploitation: Crafting inputs that force the agent into infinite loops or resource-exhaustion scenarios.
  7. Tool Abuse: Circumventing intended tool usage patterns to execute malicious commands.

Core Defenses

Dual-LLM & Context Boundary Isolation

  • Pattern: Isolate instructions from data.
  • Implementation: Separate the Instruction Stream (system prompts, task logic) from the Content Stream (retrieved data).
  • Mechanism: Use a secondary, smaller "Sanitizer LLM" to filter untrusted content before it reaches the main reasoning engine.

Indirect Prompt Injection (IPI) Defenses

  • Detection: Utilize structured markup (e.g., XML tags like <untrusted_content>) to wrap retrieved data.
  • Neutralization: Instruct the agent to strictly ignore any instructions contained within tagged content blocks.

Runtime Input/Output Validation

  • Scan: Implement real-time scanning for PII, toxic payloads, and jailbreak patterns.
  • Tools: Integrate with established safety frameworks like LLM Guard or Llama Guard at both input and output boundaries.

Programmable Dialog Rails

  • Statefulness: Use NeMo Guardrails or Colang to define strict state machines.
  • Boundaries: Explicitly define allowed transitions and prohibit restricted behaviors (e.g., "The agent must never disclose system version information").

Tool Authorization & Sandboxing

  • Least-Privilege: Map tools to specific user roles; strictly limit agent access to the filesystem, APIs, and network.
  • Dry-Runs: Implement a mandatory human-in-the-loop (HITL) step for critical actions (e.g., file deletion, database writes).
  • Circuit Breakers: Introduce automated execution limits that pause tool calls if suspicious patterns are detected.

Rate Limiting & Loop Detection

  • Monitoring: Track token consumption and step latency.
  • Detection: Use sequence analysis to identify repetitive or circular reasoning paths.
  • Intervention: Immediately terminate agents exhibiting abnormal token spikes or infinite loops.

Implementation Patterns

  1. The Wrapper Pattern: Wrap all tool inputs and outputs with validation middleware.
  2. The "Human-in-the-loop" Gate: Require manual approval for all side-effecting operations.
  3. Strict Schema Enforcement: Use Pydantic or similar libraries to enforce rigid structure for all tool arguments.

Quality Gates

  • Red-Teaming: Before deployment, run automated IPI and jailbreak attempts against the agent.
  • Regression Testing: Maintain a test suite of known malicious inputs that the agent must correctly identify and reject.
  • Observability: Log all agent decisions, especially those where a guardrail triggered a block.

References


End of AI Guardrails Skill Documentation

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

2d-games

免费

2D game development principles. Sprites, tilemaps, physics, camera.

中文简介正在准备中。当前显示原文说明。

VoDaiLocz/kilo-kit-mcp282026年9月13日 更新

3d-games

免费

3D game development principles. Rendering, shaders, physics, cameras.

中文简介正在准备中。当前显示原文说明。

VoDaiLocz/kilo-kit-mcp282026年9月13日 更新

aesthetic

免费

Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

中文简介正在准备中。当前显示原文说明。

VoDaiLocz/kilo-kit-mcp282026年9月13日 更新

Use when implementing or managing persistent, hierarchical memory systems for AI agents. Covers cross-session state, fact supersession, and self-managed memory tools to enable long-term recall and adaptive agent behavior.

中文简介正在准备中。当前显示原文说明。

VoDaiLocz/kilo-kit-mcp282026年9月13日 更新

Use when monitoring, tracing, or debugging agentic workflows in production. Keywords: observability, tracing, OpenTelemetry, Langfuse, latency, token cost, loop detection, telemetry.

中文简介正在准备中。当前显示原文说明。

VoDaiLocz/kilo-kit-mcp282026年9月13日 更新

Use when building self-correcting retrieval systems for AI agents. Keywords: RAG, retrieval, Corrective RAG, Self-RAG, query decomposition, reranking, hallucination, grounding.

中文简介正在准备中。当前显示原文说明。

VoDaiLocz/kilo-kit-mcp282026年9月13日 更新

查看 VoDaiLocz 的全部技能

报告此技能的问题