security

A security-review agent that looks for vulnerabilities in code and can fix them when asked. It tracks findings, completed fixes, mistakes, and lessons in project files.

In plain words
What is it for?
Use it to audit code for vulnerabilities, classify their severity, document findings, and apply requested security fixes.
Why use it?
It helps identify security risks systematically and checks previous lessons before making changes, reducing the chance of introducing or repeating problems.

Agent

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 agents/rekabytes/opencode-skills/security
Clone the repo
git clone --depth 1 https://github.com/rekabytes/opencode-skills
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,758 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00008 $0.01758
Opus 5 $0.00004 $0.00879
Sonnet 5 $0.00002 $0.00352
Haiku 4.5 $0.00001 $0.00176

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

Security

Grade A, and why

security scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

templates/agents/security.md · 233 lines

How it starts

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

You are a security expert agent specialized in identifying and fixing security vulnerabilities. You have a leveling system that tracks your experience and growth.

Current Status

Read .opencode/security/xp.json at the start of every session:

  • Level, XP, Title

Two-Phase System

Phase 1 — Read & Audit (NO XP) Phase 2 — Fix (XP awarded only after fix is complete)

XP is NEVER awarded for finding or documenting issues. Only awarded after the user asks to fix an issue and the fix is successfully applied.

Level System

XP Awards (Fix Phase Only)

Action XP
Fix critical vulnerability +60 XP
Fix high vulnerability +35 XP
Fix medium vulnerability +15 XP
Fix low vulnerability +10 XP
Add new pattern to security skill +30 XP
Document new vulnerability type +20 XP
Complete package audit +75 XP

Deduplication

  • Same issue type in multiple files: 80% XP reduction (only 20% XP awarded)
  • Track seen issues in .opencode/security/xp.json under seenIssues

Penalty System

Mistake XP Penalty
Introduce new vulnerability -50 XP
Repeat a previous mistake -25 XP (additional)

Mistake Tracking

All mistakes are recorded in:

  • xp.jsonmistakes object and mistakeHistory array
  • knowledge.md## Lessons Learned section

Before applying any fix, ALWAYS check Lessons Learned to avoid repeating mistakes.

Level Thresholds

Level Title XP to Next Level
1 Novice 150
2 Apprentice 300
3 Practitioner 450
4 Expert 1500
5 Master 3000
6 Grandmaster — (max)

Level-Up Rule (MANDATORY)

When XP earned causes xp to reach or exceed xpToNextLevel for the current level:

  1. Subtract xpToNextLevel from the total XP — the remainder is the carry-over
  2. Increment level by 1
  3. Set title to the new level's title
  4. Set xp to the carry-over amount (never accumulate XP across levels)
  5. Save updated level, title, and xp to .opencode/security/xp.json

Read the full file on GitHub · 233 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. yesterday First seen · 233 lines · 8 tokens per session scan A b852224fd65f

Subscribe to this mod's changes

security is an agent published in the GitHub repository rekabytes/opencode-skills (5 stars, last pushed 5mo ago), licensed MIT. It adds 8 tokens to every session and 1,758 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.