---
title: "AI Nuclei Template Generation for Disclosed Issues"
description: "AI Nuclei template generation: draft detection templates for publicly disclosed issues on assets in scope, check them with nuclei -validate, review by hand."
canonical: https://pentestllm.ai/ai-nuclei-template-generation
generated: 2026-11-27T06:43:49.226Z
source: https://pentestllm.ai/ai-nuclei-template-generation
base_url: https://api.pentestllm.ai/v1
---

AI Nuclei template generation

# Drafting Nuclei templates with AI

AI Nuclei template generation means giving a model a publicly disclosed issue and its advisory and getting back a draft detection template to check with `nuclei -validate` and review by hand before it runs against assets in scope, and PentestLLM serves 16 security builds for it at `https://api.pentestllm.ai/v1` from $3 prepaid. It works with the OpenAI SDK, OpenCode, aider and Claude Code.

[Prices per token](https://pentestllm.ai/pricing)

[Get a key](https://app.pentestllm.ai/console) [Try it free in the browser](https://pentestllm.ai/playground)

```
from openai import OpenAI

client = OpenAI(base_url="https://api.pentestllm.ai/v1", api_key="sk-ptl-live-…")

reply = client.chat.completions.create(
    model="auto/security",
    messages=[{"role": "user", "content": "Explain this advisory and list what to check on an affected host."}],
)
print(reply.model)  # the build that answered
print(reply.choices[0].message.content)
```

## What the model drafts

- Metadata: The info block: name, author, severity, description, references and classification taken from the advisory.
- Request: The request a detection needs, based on what the advisory says identifies an affected version.
- Matchers: Matchers on version strings, headers or response markers that identify the affected software, with conditions that avoid false positives.
- Extractors: Extractors that pull the version or build number into the output for the report.
- Notes: A short comment on what the template proves and what it does not.

## Detection first

The safest and most useful templates are detections: they identify that an affected version is present and stop there. That answers the question a client asks after an advisory (are we exposed) without touching anything beyond a normal request. Ask the model for a version or fingerprint detection, not for a template that triggers the bug.

Templates that go further belong only in an authorized test where the scope allows it, written and reviewed by the tester. This page covers drafting detection templates; the public template library already covers many disclosed issues, so check it before writing your own.

## Validate and review

Run `nuclei -validate -t your-template.yaml` on every draft. It catches syntax and schema mistakes, which models make. Then read the template line by line: is the request what you expect, are the matchers specific enough, could it match an unaffected version. Run it first against a lab instance of the affected and the fixed version, so you see one hit and one miss.

Only then run it against assets in scope, inside the testing window and rate limits the rules of engagement set. Keep the template and its validation output with the engagement notes.

## Prompting for good templates

Give the model the advisory text, the fixed version, and one existing template from your own collection as a style example. Ask for YAML only, then ask in a second turn for the reasons behind each matcher. A model that cannot justify a matcher usually wrote a weak one. Web fetch at $0.001 per page fetched per call lets it read a public advisory from its URL. For batches, a fast build is enough; send `auto/security` to let the router choose.

## 16 security builds, priced per token

USD per million tokens, live on 2026-11-27; `auto/security` bills at the build that answers.

Detected refusals and invalid non-streamed JSON qualify for automatic refunds within the daily cap. [Verify your receipt](https://pentestllm.ai/statements/verify).

| Model | Build | Input $/M | Output $/M | Context | Wire formats |
| --- | --- | --- | --- | --- | --- |
| [Qwen3.8 27B Cybersecurity](https://pentestllm.ai/models/qwen3.8-27b-cybersecurity) qwen3.8-27b-cybersecurity | Security | $0.40 | $2.40 | 262K | openai |
| [Uncensored Qwen3.8 27b Cybersecurity](https://pentestllm.ai/models/qwen3.8-27b-cybersecurity-uncensored) qwen3.8-27b-cybersecurity-uncensored | Security | $0.40 | $2.40 | 262K | openai |
| [Gemma 4 26B A4B Cybersecurity](https://pentestllm.ai/models/gemma-4-26b-a4b-it-cybersecurity) gemma-4-26b-a4b-it-cybersecurity | Security | $0.4224 | $1.3376 | 262K | openai |
| [Gemma 4 26B A4B Cybersecurity (Uncensored)](https://pentestllm.ai/models/gemma-4-26b-a4b-it-cybersecurity-uncensored) gemma-4-26b-a4b-it-cybersecurity-uncensored | Security | $0.48 | $1.52 | 262K | openai |
| [GLM-5.3 Flash Cybersecurity](https://pentestllm.ai/models/glm-5.3-flash-cybersecurity) glm-5.3-flash-cybersecurity | Security | $0.4935 | $1.645 | 1049K | openai |
| [GLM-5.3 Flash Cybersecurity (Uncensored)](https://pentestllm.ai/models/glm-5.3-flash-cybersecurity-uncensored) glm-5.3-flash-cybersecurity-uncensored | Security | $0.5093 | $1.6975 | 1049K | openai |
| [Red Team (Flash)](https://pentestllm.ai/models/uplink-red-team-flash) uplink-red-team-flash | Security | $0.90 | $3.00 | 1000K | openai |
| [Red Team (Pro)](https://pentestllm.ai/models/uplink-red-team-pro) uplink-red-team-pro | Security | $1.50 | $6.00 | – | openai |
| [OrcaCyber MiniMax M3.1 Flash](https://pentestllm.ai/models/minimax-m3.1-flash-cybersecurity) minimax-m3.1-flash-cybersecurity | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber MiniMax M3.1 Flash (Uncensored)](https://pentestllm.ai/models/minimax-m3.1-flash-cybersecurity-uncensored) minimax-m3.1-flash-cybersecurity-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber Qwen3.8 Flash Next (Uncensored)](https://pentestllm.ai/models/orcacyber-qwen3.8-flash-next-uncensored) orcacyber-qwen3.8-flash-next-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [OrcaCyber Qwen3.8 Flash Next](https://pentestllm.ai/models/qwen3.8-flash-next-cybersecurity) qwen3.8-flash-next-cybersecurity | Security | $2.00 | $4.00 | 262K | openai |
| [Uncensored Qwen3.8 Flash Next Cybersecurity](https://pentestllm.ai/models/qwen3.8-flash-next-cybersecurity-uncensored) qwen3.8-flash-next-cybersecurity-uncensored | Security | $2.00 | $4.00 | 262K | openai |
| [Cyber Frontier](https://pentestllm.ai/models/cyber-frontier) cyber-frontier | Security | $5.25 | $15.75 | 1049K | openai |
| [OrcaCyber Zero 1.5](https://pentestllm.ai/models/orca-zero-1.5-cybersecurity) orca-zero-1.5-cybersecurity | Security | $7.50 | $18.75 | 999K | openai |
| [OrcaCyber Zero 1.5 (Uncensored)](https://pentestllm.ai/models/orca-zero-1.5-cybersecurity-uncensored) orca-zero-1.5-cybersecurity-uncensored | Security | $7.50 | $18.75 | 999K | openai |

[Full price list and tool fees](https://pentestllm.ai/pricing) · [Every model](https://pentestllm.ai/models) · [API docs](https://pentestllm.ai/docs)

## Questions

### Can AI write Nuclei templates?

It drafts them well from an advisory and an example template. Every draft still needs nuclei -validate, a line-by-line review and a lab test before it runs against assets in scope.

### Should the template exploit the issue?

For exposure checks, no: detect the affected version and stop. Anything further belongs only in an authorized test where the scope allows it, written and reviewed by the tester.

### How do I check an AI-written template?

Run nuclei with the validate flag, read every matcher, then test against a lab instance of the affected and the fixed version to see one hit and one miss.

### What does template drafting cost?

Per token from a prepaid balance that starts at $3. A template with an advisory in the prompt is a few thousand tokens, a fraction of a cent on a fast build.

### Who is PentestLLM for?

Security professionals, researchers and students working on systems they own or have written permission to test, and on lab ranges built for practice. Unauthorized testing is not allowed whatever a model says.

## Read next

[Vulnerability research Models for code review, CVE and patch analysis, and advisory writing.](https://pentestllm.ai/vulnerability-research) [AI vulnerability triage Dedupe, rank and route findings with a model, and a person confirming each decision.](https://pentestllm.ai/ai-vulnerability-triage) [Uncensored coding AI Uncensored code models in coding agents for exploit review, tooling and proof-of-concept work in scope.](https://pentestllm.ai/uncensored-coding-ai) [AI pentesting What a model does inside an authorized penetration test, and the builds to run your agent on.](https://pentestllm.ai/ai-pentesting)

## One key, from $3

For systems you own or may test in writing: [acceptable use](https://pentestllm.ai/acceptable-use).

[Get a key](https://app.pentestllm.ai/console)
