rag-security

Validate retrieval sources, truncate content, and label untrusted data in RAG pipelines.

20|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/thejefflarson/soundcheck --skill rag-security-thejefflarson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rag-security
Source: https://github.com/thejefflarson/soundcheck/tree/main/.claude/skills/rag-security
Command: npx skills add https://github.com/thejefflarson/soundcheck --skill rag-security-thejefflarson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In RAG pipelines, retrieved documents can cause prompt injection or context flooding, risking model behavior and performance.

Core Features & Use Cases

  • Validate retrieval sources against a domain allowlist to prevent SSRF and untrusted content.
  • Truncate retrieved content to a safe token or character limit to protect the context window.
  • Wrap retrieved content in explicit delimiters and label it as untrusted data, ensuring it's not conflated with system prompts.
  • Log every retrieval with source URL and size for auditing and detection of anomalies.

Quick Start

Integrate this skill to validate retrieval sources, truncate content, wrap untrusted data, and log every retrieval before using it in prompts.

Frequently Asked Questions about rag-security

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

FAQPage Schema
How do I prevent prompt injection in RAG pipelines from retrieved documents?

To prevent prompt injection in RAG pipelines, retrieved content must be wrapped in explicit delimiters and labeled as untrusted data, ensuring it's not conflated with system prompts.

What's the best way to secure untrusted URLs in retrieval-augmented generation?

Securing untrusted URLs in retrieval-augmented generation requires validating retrieval sources against a domain allowlist to prevent SSRF and block untrusted content ingestion.

How do I truncate retrieved text to protect the context window in RAG?

Truncate retrieved text to a safe token or character limit to protect the context window from context flooding, which risks model behavior and performance during retrieval.

How do I log retrieval sources and sizes for RAG auditing?

Log every retrieval with the source URL and content size to enable auditing and detect anomalies in document stores, shared corpora, or URL fetching operations within your pipeline.

Does this RAG security approach work with shared corpora and document stores?

Yes, this RAG security approach works across retrieval from URLs, document stores, or shared corpora, applying domain validation, content truncation, and prompt labeling universally.