Prompt-Protect API

WAI Docs Wed Aug 19 13:22:37 EDT 2026
List
Quick Start
Welcome
Supported Applications & LLMs
Release Notes
August 18, 2026 WitnessAI Release
August 4, 2026 WitnessAI Release
July 21, 2026 WitnessAI Release
July 14, 2026 WitnessAI Release
July 9, 2026 WitnessAI Release
June 30, 2026 WitnessAI Hotfix
June 23, 2026 WitnessAI Release
June 16, 2026 WitnessAI Release
June 11, 2026 WitnessAI Release
June 4, 2026 WitnessAI Hotfix
June 2, 2026 WitnessAI Update
May 19, 2026 WitnessAI Update
April 30, 2026 WitnessAI Update
April 28, 2026 WitnessAI Update
April 23, 2026 WitnessAI Update
April 16, 2026 WitnessAI Update
April 14, 2026 WitnessAI Update
April 9, 2026 WitnessAI Update
April 9, 2026 WitnessAI Update
April 7, 2026 WitnessAI Update
April 2, 2026 WitnessAI Update
March 31, 2026 WitnessAI Update
March 24, 2026 WitnessAI Update
March 19, 2026 WitnessAI Update
March 17, 2026 WitnessAI Update
March 12, 2026 WitnessAI Update
March 5, 2026 WitnessAI Update
February 26, 2026 WitnessAI Update
February 24, 2026 WitnessAI Update
February 10, 2026 WitnessAI Update
January 27, 2026 WitnessAI Update
January 20, 2026 WitnessAI Update
January 13, 2026 WitnessAI Update
December 18, 2025 WitnessAI Update
December 9, 2025 WitnessAI Update
November 25, 2025 WitnessAI Update
November 18, 2025 WitnessAI Update
November 11, 2025 WitnessAI Update
October 28, 2025 WitnessAI Update
October 23, 2025 WitnessAI Update
October 9, 2025 WitnessAI Update
October 2, 2025 WitnessAI Update
September 30, 2025: WitnessAI Update
September 23, 2025: WitnessAI Update
August 12, 2025: WitnessAI Update
July 31, 2025: WitnessAI Update
July 18, 2025: WitnessAI Update
April 11, 2025: WitnessAI Release v2.0
June 9, 2025: WitnessAI Update
June 23, 2025: WitnessAI Update
TOC Left Sidebar: not active
TOC Left Sidebar: ORIGINAL
User Guide
Policies - GuardRails
Witness Anywhere: Remote Device Security
Witness Attack
Administrator Guide
404
 

Prompt-Protect API

Description

Refer to the API Reference page for an explanation of the API process.
The Prompt-Protect API performs the functions of the input, text-completion, and complete APIs in a single step, without interruption.
notion image

Field Descriptions

Input Fields

Field: Text Type: string Example: "What are some terms that mean lawyer?"
Description: The User Prompt text to be protected.
Field: provider_name Type: string Example: "openai"
Description: Name of the provider.
Field: model_name Type: string Example: "gpt-4o"
Description: Name of the model.
Object: user
Field: User email Type: string Example: you@yourorg.com
Object: caller
Field: application_name Type: string Example: myapp1
Description: Name of the application as displayed in the console.
Field: detailed_output Type: boolean Example: [true|false]
Description: Instructs output to include detailed logs and scorecards.

Response Fields

Field: request_id Type: string
Example: "f0078d68-0700-0000-0000-000023cf7b99".
Description: UUID for this prompt.
Field: conversation_id Type: string
Example: "f0078d68-0700-0000-0000-000023cf7b99".
Description: UUID for this conversation.
Field: text Type: string Example:
Description: input text
Field: report Type: array Example: See Example 200 Response.
Description: Array of Scorecards.
Field: warning_count Type: integer Example: 0
Description: Total warnings from all scorecards.
Field: error_count Type: integer Example: 0
Description: Total guardrails that could not execute (not pass / fail)
Field: incomplete_count Type: integer Example: 0
Description: Total guardrails that timed out. Not currently used.
Field: input_score Type: integer Example: 0
Description: Not currently used.
Field: output_score Type: integer Example: 0
Description: Not currently used.
Field: combined_score Type: integer Example: 0
Description: Not currently used. input_score + output_score.
Field: risk_score Type: integer Example: 0-3
Description: 0-3; 0 being no risk, 3 being high risk.
Field: result Type: string Example: “pass” or “fail”.
Description: Pass / fail string.
Field: block_flow Type: boolean Example: [true|false]
Description: Based on policy interpretation.

Scorecard Fields

