/polymath-ai:llm-guardrailsfrom polymath-ai
Design guardrails for an LLM feature — input validation, prompt-injection defenses, output filtering/schema validation, allow-deny policy, and human-in-the-loop gates.
Ships in polymath-ai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A model will be asked to do things you didn't intend and emit things you can't ship. Guardrails are the validation layer on both sides of the model — design them as code, not as prompt pleading.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
polymath-ai:llm-guardrails.Not this when: you are auditing an existing LLM system end-to-end for security findings — that is polymath-security:llm-security-review (this skill designs the controls that review checks for). For agent stop conditions, see polymath-ai:agent-design.
polymath-security:llm-security-review.Guardrail design: support assistant (reads tickets + help center; can tag and refund tickets)
Trust boundaries
user message untrusted → delimited <user_message>, never in the system prompt
retrieved articles untrusted → delimited <document>, lower trust than instructions
ticket bodies untrusted → indirect-injection risk (customers write them)
Input controls: length cap 8k chars; strip zero-width + control chars; injection classifier (defense in depth only)
Actions (model proposes → code authorizes)
tag_ticket auto, allow-list of 12 tags, user's own permissions
refund_ticket never from model output alone → human approval token required
Exfiltration triangle: external image/link rendering disabled for answers that saw ticket text
Output controls: JSON schema validation (retry once, then refuse); PII/secret filter; no URLs outside the help-center domain
Fail closed: any trip → "I can't help with that here — I've routed this to a human agent." + ticket flagged
Logging: every trip logged with the guardrail id; rate limit 30 requests/min/user
Adversarial tests: handed to polymath-security:llm-security-review
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/agent-designDesign an LLM agent — architecture (ReAct, plan-execute, reflexion), tool/function-calling contract, memory, multi-agent orchestration, and the stop/budget conditions./eval-planDesign an evaluation for an LLM feature — task type, dataset shape, automated vs human rubric, regression set, decision threshold./llm-cost-latencyCut LLM cost and latency — model routing/cascade, prompt caching, batching, streaming, context trimming, output-token control, and a per-request cost/latency budget./prompt-engineerAuthor or improve an LLM prompt — clarify task, constrain output shape, place worked examples, bound calibration; vendor-agnostic./rag-designDesign a retrieval-augmented generation pipeline — chunking, embeddings, retriever, reranker, prompt assembly — with the right cuts for the use case.npx claudepluginhub mohammadbafkar/polymath --plugin polymath-ai