Documentation
Getting Started
Setup Wizard

Setup Wizard

nat setup is a 7-phase interactive wizard that configures NAT from scratch. It detects your environment, asks a few questions, tests your exporter connection live, and writes a .natrc file — all in one command.

Run nat setup immediately after pip install nat-engine. It replaces manual .natrc editing for first-time configuration.

Quick start

pip install nat-engine
nat setup

That's it. The wizard guides you through every decision. When it finishes you can run nat scan straight away.

The 7 phases explained

Phase 1 — Environment Detection

NAT inspects your system before asking any questions:

  • Python version and OS
  • Whether Docker is available
  • Whether a .natrc already exists in the current directory or ~/.natrc

If an existing .natrc is found you are asked whether to overwrite it or exit.

Phase 2 — Deployment Mode

Choose how you want to run NAT:

ModeDescription
SaaSConnect to app.nat-testing.io (opens in a new tab) — results sync to the cloud dashboard
Self-HostedRun the NAT server on your own infrastructure
CLI-onlyOffline mode — results stay local, no server required

Phase 3 — API Spec / Ingestion Setup

Provide the API you want to test:

  • Spec path or URL — an OpenAPI 3.x / Swagger 2.x file on disk or a remote URL
  • Base URL — the API's root URL (e.g. https://api.example.com)
  • Auto-detection — if you skip the spec, NAT will attempt to auto-discover endpoints from the base URL

Phase 4 — API Authentication

Select how NAT should authenticate to your API:

TypeDetails
Bearer tokenProvide a static Authorization: Bearer … token
API keyProvide a header name and value
OAuth2Provide token URL, client ID, secret, and scopes
NoneNo authentication (public APIs)

Phase 5 — Export Destination

Choose where NAT sends findings. NAT tests the connection live before writing the config.

ExporterDescription
GitHub IssuesCreate issues in a GitHub repo
JiraCreate tickets in a Jira project
GitLabCreate issues in a GitLab project
LinearCreate issues in a Linear team
Azure DevOpsCreate work items in an Azure DevOps project
ShortcutCreate stories in a Shortcut project
PagerDutyCreate incidents in PagerDuty
ServiceNowCreate incidents in ServiceNow
WebhookPOST findings to any HTTP endpoint
SentryCreate events/issues in Sentry
BugzillaCreate bugs in Bugzilla via REST API

See the Exporter Configuration guide for per-exporter credential details.

NAT calls test_connection() on the selected exporter before saving. If the connection fails, you are prompted to re-enter credentials or skip.

Phase 6 — Write Configuration

NAT generates a .natrc file in the current directory. Example output:

# .natrc — generated by nat setup
mode: saas
spec: ./openapi.yaml
base_url: https://api.example.com
auth:
  type: bearer
  token: "YOUR_TOKEN"
export: github
export_config:
  github_token: "ghp_..."
  github_repo: "your-org/your-repo"
export_min_severity: medium
⚠️

Run chmod 600 .natrc after setup to restrict file permissions — it may contain API tokens.

Phase 7 — Verify & First Run

NAT validates the generated config with nat doctor, then optionally runs an immediate scan so you can confirm everything works end-to-end.

Non-interactive mode (CI/CD)

Use --non-interactive to skip all prompts and read configuration entirely from environment variables:

nat setup --non-interactive

Core environment variables

VariableDescription
NAT_MODEsaas, self-hosted, or cli-only
NAT_SPEC_PATHPath or URL to the OpenAPI spec
NAT_BASE_URLAPI base URL
NAT_AUTH_TOKENBearer token (if auth type is bearer)
NAT_EXPORTExporter name (e.g. github, jira, webhook)

Exporter-specific environment variables

VariableDescription
NAT_GITHUB_TOKENGitHub personal access token
NAT_GITHUB_REPOTarget repository (owner/repo)

CI/CD example

# GitHub Actions
- name: Configure NAT
  env:
    NAT_MODE: saas
    NAT_SPEC_PATH: ./openapi.yaml
    NAT_BASE_URL: https://staging.example.com
    NAT_AUTH_TOKEN: ${{ secrets.STAGING_TOKEN }}
    NAT_EXPORT: github
    NAT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    NAT_GITHUB_REPO: ${{ github.repository }}
  run: nat setup --non-interactive

--demo flag

Add --demo to automatically launch nat demo after setup completes:

nat setup --demo

Useful for immediately verifying the installation with a sandboxed example scan.

The .natrc file

nat setup writes .natrc in the current working directory. NAT also falls back to ~/.natrc for user-wide defaults.

# .natrc
mode: saas                   # saas | self-hosted | cli-only
spec: ./openapi.yaml         # path or URL to OpenAPI spec
base_url: https://api.example.com
auth:
  type: bearer               # bearer | api-key | oauth2 | none
  token: "YOUR_TOKEN"
export: github               # exporter name
export_config:
  github_token: "ghp_..."
  github_repo: "your-org/your-repo"
export_min_severity: medium  # info | low | medium | high | critical

Use nat doctor at any time to validate your .natrc and check connectivity to all configured services.

Supported exporters

ExporterKeyGuide
GitHub IssuesgithubExporter Configuration
JirajiraExporter Configuration
GitLabgitlabExporter Configuration
LinearlinearExporter Configuration
Azure DevOpsazure-devopsExporter Configuration
ShortcutshortcutExporter Configuration
PagerDutypagerdutyExporter Configuration
ServiceNowservicenowExporter Configuration
WebhookwebhookExporter Configuration
SentrysentryExporter Configuration
BugzillabugzillaExporter Configuration

Next steps

Was this helpful?