Getting Started with AI Assistant
Quick use:
nat ai plan --spec openapi.yamlPrerequisites
Before using the AI Assistant, make sure you have:
- NAT CLI installed β
pip install nat-engine(v2.0+) - API key configured β OpenAI key, or use NAT's built-in free tier (5 queries/month)
- OpenAPI spec (optional) β improves test plan and generation quality significantly
Configure your AI provider
By default, NAT uses its own OpenAI integration β no key needed for the free tier (5 queries/month). To use your own provider, set environment variables or add an ai_assistant block to your .natrc.
Default (no config required):
nat ai plan --spec openapi.yaml # uses NAT's built-in keyCustom provider β environment variables:
export NAT_AI_PROVIDER=openai
export NAT_AI_API_KEY=sk-...
nat ai plan --spec openapi.yamlCustom provider β .natrc config:
ai_assistant:
provider: openai
model: gpt-4o
api_key: ${NAT_AI_API_KEY}See AI Providers for Anthropic, Ollama, and Azure OpenAI configuration.
Your first AI query
Confirm your CLI version
nat --versionYou need v2.0 or later for AI Assistant support.
Point NAT at your spec
nat ai plan --spec openapi.yamlIf you don't have a spec yet, NAT will probe the target URL to discover endpoints:
nat ai plan --target https://api.example.comReview the generated plan
NAT outputs a prioritized list of test scenarios ranked by severity, business impact, and attack surface. By default the plan is printed to stdout as Markdown.
nat ai plan --spec openapi.yaml --output plan.json --format jsonRun the plan
Feed the plan directly into a scan:
nat scan --plan plan.jsonUnderstanding quotas
| Plan | AI queries | Dashboard Chat | Proactive Insights |
|---|---|---|---|
| Free | 5 / month | 5 / month | β |
| Pro | Unlimited | Unlimited | β |
| Team | Unlimited | Unlimited | β |
Quota usage resets on the first of each month. Check your current usage with nat ai status.
Want to just scan? Quick Scan guide β