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

Get a keyTry it free in the browser
python
1from openai import OpenAI
2
3client = OpenAI(base_url="https://api.pentestllm.ai/v1", api_key="sk-ptl-live-…")
4
5reply = client.chat.completions.create(
6 model="auto/security",
7 messages=[{"role": "user", "content": "Explain this advisory and list what to check on an affected host."}],
8)
9print(reply.model) # the build that answered
10print(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.

Uncensored models and their prices per million tokens
Wire formats
Qwen3.8 27B Cybersecurityqwen3.8-27b-cybersecuritySecurity$0.40$2.40262Kopenai
Uncensored Qwen3.8 27b Cybersecurityqwen3.8-27b-cybersecurity-uncensoredSecurity$0.40$2.40262Kopenai
Gemma 4 26B A4B Cybersecuritygemma-4-26b-a4b-it-cybersecuritySecurity$0.4224$1.3376262Kopenai
Gemma 4 26B A4B Cybersecurity (Uncensored)gemma-4-26b-a4b-it-cybersecurity-uncensoredSecurity$0.48$1.52262Kopenai
GLM-5.3 Flash Cybersecurityglm-5.3-flash-cybersecuritySecurity$0.4935$1.6451049Kopenai
GLM-5.3 Flash Cybersecurity (Uncensored)glm-5.3-flash-cybersecurity-uncensoredSecurity$0.5093$1.69751049Kopenai
Red Team (Flash)uplink-red-team-flashSecurity$0.90$3.001000Kopenai
Red Team (Pro)uplink-red-team-proSecurity$1.50$6.00–openai
OrcaCyber MiniMax M3.1 Flashminimax-m3.1-flash-cybersecuritySecurity$2.00$4.00262Kopenai
OrcaCyber MiniMax M3.1 Flash (Uncensored)minimax-m3.1-flash-cybersecurity-uncensoredSecurity$2.00$4.00262Kopenai
OrcaCyber Qwen3.8 Flash Next (Uncensored)orcacyber-qwen3.8-flash-next-uncensoredSecurity$2.00$4.00262Kopenai
OrcaCyber Qwen3.8 Flash Nextqwen3.8-flash-next-cybersecuritySecurity$2.00$4.00262Kopenai
Uncensored Qwen3.8 Flash Next Cybersecurityqwen3.8-flash-next-cybersecurity-uncensoredSecurity$2.00$4.00262Kopenai
Cyber Frontiercyber-frontierSecurity$5.25$15.751049Kopenai
OrcaCyber Zero 1.5orca-zero-1.5-cybersecuritySecurity$7.50$18.75999Kopenai
OrcaCyber Zero 1.5 (Uncensored)orca-zero-1.5-cybersecurity-uncensoredSecurity$7.50$18.75999Kopenai

Full price list and tool fees · Every model · API 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

One key, from $3

For systems you own or may test in writing: acceptable use.

Get a key

Join on TelegramHelp