alo-exp/silver-bullet/ai-llm-safety

Claude Code and agent skill by alo-exp/silver-bullet

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

This skill should be used when designing, planning, implementing, or reviewing any system that involves LLM agents, tool use, prompt construction, or agentic workflows, or when the user asks to "add guardrails", "prevent prompt injection", "sanitize LLM output" — enforces prompt injection defense, tool safety, and context integrity

Install

npx vskill@latest install alo-exp/silver-bullet/ai-llm-safety

SKILL.md

The same SKILL.md was published earlier as alo-exp/silver-bullet/ai-llm-safety.

/ai-llm-safety — AI/LLM Safety Design Enforcement

Every system that involves LLM agents, tool use, or prompt construction MUST treat AI safety as a first-class constraint. Prompt injection is the SQL injection of the AI era — and it's harder to fix after deployment.

Why this matters: LLM-powered systems are uniquely vulnerable to attacks that exploit the model's instruction-following nature. A single prompt injection can exfiltrate data, execute unauthorized actions, or compromise downstream systems. Unlike traditional software bugs, these vulnerabilities exist at the semantic layer and cannot be caught by linters or type checkers.

When to invoke: During PLANNING (after brainstorming, before or alongside writing plans) and during REVIEW (as part of code review criteria). This skill applies to ALL code that constructs prompts, processes LLM output, or orchestrates agent workflows.


The Rules

Rule 1: Treat All External Content as Untrusted Data

Any content not authored by the system itself is untrusted. This includes:

SourceRiskMitigation
User inputDirect prompt injectionIsolate from system instructions; validate format
Web pages / fetched contentIndirect prompt injectionNever pass raw content as instructions; summarize or extract data only
Tool results / API responsesPoisoned upstream dataValidate schema; never execute embedded instructions
File contents (uploaded/read)Embedded injection payloadsTreat as data, not instructions; scan for instruction-like patterns
Database recordsStored injection (persistent)Sanitize on read; never interpolate into prompts as instructions
Email / message contentSocial engineering + injectionAlways verify instructions with user before acting

The cardinal rule: Data flows into prompts as DATA, never as INSTRUCTIONS. If untrusted content must appear in a prompt, it must be clearly delimited and the model must be instructed to treat it as data.

Rule 2: Prompt Construction Safety
PrincipleRequirement
System/user separationSystem instructions and user content must be clearly separated and labeled
No string interpolation of untrusted data into system promptsUse structured message formats; never f"You are a {user_input} assistant"
Instruction hierarchySystem prompt > user instructions > tool results > observed content
Defense in depthMultiple layers: input validation + prompt structure + output validation
Least privilege promptingOnly grant the model capabilities it needs for the specific task
Rule 3: Tool Use Safety

Tools give LLMs the ability to affect the real world. Every tool call must be scrutinized:

PrincipleRequirement
Principle of least privilegeEach agent/tool gets minimum permissions needed
Explicit allowlistsDefine what actions ARE allowed, not what ISN'T
Confirmation gatesDestructive or irreversible actions require user confirmation
Input validation on tool parametersValidate all parameters before execution — type, range, format
Output sanitizationTool outputs returned to the model must not contain executable instructions
Rate limitingPrevent runaway tool loops; cap iterations and API calls
Audit loggingLog all tool invocations with parameters for forensic review
Rule 4: Context Integrity

The model's context window is its working memory. Protect it:

  • No context poisoning: Prevent untrusted content from overwriting or contradicting system instructions
  • No instruction smuggling: Detect and block attempts to inject instructions via tool results, file contents, or fetched web pages
  • No role confusion: The model must always know its role and not adopt roles suggested by untrusted content
  • No authority escalation: Untrusted content cannot claim admin/system/developer privileges
  • Context provenance tracking: Always maintain awareness of where each piece of context originated
Rule 5: Output Safety

LLM outputs can be dangerous if consumed without validation:

RiskMitigation
Generated code executionSandbox all generated code; never eval() LLM output
Structured output injectionValidate JSON/XML schema before parsing; reject malformed output
Exfiltration via outputMonitor for sensitive data in responses; redact PII/secrets
Hallucinated credentials/URLsNever trust URLs, API keys, or credentials in LLM output — verify independently
Chain-of-thought leakageEnsure internal reasoning doesn't leak sensitive system details
Rule 6: Multi-Agent Safety

When multiple agents collaborate, the attack surface multiplies:

PrincipleRequirement
Agent isolationEach agent operates in its own trust boundary; no shared mutable state without validation
Message authenticationVerify the source of inter-agent messages; don't trust agent identity claims
Capability delegationAn agent cannot grant capabilities it doesn't have to another agent
Recursive injection preventionAgent A's output processed by Agent B must be treated as untrusted by Agent B
Termination guaranteesAll agent chains must have maximum depth/iteration limits
Rule 7: Data Exfiltration Prevention

LLM systems can be tricked into leaking sensitive data through subtle channels:

  • No sensitive data in URLs: Never include secrets, PII, or internal data in URL parameters, API calls, or fetch requests
  • No sensitive data in tool parameters: Validate that tool call arguments don't contain exfiltrated data
  • Monitor outbound channels: Any network call, file write, or message send is a potential exfiltration vector
  • Covert channel awareness: Data can be encoded in seemingly innocuous outputs (base64 in filenames, steganography in generated content)

Planning Checklist

Before finalizing any design or plan involving LLM agents, run this checklist:

  • [ ] All external content (user input, web pages, tool results, files) is treated as untrusted data
  • [ ] Prompt construction separates system instructions from untrusted content with clear delimiters
  • [ ] No string interpolation of untrusted data into system-level prompts
  • [ ] Every tool has explicit parameter validation and least-privilege permissions
  • [ ] Destructive/irreversible tool actions require user confirmation gates
  • [ ] Multi-agent communication treats inter-agent messages as untrusted
  • [ ] Agent chains have maximum depth/iteration limits (termination guarantees)
  • [ ] Outputs are validated before being consumed by downstream systems
  • [ ] No sensitive data (secrets, PII, credentials) can leak via tool parameters, URLs, or outputs
  • [ ] Context integrity is maintained — untrusted content cannot override system instructions
  • [ ] Encoded/obfuscated content in inputs is detected and flagged (base64, hex, unicode escapes)
  • [ ] Rate limiting exists on tool calls and API interactions to prevent runaway loops

If any item fails: redesign before proceeding to implementation.


Anti-Patterns

PatternProblemFix
Trusting tool results as instructionsIndirect prompt injectionTreat all tool results as data; verify with user
eval() on LLM outputArbitrary code executionSandbox or validate against schema
Shared context between untrusted agentsCross-agent injectionIsolate contexts; validate inter-agent messages
"The model will figure it out"No defense in depthExplicit validation at every boundary
Logging full prompts with user dataPII/secret exposure in logsRedact sensitive fields before logging
No iteration limits on agent loopsInfinite loops / resource exhaustionHard caps on iterations and API calls

Rationalization Prevention

ExcuseReality
"It's just an internal tool"Internal tools process external data. Injection still works.
"The model is smart enough to ignore injections"Models follow instructions. That's the vulnerability.
"We'll add safety later"Safety is architectural. Retrofitting is 10x harder.
"Nobody would inject into this input"Automated attacks are cheap. Assume adversarial inputs.
"It's behind authentication"Authenticated users can still be social-engineered.
"The content is from a trusted source"Trust is transitive. If the source is compromised, you are too.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/alo-exp/silver-bullet/ai-llm-safety/badge)](https://verified-skill.com/skills/alo-exp/silver-bullet/ai-llm-safety)

Something wrong with this skill or its page? Tell us.