Skip to content

Pitfalls to Avoid When Writing Vulnerability Discovery Skills

Pitfalls to Avoid When Writing Vulnerability Discovery Skills

Section titled “Pitfalls to Avoid When Writing Vulnerability Discovery Skills”

Let’s talk security — Xiaozao InfoSec here.

This post records a few things worth paying attention to when writing vulnerability discovery Skills. It isn’t limited to vulnerability discovery either — much of it sits at the level of technique and mindset, so it applies to Skills written for other scenarios too.

1. Make the Skill’s responsibility and trigger conditions explicit

The description field is extremely important. Models load Skills on demand — at first only the name and description are loaded — so the model needs to know clearly when it should invoke the skill. The description is what makes or breaks that.

Take a skill for testing broken access control. A good description:

When testing web applications, REST APIs, GraphQL, or mobile APIs, if you find object identifiers
such as resource IDs, user IDs, order IDs, file IDs, or tenant IDs, or if the testing involves
cross-user, cross-role, or cross-tenant data access, use this skill to perform object-level
authorization testing. It covers horizontal privilege escalation, vertical privilege escalation,
cross-tenant escalation, bulk endpoint escalation, and indirect object references.

A bad example:

Used to test for IDOR vulnerabilities.

2. Avoid piling up large amounts of theory

A Skill should contain deterministic workflows and the domain expertise the model lacks — not a pile of theory. For instance, an XSS-hunting skill that starts with an explanation of what XSS is:

## Vulnerability Overview
XSS, or Cross-Site Scripting, is a classic web security vulnerability from the OWASP Top 10. Its core
cause is that a web application fails to properly sanitize or escape externally controllable input,
allowing malicious scripts to be embedded in web pages and executed in the victim's browser context.
Browsers assume by default that scripts belong to the trusted site currently being visited, so
malicious code can access the session cookie and sensitive page data, enabling account hijacking,
page defacement, phishing lures, keylogging, and similar attacks.
Based on how it triggers, XSS falls into three categories: stored XSS, where malicious code is saved
to the database and triggers for every user who visits the page; reflected XSS, where the payload is
placed in a URL parameter and requires luring the user into clicking a crafted link; and DOM-based
XSS, where the flaw lies in front-end JavaScript logic and the backend is not involved.
Common defenses: HTML-entity-encode content output to HTML, add the HttpOnly attribute to cookies,
deploy a Content Security Policy, and sanitize front-end rendered content with tools such as
DOMPurify.

The skill looks detailed, but none of this is specialized knowledge — LLMs already know it. It only burns extra tokens, and as context accumulates it slows down later reasoning; when the context fills up, compaction can cause key information to be lost.

In other words, a Skill should not re-teach the model general knowledge it already has. It should inject the specialist experience the model lacks and constrain it to execute a deterministic workflow.

That’s not to say you can never include such content — when it’s needed, include it. But avoid these long introductions of fundamentals.

3. Avoid oversized skills

If a skill contains too much content, it slows down the model’s processing, makes it unclear what should be prioritized, and quickly fills the context window — leading to frequent compaction and lost key information.

The right approach is to split it into several small, focused skills. A 2,000-line skill is worse than ten 200-line skills.

4. If a script can do it, don’t use the LLM

Not every task belongs to the model. Some automation tasks can be handled by scripts and shouldn’t require LLM reasoning. For example, a subdomain enumeration flow might call subfinder, then httpx, then save the results — that whole process can be implemented as a script, and there’s no need to write the workflow and commands into a Skill.

5. Mark the red lines

For vulnerability discovery — especially in bug bounty (SRC) work — the red lines must be explicit. When writing a SQL injection skill, for example, state the red lines clearly in the Skill: it should only probe and run harmless tests, staying at the PoC level rather than the exploit level. Spell out what must not be done — no attempting command execution, no attempting to dump databases, and so on.

6. Build a RAG knowledge base

General-purpose models can still fall short in specialized domains. In vulnerability discovery, we may want to improve the model’s understanding of professional material, but fine-tuning or a dedicated RAG setup can be a lot of work. With Skills we can implement a simple RAG library: organize the relevant professional documents or payloads by category, then write a Skill that says — when a certain vulnerability type is involved, read the relevant material from the specified directory for reference. Or, inside a specific vulnerability skill, state that in certain situations the model should consult a particular resource. That way, we only need to maintain the RAG library going forward.

Xiaozao InfoSec: focused on cybersecurity, covering agent security, LLM security, vulnerability discovery, red/blue team operations, application security, AI for cybersecurity, and related areas.