rag-security-first

rag-security-first is a skill for Claude Code, Codex from lyonzin/knowledge-rag. It costs 94 tokens per session (2,513 once invoked), scanned B, original, MIT.

A security-workflow guide that makes a local knowledge collection the first source for cybersecurity tasks. It covers incidents, vulnerabilities, attacker techniques, detection rules, and defensive checks.

In plain words
What is it for?
Use it to investigate threats, map activity to MITRE ATT&CK, review CVEs, analyze exploits, create detection rules, and validate defensive controls.
Why use it?
It reduces the risk of missing relevant internal guidance or using outside information before checking your own security material.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/lyonzin/knowledge-rag/rag-security-first
Any agent
npx skills add lyonzin/knowledge-rag --skill rag-security-first
Clone the repo
git clone --depth 1 https://github.com/lyonzin/knowledge-rag

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rag-security-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/lyonzin/knowledge-rag/rag-security-first.svg)](https://agentmods.dev/skills/lyonzin/knowledge-rag/rag-security-first)
Your own site
<a href="https://agentmods.dev/skills/lyonzin/knowledge-rag/rag-security-first"><img src="https://agentmods.dev/badge/skills/lyonzin/knowledge-rag/rag-security-first.svg" alt="Measured on agentmods" height="20"></a>
Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,513 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.02513
Opus 5 $0.00047 $0.01256
Sonnet 5 $0.00019 $0.00503
Haiku 4.5 $0.00009 $0.00251

Measured 4d ago against content hash 4b3e9709f867, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

rag-security-first scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Harvests environment variablesmediumData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

Example: `search_knowledge(query="LSASS dump credential access detection", max_results=5)`

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/domain/rag-security-first/SKILL.md · 207 lines

How it starts

The opening of the file, as written. The whole thing — 207 lines — stays where its author put it; the contents beside it link to each section on GitHub.

rag-security-first — RAG-driven security workflow

When to use this skill

Trigger this skill for any security-flavored task:

  • Threat triage or incident response
  • MITRE ATT&CK technique mapping (T1078, T1055, …)
  • CVE lookup or vulnerability analysis
  • Exploit / payload / attacker-technique questions
  • Red team / blue team / purple team exercises
  • CTF challenge analysis
  • Detection engineering (Sigma / Snort / YARA / KQL / SPL / LQL rules)
  • Defensive control validation
  • Compliance / hardening questions

Prerequisite: the RAG should be loaded with security-relevant content. The cybersecurity preset is optimized for this — it ships 8 categories, 200+ routing keywords, and 69 query expansions covering sqliSQL injection, privescprivilege escalation, etc.


What this skill commits to

For security tasks, the corpus is primary:

  1. Search the corpus before hitting any external threat-intel MCP (mcp__cti__*, mcp__virustotal__*, mcp__shodan__*).
  2. Use the query-expansion mappings (sqliSQL injection) — they exist for a reason.
  3. Cite the MITRE technique ID + the internal runbook link.
  4. Only escalate to external threat-intel when the corpus does not cover the specific IOC / CVE / technique in enough depth.

Steps

  1. Classify the intent. Is it:

    • Detection — "we saw X in logs, is this bad?"
    • Response — "we confirmed compromise, what now?"
    • Prevention — "how do we harden against X?"
    • Research — "how does X actually work?"
  2. Extract the security signature from the user's message:

    • MITRE ATT&CK ID (T1078, T1078.001, TA0004)
    • CVE ID (CVE-2024-1234)
    • Malware family (Cobalt Strike, Mimikatz, LSASS dump)
    • Attack technique term (Kerberoasting, AS-REP Roasting, pass-the-hash)
    • IOC (hash, domain, IP — treat as verbatim in the search)
  3. Search the corpus with the security preset in mind:

    search_knowledge(query="<signature> <intent>", max_results=5, min_score=0.15)
    

    Example: search_knowledge(query="LSASS dump credential access detection", max_results=5)

Read the full file on GitHub · 207 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 207 lines · 94 tokens per session scan B 4b3e9709f867

Subscribe to this mod's changes

rag-security-first is a skill published in the GitHub repository lyonzin/knowledge-rag (267 stars, last pushed 2d ago), licensed MIT. It adds 94 tokens to every session and 2,513 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it B with 1 finding (harvests environment variables). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

go-naming

Go naming conventions and best practices. Use this skill when working with Go code and need to name packages, files, directories, structs, interfaces, functions, variables, or constants. Provides comprehensive naming guidelines following Go community standards.

infiniflow/ragflow · 49 tokens

rag-perf

Performance benchmarking for a deployed NVIDIA RAG Blueprint server: profiling pass + aiperf load test driven by a single YAML config. Not for accuracy / RAGAS scoring (use rag-eval) or for deploying / repairing services (use rag-blueprint).

NVIDIA-AI-Blueprints/rag · 56 tokens

rag-blueprint

NVIDIA RAG Blueprint — deploy, configure, troubleshoot, and manage. Handles any RAG action: deploy, install, start, enable, disable, toggle, change, configure, troubleshoot, debug, fix, shutdown, stop, or tear down any RAG feature or service (Agentic RAG, VLM, guardrails, query rewriting, models, search, ingestion…

NVIDIA-AI-Blueprints/rag · 92 tokens

rag-eval

Filesystem RAG benchmarks: corpus/, train.json, evaluaterag.py (RAGAS quality). Not for prod monitoring, latency/throughput benchmarking (use rag-perf), or evals outside this repo layout.

NVIDIA-AI-Blueprints/rag · 48 tokens

help

Overview of all available Pinecone skills and what a user needs to get started. Invoke when a user asks what skills are available, how to get started with Pinecone, or what they need to set up before using any Pinecone skill.

pinecone-io/gemini-cli-extension · 50 tokens

assistant

Create, manage, and chat with Pinecone Assistants for document Q&A with citations. Handles all assistant operations - create, upload, sync, chat, context retrieval, and list. Recognizes natural language like "create an assistant from my docs", "ask my assistant about X", or "upload my docs to Pinecone".

pinecone-io/gemini-cli-extension · 68 tokens