Skip to main content

AI Guard | Node.js SDK

Data Guard

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

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

required parameters

string

Pangea API token.

Configuration.

Response Object

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

File guard (Beta)

guardFile(request: FileGuardRequest): Promise<PangeaResponse<{}>>

Undocumented.

required parameters

FileGuardRequest

Request parameters.

Response Object

Promise<PangeaResponse<{}>>
const response = await dataGuard.guardFile({
  file_url: "https://example.org/file.txt",
});

Text guard (Beta)

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

Undocumented.

required parameters

TextGuardRequest

Request parameters.

Response Object

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

Interface FileGuardRequest

FileGuardRequest

required parameters

string

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