AI-Powered Template Generation

Nuclei supports generating and running templates on-the-fly using AI capabilities powered by the ProjectDiscovery API. This feature allows you to perform quick, targeted scans without needing pre-written templates by describing what you want to detect in natural language.

Prerequisites

A ProjectDiscovery API key (Get one at cloud.projectdiscovery.io)

Configure your API key

Method 1: Using CLI (Recommended)

nuclei -auth

# Enter your API key when prompted

Method 2: Environment Variable

export PDCP_API_KEY=your_api_key_here

Usage Examples

Finding Sensitive Information Leaks:

nuclei -list targets.txt -ai "Find admin_api_key in response"

Detecting Debug Information:

nuclei -list targets.txt -ai "Detect exposed stack traces in error messages"

Discovering Admin Interfaces:

nuclei -list targets.txt -ai "Find admin login endpoints"

Identifying Exposed Secrets:

nuclei -list urls.txt -ai "Detect secrets in response"

Extract Page Titles:

nuclei -list targets.txt -ai "Extract page titles"

Important Notes

  • The -ai flag requires an active internet connection to communicate with the ProjectDiscovery API.
  • Generated templates are stored both locally on your computer and in your ProjectDiscovery cloud account for future reference.
  • For privacy, your prompts and generated templates are not used for AI training.
  • Currently, each user is limited to 100 AI template generation queries per day. This limit is subject to change based on usage patterns and to prevent abuse.