Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ These APIs protect your AI models, AI applications, AI datasets, and AI agents b
The APIs efficiently scan for various threats, including prompt injections, insecure outputs, AI agentic threats, and sensitive data loss.
To use these APIs, send prompts or model responses from your application and receive a threat assessment with recommended actions based on your AI security profile.

For licensing, onboarding, activation, and to obtain the API authentication key and profile name, refer to the [Prisma AIRS API](https://docs.paloaltonetworks.com/ai-runtime-security/activation-and-onboarding/ai-runtime-security-api-intercept-overview) administration documentation.
For licensing, onboarding, activation, and to obtain the API authentication key and profile name, refer to the [Prisma AIRS AI Runtime API intecept](https://docs.paloaltonetworks.com/ai-runtime-security/activation-and-onboarding/ai-runtime-security-api-intercept-overview) administration documentation.

## Scan API Endpoints

Expand Down Expand Up @@ -60,3 +60,8 @@ For complete details, refer to adminstration guide for the section on how to "ma
- One API key per deployment profile - Each deployment profile in the [Customer Support Portal](https://support.paloaltonetworks.com/Support/Index) allows a single API key.
- 2 MB maximum payload size per synchronous scan request - Limited to a maximum of 100 URLs per request.
- 5 MB maximum payload size per asynchronous scan request - Limited to a maximum of 100 URLs per request.
- The following size limitations apply:

- context: 100k characters limit on the contextual grounding context
- prompt: 10k characters
- response: 20k characters
34 changes: 34 additions & 0 deletions products/prisma-airs/api/airuntimesecurity/errorcodes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
id: errorcodes
title: "Error Codes"
sidebar_label: "Error Codes"
keywords:
- Prisma AIRS API
- Reference
- Cloud
- API
---

This page specifies the error codes for the Prisma AIRS AI Network: API intercept scan APIs.
An error response in the API appears in the following format:

```json
{
"error": {
"message": "Successfully scanned request"
}
}
```

| HTTP Status Code | Description | Common Scenario |
|---|---|---|
| **200** | Successfully scanned request | The request was completed successfully, and the scan results were returned |
| **400** | Bad Request - Request data is invalid or malformed | - Empty request body<br>- Unreadable request body<br>- Wrong request format<br>- No scan content provided in the scan request<br>- Both prompt and response are null<br>- Empty prompt: Scan request content's prompt is empty<br>- Empty response: Scan request content's response is empty<br>- No scan IDs provided<br>- Too many scan IDs: maximum 5 scan IDs allowed<br>- Scan ID length exceeds maximum allowed characters (36 characters allowed)<br>- Invalid scan ID format<br>- Invalid scan ID<br>- No report IDs provided<br>- Too many report IDs: maximum 5 report IDs allowed<br>- Report ID length exceeds maximum length (37 characters allowed)<br>- Profile ID invalid: Missing or bad profile ID format, must follow UUID format (for example, 12345678-0000-1234-1234-123456789012)<br>- Profile name invalid: Missing profile name or length exceeds the 100 characters limit |
| **401** | Unauthenticated - Not Authenticated | - Missing API key or Oauth token |
| **403** | Forbidden - Invalid API Key | - Invalid, revoked, or expired API key |
| **404** | Not Found - Resource is not found | - Invalid API endpoint |
| **405** | Method Not Allowed | - Using the wrong HTTP method (Refer to the Scan endpoints [reference docs](https://pan.dev/prisma-airs/api/airuntimesecurity/prisma-airs-ai-runtime-api-intercept/) for the relevant methods for each endpoint)<br>- Endpoint doesn't support the requested method |
| **413** | Request Too Large - The request body is too large | - Scan content exceeds [size limits](https://pan.dev/prisma-airs/scan/api/) |
| **415** | Unsupported Media Type | - Missing Content-Type header<br>- Content-Type is not application/json |
| **429** | Too Many Requests - Request exceeds the limit | - API rate limit exceeded (Refer to the [limitations](https://pan.dev/prisma-airs/scan/api/) page for details)<br>- Too many concurrent scans<br>Limitations<br>* Synchrounous & asynchronous scans are limited based on API call quota<br>* Scan results and reports are not subject to an API call quota, but are subject to a 10 requests limit per minute|
| **500** | Internal Server Error | - Unexpected server error |
10 changes: 5 additions & 5 deletions products/prisma-airs/api/airuntimesecurity/pythonsdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ keywords:
- API
---

Prisma AIRS API Python SDK simplifies the integration of advanced AI security scanning capabilities into Python applications.
Prisma AIRS AI Runtime API Python SDK simplifies the integration of advanced AI security scanning capabilities into Python applications.

It supports Python version 3.9 through 3.13, it offers synchronous and asynchronous scanning, robust error handling, and configurable retry strategies.
It supports Python version `3.9` through `3.13`, it offers synchronous and asynchronous scanning, robust error handling, and configurable retry strategies.

To get started:

* Get the the [API key token and API security profile name](https://docs.paloaltonetworks.com/ai-runtime-security/administration/prevent-network-security-threats/api-intercept-create-configure-security-profile) (or API security profile ID).

* Install `aisecurity` package using pip, set environment variables, and initialize the Python SDK. (Refer to the Python SDK [installation guide](https://docs.paloaltonetworks.com/ai-runtime-security/activation-and-onboarding/ai-runtime-security-api-intercept-overview/airs-apis-python-sdk) for detailed steps.)
* Install `pan-aisecurity` package using pip, set environment variables, and initialize the Python SDK. (Refer to the Python SDK [installation guide](https://docs.paloaltonetworks.com/ai-runtime-security/activation-and-onboarding/ai-runtime-security-api-intercept-overview/airs-apis-python-sdk) for detailed steps.)

* Create a Scanner instance referring to the Python SDK usage examples.
A scanner instance performs security scans on your AI-generated content.
Expand All @@ -35,9 +35,9 @@ Each usage can use two functions:

## Error Handling & Exceptions

When the client is unable to fetch the expected response from the API server, a subclass of aisecurity.exceptions.AISecSDKException is raised.
When the client is unable to fetch the expected response from the API server, a subclass of `aisecurity.exceptions.AISecSDKException` is raised.

There are five types of Exceptions defined in aisecurity/exceptions.py:
There are five types of Exceptions defined in `aisecurity/exceptions.py`:

* AISEC_SERVER_SIDE_ERROR: Errors returned by the API server. For example, an invalid API key.
* AISEC_CLIENT_SIDE_ERROR: Errors that occur on the client side. For example, a network connection issue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords:
- API
---

This page covers the key use cases of the AI Runtime Security Python SDK asyncio scan types with synchronous and asynchronous methods.
This page covers the key use cases of the Prisma AIRS AI Runtime API Python SDK asyncio scan types with synchronous and asynchronous methods.
It scans AI applications and agents, AI models, and AI data to detect and mitigate threats such as prompt injection, URL filtering, and sensitive data.
Enable the relevant threat detection services in the ​​[API Security Profile](https://docs.paloaltonetworks.com/prisma-airs/administration/prevent-network-security-threats/api-intercept-create-configure-security-profile).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords:
- API
---

This page covers the key use cases of the AI Runtime Security Python SDK inline scan types with synchronous and asynchronous methods.
This page covers the key use cases of the Prisma AIRS AI Runtime API Python SDK inline scan types with synchronous and asynchronous methods.
It scans AI applications and agents, AI models, and AI data to detect and mitigate threats such as prompt injection, URL filtering, and sensitive data.
Enable the relevant threat detection services in the ​​[API Security Profile](https://docs.paloaltonetworks.com/prisma-airs/administration/prevent-network-security-threats/api-intercept-create-configure-security-profile).

Expand Down
Loading