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 IntelResults

IntelResults

required parameters

Array<string>

The categories that apply to this indicator as determined by the provider.

number

The score, given by the Pangea service, for the indicator.

malicious | suspicious | unknown | benign

The verdict for the indicator.

Interface RedactRecognizerResult

RedactRecognizerResult

required parameters

number

The ending index of a snippet.

string

The entity name.

boolean

Indicates if this rule was used to anonymize a text snippet.

number

The certainty score that the entity matches this specific snippet.

number

The starting index of a snippet.

string

The text snippet that matched.

Interface RedactReport

RedactReport

required parameters

number

Interface TextGuardArtifact

TextGuardArtifact

required parameters

boolean
number
number
string
string

optional parameters

string

The verdict, given by the Pangea service, for the indicator.

Interface TextGuardFindings

TextGuardFindings

required parameters

number
number

Interface TextGuardReport

TextGuardReport

required parameters

RedactReport

optional parameters

IntelResults
IntelResults
IntelResults
BreachedData

Interface TextGuardRequest

TextGuardRequest

required parameters

string

optional parameters

boolean
[object Object] | pangea_prompt_guard

Interface TextGuardResult

TextGuardResult

required parameters

TextGuardFindings
string

optional parameters

Interface TextGuardSecurityIssues

TextGuardSecurityIssues

required parameters

number
number
number
number
number