Skip to main content

AI Guard API Reference

Base URL

ai-guard.<csp>.<region>.pangea.cloud

post/v1/text/guard
curl -sSLX POST 'https://ai-guard.aws.us.pangea.cloud/v1/text/guard' \
-H 'Authorization: Bearer <your_token>' \
-H 'Content-Type: application/json' \
-d '{}'

Response


Text Guard for scanning LLM inputs and outputs

POST
https://ai-guard.aws.us.pangea.cloud/v1/text/guard

Analyze and redact text to avoid manipulation of the model, addition of malicious content, and other undesirable data transfers.

Structured messages data to be scanned by AI Guard for PII, sensitive data, malicious content, and other data types defined by the configuration. Supports processing up to 20 KiB of JSON text using models: AzureAi, Bedrock, Claude, Cohere, Dbrx, Falcon, Gemini, LangChain, Meta, Mistral, OpenAi, Pangea.

string

Text to be scanned by AI Guard for PII, sensitive data, malicious content, and other data types defined by the configuration. Supports processing up to 20 KiB of text.

string
(default: "pangea_prompt_guard")

Recipe key of a configuration of data types and settings defined in the Pangea User Console. It specifies the rules that are to be applied to the text, such as defang malicious URLs.

boolean
(default: false)

Setting this value to true will provide a detailed analysis of the text data

object
object
boolean
string
boolean
object
boolean
string
object
boolean
string
object
boolean
string
object
boolean
string
object
boolean
string
object
boolean
string
string
string
object
boolean
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
object
boolean
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
string
object

Additional fields to include in activity log.

string

Origin or source application of the event. Examples: 'Slack', 'GDrive', 'Confluence', 'Workday'.

string

Stores supplementary details related to the event.

string

Model used to perform the event. Example: '{model: gpt, version: 3.5}'.

string

IP address of user or app or agent.

string

Tools used to perform the event. Example: '{tool:ai-guard}'.

object

Pangea standard response schema

object
string

Updated prompt text, if applicable.

object

Updated structured prompt, if applicable.

boolean

Whether or not the prompt triggered a block detection.

string

The Recipe that was used.

object

Result of the recipe analyzing and input prompt.

object
boolean

Whether or not the Prompt Injection was detected.

object

Details about the analyzers.

string

The action taken by this Detector

array<object>

Triggered prompt injection analyzers.

string
number
object
boolean

Whether or not the PII Entities were detected.

object

Details about the detected entities.

array<object>

Detected redaction rules.

string

The action taken on this Entity

string
string
boolean
number
object
boolean

Whether or not the Malicious Entities were detected.

object

Details about the detected entities.

array<object>

Detected harmful items.

string
string
boolean
number
object
object
boolean

Whether or not the Custom Entities were detected.

object

Details about the detected entities.

array<object>

Detected redaction rules.

string

The action taken on this Entity

string
string
boolean
number
object
boolean

Whether or not the Secret Entities were detected.

object

Details about the detected entities.

array<object>

Detected redaction rules.

string

The action taken on this Entity

string
string
boolean
number
object
boolean

Whether or not the Toxic Entities were detected.

object

Details about the detected entities.

array<object>

Detected redaction rules.

string

The action taken on this Entity

string
string
boolean
number
object
boolean

Whether or not the Languages were detected.

object

Details about the detected languages.

string

The action taken by this Detector

string
object
boolean

Whether or not the Code was detected.

object

Details about the detected code.

string

The action taken by this Detector

string
string (base64)

If an FPE redaction method returned results, this will be the context passed to unredact.

string

A unique identifier assigned to each request made to the API. It is used to track and identify a specific request and its associated data. The request_id can be helpful for troubleshooting, auditing, and tracing the flow of requests within the system. It allows users to reference and retrieve information related to a particular request, such as the response, parameters, and raw data associated with that specific request.

"request_id":"prq_x6fdiizbon6j3bsdvnpmwxsz2aan7fqd"
string

The timestamp indicates the exact moment when a request is made to the API. It represents the date and time at which the request was initiated by the client. The request_time is useful for tracking and analyzing the timing of requests, measuring response times, and monitoring performance metrics. It allows users to determine the duration between the request initiation and the corresponding response, aiding in the assessment of API performance and latency.

"request_time":"2022-09-21T17:24:33.105Z"
string

Duration it takes for the API to process a request and generate a response. It represents the elapsed time from when the request is received by the API to when the corresponding response is returned to the client.

"response_time":"2022-09-21T17:24:34.007Z"
string

It represents the status or outcome of the API request made for IP information. It indicates the current state or condition of the request and provides information on the success or failure of the request.

"status":"success"
string

Provides a concise and brief overview of the purpose or primary objective of the API endpoint. It serves as a high-level summary or description of the functionality or feature offered by the endpoint.

Status Codes
StatusStatus CodeDescription
AIGBadInputFormat400

The input schema is not currently supported.

AIGFileTooLarge400

File size too large.

AIGInvalidRecipe400

Recipe contains invalid contents.

AIGMissingSvConnection400

A service dependency was not set up.

NoProviderConfigured400

Provider for intelligence services used by ai-guard is not configured

RecipeNotExist400

Recipe does not exist in the ai-guard configuration

AIGServiceConfigFetchError500

Failed to fetch the dependent '{service_name}' service configuration from Pangea Cloud.

Was this article helpful?

Contact us