# llm-input-output-guardrail-middleware-development

llm-input-output-guardrail-middleware-development is a Claude Code skill for designing protective middleware around LLM agents. It guides work on untrusted inputs, tool permissions, and outbound data checks.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf (Devin Desktop), Claude.ai · ★ 73 repo stars
- Author: W4L33Dx
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/W4L33Dx/Cyber-Monster/tree/HEAD/blue-team/security-automation-and-tool-development/llm-input-output-guardrail-middleware-development/SKILL.md
- Updated: 2026-11-15
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/llm-input-output-guardrail-middleware-development

## What it does

The skill lays out a middleware design for Python and TypeScript applications using LLMs, MCP, or agents. It keeps system instructions distinct from untrusted content, checks tool calls against JSON Schema, allowlists, and caller permissions, and adds source tags and canary tokens to retrieved RAG fragments. Outbound text and tool arguments are checked for personal data, secrets, and URLs.

The guide includes a validation sequence, test-case examples, and a self-check command: `python -m py_compile guardrail.py`. Its specified stack uses Python 3.11 and `jsonschema` for JSON Schema 2020-12 validation. Unknown tools or arguments are rejected by default.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add W4L33Dx/Cyber-Monster --skill llm-input-output-guardrail-middleware-development -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/llm-input-output-guardrail-middleware-development/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/llm-input-output-guardrail-middleware-development/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add W4L33Dx/Cyber-Monster --skill llm-input-output-guardrail-middleware-development -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/llm-input-output-guardrail-middleware-development/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add W4L33Dx/Cyber-Monster --skill llm-input-output-guardrail-middleware-development -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/llm-input-output-guardrail-middleware-development/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install W4L33Dx/Cyber-Monster blue-team/security-automation-and-tool-development/llm-input-output-guardrail-middleware-development
```

2. **Manually: put the files in place**
- File: `.github/skills/llm-input-output-guardrail-middleware-development/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add W4L33Dx/Cyber-Monster --skill llm-input-output-guardrail-middleware-development -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/W4L33Dx/Cyber-Monster --path blue-team/security-automation-and-tool-development/llm-input-output-guardrail-middleware-development
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/llm-input-output-guardrail-middleware-development/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/W4L33Dx/Cyber-Monster/tree/HEAD/blue-team/security-automation-and-tool-development/llm-input-output-guardrail-middleware-development/SKILL.md

## When to use it
- separate system instructions from retrieved RAG content
- validate tool-call arguments against JSON Schema
- restrict tool access by allowlist and caller permissions
- filter secrets and personal data from outbound content

## Example prompts
- Design middleware that separates system instructions from untrusted RAG fragments.
- Add JSON Schema checks and argument allowlists for MCP tool calls.
- Draft outbound filters for secrets, personal data, and disallowed URLs in agent responses.

## Similar
- [chat-middleware](https://affpapa.org/en/nevibecode/agents/chat-middleware.md) — subagent · ★ 521 repo stars
- [safe-action-middleware](https://affpapa.org/en/nevibecode/skills/safe-action-middleware.md) — skill · 1200 installs
- [langchain-middleware](https://affpapa.org/en/nevibecode/skills/langchain-middleware.md) — skill · 17200 installs
- [inngest-middleware](https://affpapa.org/en/nevibecode/skills/inngest-middleware.md) — skill · 3800 installs
- [nextjs-middleware-creator](https://affpapa.org/en/nevibecode/commands/nextjs-middleware-creator.md) — command · 381 installs
- [DCL Trust Oracle — AI/LLM Output Audit (x402 MCP)](https://affpapa.org/en/nevibecode/mcp/dcl-trust-oracle-aillm-output-audit-x402-mcp.md) — MCP server · ★ 1 repo stars

From the same set: [w4l33dx/cyber-monster](https://affpapa.org/en/nevibecode/by/w4l33dx/cyber-monster.md) — 61 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
