API Reference

API Reference

List view
Quick Start
User Guide
Policies & GuardRails
Witness Anywhere: Remote Device Security
Witness Attack
Administrator Guide

WitnessAI API Overview

WitnessAI provides four APIs, giving your Custom Applications the ability to apply your Policy and Guardrail protections as a single API request, or in a step-by-step manner, with granular control over the process.
notion image
These three APIs provide granular control:
The “Input” API submits an Unprocessed Prompt to WitnessAI.
  • The Unprocessed Prompt is not forwarded from WitnessAI to the Destination App or LLM. (collectively “Apps”).
  • WitnessAI processes the Risky Prompt in the same way it does for any of the AI Apps we support.
  • WitnessAI responds to the input API request with a Safe Prompt, plus an array of “Scorecards” providing detailed information on intention classification, risk scores, redaction tokens, and output of all Policies and Guardrails that match the sources, prompt data, and destinations of the input request.
 
The “Text-Completion” API instructs WitnessAI to submit the Safe Prompt to the Destination App.
  • The Safe Prompt is processed by WitnessAI, and forwarded to the Destination App.
 
The “Complete”API is used to process the response of the Destination App to the Safe Prompt WitnessAI submitted to the Destination App.
  • The Destination App responds to the Safe Prompt, and WitnessAI processes the response through your Response Policies and Guardrails, for example the “Harmful Response” Guardrail.
  • WitnessAI returns the Safe Response back to your Custom App that submitted the input API request.
 
“Prompt-Protect” is the forth API.
  • “Prompt-Protect” completes the three steps above with a single API request, without interruption.

Interactive Testing

WitnessAI APIs can be tested interactively at: witnessapi.readme.io.
The password is: akuCR9jUKnZ42ojnCrcxpok#
When you login to the API site, a cookie is set in your browser that keeps you logged in for seven days.

Full API Documentation

Input API

Text-Completion API

Complete API

Prompt-Protect API