Skip to main content

AI Guard | Node.js SDK

AI Guard

constructor(token: string, config: PangeaConfig): AIGuardService

Creates a new AIGuardService with the given Pangea API token and configuration.

required parameters

string

Pangea API token.

Configuration.

Response Object

AIGuardService
const config = new PangeaConfig({ domain: "pangea_domain" });
const aiGuard = new AIGuardService("pangea_token", config);

Text guard (Beta)

guardText(request: TextGuardRequest): Promise<PangeaResponse<TextGuardResult>>

Undocumented.

required parameters

TextGuardRequest

Request parameters.

Response Object

Promise<PangeaResponse<TextGuardResult>>
const response = await aiGuard.guardText({
  text: "foobar",
});

Interface Detector

Detector

required parameters

null | T
boolean

Interface MaliciousEntity

MaliciousEntity

required parameters

string
string

optional parameters

boolean
number

Interface PIIEntity

PIIEntity

required parameters

string
string

optional parameters

boolean
number

Interface TextGuardRequest

TextGuardRequest

required parameters

string

optional parameters

boolean
[object Object] | pangea_prompt_guard

Interface TextGuardResult

TextGuardResult

required parameters

string