💡
The API Response includes a “report” field, which consists of an array of “Scorecards”.
Field: id Type: string
Example: "f0078d68-0700-0000-0000-000023cf7b99"
Description: UUID for scorecard.
Field: prompt_id Type: string
Example: "f0078d68-0700-0000-0000-000023cf7b99"
Description: UUID for for prompt
Field: report_type Description: not currently used
Field: started Type: datetime Description: start time of run
Field: completed_at. Type: datetime Description: end time of run
Field: data_modified Type: boolean Example: [true|false]
Description: Specifies if input data was modified, or required redaction.
Field: risk_type Type: string Example: "Data Leakage"
Description: readable string of whatever risk was found
Field: risk_metric Type: string Example: "none", "low", "medium", "high".
Field: message Type: string
Description: Message that is guardrail specific. For the intention classifier, it is the User Prompt intent.
Field: result Type: string Example: “pass” or “fail”
Field: filter_identifier Type: string
Example: "fl-pre-intention-classifier"
Description: filter name

Example Request

curl --request POST \ --url https://api.witnessai.yourco.com/v1/guardrail/prompt-protect \ --header 'accept: application/json' \ --header 'authorization: bearer your-authenticaton-token' \ --header 'content-type: application/json' \ --data ' { "text": "payment American Express: 3714-496353-98431 or 371449635398431", "provider_name": "openai", "model_name": "gpt-4o", "user": { "email": "admin@yourco.com" }, "caller": { "application_name": "Custom App", "application_version": "v1.0.1" } } '

Example 200 Response

{ "request_id": "f0078d68-0100-0000-0000-00007845779e", "conversation_id": "f0078d68-0700-0000-0000-000023cf7b99", "text": "payment American Express: [TEMPLATE_CREDIT_CARD_2] or [TEMPLATE_CREDIT_CARD_1]", "report": { "score_cards": [ { "id": "f0078d68-0c00-0000-0000-00003bd96865", "prompt_id": "f0078d68-0100-0000-0000-00007845779e", "report_type": "", "started_at": "2025-08-01T18:31:12.358245Z", "completed_at": "2025-08-01T18:31:12.366365Z", "data_modified": true, "confidence": 100, "risk_score": 3, "risk_type": "Data Leakage", "risk_metric": "High", "message": "input required anonymization", "result": "pass", "filter_identifier": "fl-pre-anonymizer", "rule_result": "warn", "rule_message": "Data Protection set to Warn Action ." }, { "id": "f0078d68-0c00-0000-0000-000018423116", "prompt_id": "f0078d68-0100-0000-0000-00007845779e", "report_type": "", "started_at": "2025-08-01T18:31:12.349592Z", "completed_at": "2025-08-01T18:31:12.94504Z", "data_modified": false, "risk_type": "None", "risk_metric": "None", "message": "Process financial payment", "result": "pass", "filter_identifier": "fl-pre-topic-categorizer" }, { "id": "f0078d68-0c00-0000-0000-0000009fbefa", "prompt_id": "f0078d68-0100-0000-0000-00007845779e", "report_type": "", "started_at": "2025-08-01T18:31:12.350063Z", "completed_at": "2025-08-01T18:31:12.410792Z", "data_modified": false, "risk_type": "None", "risk_metric": "None", "message": "prompt injection was not detected", "result": "pass", "filter_identifier": "fl-pre-risk-analysis" }, { "id": "f6078d68-0c00-0000-0000-0000a1fdc565", "prompt_id": "f0078d68-0100-0000-0000-00007845779e", "report_type": "", "started_at": "2025-08-01T18:31:18.854834Z", "completed_at": "2025-08-01T18:31:18.918675Z", "data_modified": false, "risk_type": "None", "risk_metric": "None", "message": "[]", "result": "pass", "filter_identifier": "fl-pre-intention-classifier" } ], "warning_count": 0, "error_count": 0, "incomplete_count": 0, "input_score": 0, "output_score": 0, "combined_score": 0, "risk_score": 3, "result": "pass" }, "block_flow": false, "route": false, "text_modified": true, "prompt_instructions": "Below is a request that may contain predefined placeholders, such as [TEMPLATE_PERSON_1], [TEMPLATE_CREDIT_CARD_2], etc.,In your response to the request, if your response needs to include a placeholder for context, you must preserve the format by keeping it in uppercase.Do not modify these placeholders in any manner. Do not add any new placeholders.", "messages": [ "Data Protection set to Warn Action ." ] }

HTTP Status Codes

200: Successful
400: Bad Request
401: Unauthorized
500: Internal Server Error