Skip to main content

Environment Variables

Complete reference for all environment variables used by the SDK.

Scan API

VariableRequiredDefaultDescription
PANW_AI_SEC_API_KEYOne of key/tokenAPI key for HMAC-SHA256 auth
PANW_AI_SEC_API_TOKENOne of key/tokenPre-obtained bearer token
PANW_AI_SEC_API_ENDPOINTNohttps://service.api.aisecurity.paloaltonetworks.comScan API base URL

Management API

VariableRequiredDefaultDescription
PANW_MGMT_CLIENT_IDYesOAuth2 client ID
PANW_MGMT_CLIENT_SECRETYesOAuth2 client secret
PANW_MGMT_TSG_IDYesTenant Service Group ID
PANW_MGMT_ENDPOINTNohttps://api.sase.paloaltonetworks.com/aisecManagement API base URL
PANW_MGMT_TOKEN_ENDPOINTNohttps://auth.apps.paloaltonetworks.com/oauth2/access_tokenOAuth2 token endpoint

Model Security API

All fall back to the corresponding PANW_MGMT_* variable if not set.

VariableFallbackDefaultDescription
PANW_MODEL_SEC_CLIENT_IDPANW_MGMT_CLIENT_IDOAuth2 client ID
PANW_MODEL_SEC_CLIENT_SECRETPANW_MGMT_CLIENT_SECRETOAuth2 client secret
PANW_MODEL_SEC_TSG_IDPANW_MGMT_TSG_IDTenant Service Group ID
PANW_MODEL_SEC_DATA_ENDPOINThttps://api.sase.paloaltonetworks.com/aims/dataData plane base URL
PANW_MODEL_SEC_MGMT_ENDPOINThttps://api.sase.paloaltonetworks.com/aims/mgmtManagement plane base URL
PANW_MODEL_SEC_TOKEN_ENDPOINTPANW_MGMT_TOKEN_ENDPOINTOAuth2 token endpoint

Red Team API

All fall back to the corresponding PANW_MGMT_* variable if not set.

VariableFallbackDefaultDescription
PANW_RED_TEAM_CLIENT_IDPANW_MGMT_CLIENT_IDOAuth2 client ID
PANW_RED_TEAM_CLIENT_SECRETPANW_MGMT_CLIENT_SECRETOAuth2 client secret
PANW_RED_TEAM_TSG_IDPANW_MGMT_TSG_IDTenant Service Group ID
PANW_RED_TEAM_DATA_ENDPOINThttps://api.sase.paloaltonetworks.com/ai-red-teaming/data-planeData plane base URL
PANW_RED_TEAM_MGMT_ENDPOINThttps://api.sase.paloaltonetworks.com/ai-red-teaming/mgmt-planeManagement plane base URL
PANW_RED_TEAM_TOKEN_ENDPOINTPANW_MGMT_TOKEN_ENDPOINTOAuth2 token endpoint

Debugging

VariableRequiredDefaultDescription
PANW_AI_SEC_DEBUGNoSet to 1/true/yes/on to log every API call to stderr.

When enabled, the SDK logs each HTTP request (method, full URL, headers, body) and response (status, duration, body) to stderr for every domain — scan, management, model security, and red teaming. It logs once per attempt, so retries and 401-driven token refreshes are visible.

Access-token header values (Authorization, x-pan-token) are replaced with a non-reversible sha256:<prefix> hash, so debug logs are safe to share and you can still tell when a token rotates. The raw token is never written.

[airs-sdk] → GET https://api.sase.paloaltonetworks.com/ai-red-teaming/mgmt-plane/v1/custom-attack/list-custom-prompt-sets?limit=1
[airs-sdk] headers {"User-Agent":"PAN-AIRS/0.12.0-typescript-sdk","service-name":"api","Authorization":"sha256:6ba877dddebe"}
[airs-sdk] ← 200 (1397ms) {"pagination":{"total_items":1},"data":[...]}

Enable it inline for a single run:

PANW_AI_SEC_DEBUG=1 npx tsx your-script.ts

Request and response bodies are logged verbatim. They may contain prompt content — keep debug logging off in production and scrub captured output before sharing.

Example Scripts

The following variables are not consumed by the SDK itself. They are used only by the example scripts in examples/.

VariableUsed ByDescription
PANW_AI_SEC_PROFILE_NAMEexamples/*.pySecurity profile name passed to scan requests