🧠 AI Assistant
Getting Started

Getting Started with AI Assistant

Quick use:

nat ai plan --spec openapi.yaml

Prerequisites

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 key

Custom provider β€” environment variables:

export NAT_AI_PROVIDER=openai
export NAT_AI_API_KEY=sk-...
nat ai plan --spec openapi.yaml

Custom 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 --version

You need v2.0 or later for AI Assistant support.

Point NAT at your spec

nat ai plan --spec openapi.yaml

If you don't have a spec yet, NAT will probe the target URL to discover endpoints:

nat ai plan --target https://api.example.com

Review 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 json

Run the plan

Feed the plan directly into a scan:

nat scan --plan plan.json

Understanding quotas

PlanAI queriesDashboard ChatProactive Insights
Free5 / month5 / monthβ€”
ProUnlimitedUnlimitedβ€”
TeamUnlimitedUnlimitedβœ…

Quota usage resets on the first of each month. Check your current usage with nat ai status.


Want to just scan? Quick Scan guide β†’

Was this helpful?