@crowdstrike/aidr 1.0.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/CODEOWNERS +1 -1
- package/.github/workflows/ci.yml +0 -43
- package/.github/workflows/publish.yml +52 -0
- package/README.md +91 -0
- package/dist/index.cjs +9 -0
- package/dist/index.d.cts +122 -103
- package/dist/index.d.mts +122 -103
- package/dist/index.mjs +9 -0
- package/dist/schemas/ai-guard.cjs +35 -68
- package/dist/schemas/ai-guard.d.cts +75 -42
- package/dist/schemas/ai-guard.d.mts +75 -42
- package/dist/schemas/ai-guard.mjs +33 -63
- package/flake.lock +5 -5
- package/package.json +2 -2
- package/specs/ai-guard.openapi.json +302 -213
- package/src/schemas/ai-guard.ts +121 -142
- package/src/services/ai-guard.ts +18 -2
- package/src/types/ai-guard.ts +125 -121
- package/tests/ai-guard.test.ts +26 -1
package/.github/CODEOWNERS
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
* @
|
|
1
|
+
* @crowdstrike/aidr-typescript-CS-Maintainers
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -83,46 +83,3 @@ jobs:
|
|
|
83
83
|
|
|
84
84
|
- name: Test
|
|
85
85
|
run: ./scripts/test
|
|
86
|
-
|
|
87
|
-
release:
|
|
88
|
-
needs:
|
|
89
|
-
- build
|
|
90
|
-
- lint
|
|
91
|
-
- test
|
|
92
|
-
if: github.repository == 'crowdstrike/aidr-typescript' && github.event_name != 'pull_request'
|
|
93
|
-
runs-on: ubuntu-24.04
|
|
94
|
-
environment: release
|
|
95
|
-
permissions:
|
|
96
|
-
contents: write
|
|
97
|
-
id-token: write
|
|
98
|
-
issues: write
|
|
99
|
-
packages: write
|
|
100
|
-
pull-requests: write
|
|
101
|
-
steps:
|
|
102
|
-
- name: Checkout code
|
|
103
|
-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
104
|
-
with:
|
|
105
|
-
fetch-depth: 0
|
|
106
|
-
filter: blob:none
|
|
107
|
-
show-progress: false
|
|
108
|
-
|
|
109
|
-
- run: corepack enable
|
|
110
|
-
|
|
111
|
-
- name: Setup Node.js
|
|
112
|
-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
|
113
|
-
with:
|
|
114
|
-
node-version: 24.11.1
|
|
115
|
-
cache: pnpm
|
|
116
|
-
|
|
117
|
-
- name: Install dependencies
|
|
118
|
-
run: pnpm install
|
|
119
|
-
|
|
120
|
-
- name: Build
|
|
121
|
-
run: pnpm build
|
|
122
|
-
|
|
123
|
-
- name: semantic-release
|
|
124
|
-
run: pnpx semantic-release
|
|
125
|
-
env:
|
|
126
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
127
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
128
|
-
LOG_LEVEL: debug
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
release:
|
|
17
|
+
if: github.repository == 'crowdstrike/aidr-typescript'
|
|
18
|
+
runs-on: ubuntu-24.04
|
|
19
|
+
environment: release
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
id-token: write
|
|
23
|
+
issues: write
|
|
24
|
+
packages: write
|
|
25
|
+
pull-requests: write
|
|
26
|
+
steps:
|
|
27
|
+
- name: Checkout code
|
|
28
|
+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0
|
|
31
|
+
filter: blob:none
|
|
32
|
+
show-progress: false
|
|
33
|
+
|
|
34
|
+
- run: corepack enable
|
|
35
|
+
|
|
36
|
+
- name: Setup Node.js
|
|
37
|
+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
|
|
38
|
+
with:
|
|
39
|
+
node-version: 24.11.1
|
|
40
|
+
cache: pnpm
|
|
41
|
+
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: pnpm install
|
|
44
|
+
|
|
45
|
+
- name: Build
|
|
46
|
+
run: pnpm build
|
|
47
|
+
|
|
48
|
+
- name: semantic-release
|
|
49
|
+
run: pnpx semantic-release
|
|
50
|
+
env:
|
|
51
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
52
|
+
LOG_LEVEL: debug
|
package/README.md
CHANGED
|
@@ -1,3 +1,94 @@
|
|
|
1
1
|
# CrowdStrike AIDR TypeScript SDK
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for CrowdStrike AIDR.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @crowdstrike/aidr
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @crowdstrike/aidr
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @crowdstrike/aidr
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { AIGuard } from "@crowdstrike/aidr";
|
|
23
|
+
|
|
24
|
+
const client = new AIGuard({
|
|
25
|
+
token: "your-api-token",
|
|
26
|
+
baseURLTemplate: "https://api.crowdstrike.com/aidr/{SERVICE_NAME}",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const response = await client.guardChatCompletions({
|
|
30
|
+
guard_input: {
|
|
31
|
+
messages: [
|
|
32
|
+
{
|
|
33
|
+
role: "user",
|
|
34
|
+
content: "Hello, how can I help you?",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
console.log(response);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Retries
|
|
44
|
+
|
|
45
|
+
The SDK supports automatic retries for temporary failures (network errors or
|
|
46
|
+
HTTP/5XX server errors). It supports configuring retries at the client level or
|
|
47
|
+
per-request.
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// Set the default number of retries when creating the client.
|
|
51
|
+
const client = new AIGuard({
|
|
52
|
+
token: "your-api-token",
|
|
53
|
+
baseURLTemplate: "https://api.crowdstrike.com/aidr/{SERVICE_NAME}",
|
|
54
|
+
maxRetries: 3, // Default is 2.
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const response = await client.guardChatCompletions(
|
|
58
|
+
{
|
|
59
|
+
guard_input: {
|
|
60
|
+
messages: [{ role: "user", content: "Hello" }],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
// Override the default retry count for this specific request.
|
|
65
|
+
maxRetries: 5,
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Timeouts
|
|
71
|
+
|
|
72
|
+
Configure request timeouts to control how long the client waits for a response
|
|
73
|
+
before timing out.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
// Set the default timeout (in milliseconds) when creating the client.
|
|
77
|
+
const client = new AIGuard({
|
|
78
|
+
token: "your-api-token",
|
|
79
|
+
baseURLTemplate: "https://api.crowdstrike.com/{SERVICE_NAME}",
|
|
80
|
+
timeout: 30000, // 30 seconds (default is 60 seconds).
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const response = await client.guardChatCompletions(
|
|
84
|
+
{
|
|
85
|
+
guard_input: {
|
|
86
|
+
messages: [{ role: "user", content: "Hello" }],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
// Override the default timeout for a specific request.
|
|
91
|
+
timeout: 10000, // 10 seconds.
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
```
|
package/dist/index.cjs
CHANGED
|
@@ -350,6 +350,15 @@ var AIGuard = class extends Client {
|
|
|
350
350
|
...options
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Decrypt or unredact fpe redactions
|
|
355
|
+
*/
|
|
356
|
+
unredact(body, options) {
|
|
357
|
+
return this.post("/v1/unredact", {
|
|
358
|
+
body,
|
|
359
|
+
...options
|
|
360
|
+
});
|
|
361
|
+
}
|
|
353
362
|
};
|
|
354
363
|
|
|
355
364
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -105,11 +105,9 @@ type PangeaResponse = {
|
|
|
105
105
|
* Provides a concise and brief overview of the purpose or primary objective of the API endpoint. It serves as a high-level summary or description of the functionality or feature offered by the endpoint.
|
|
106
106
|
*/
|
|
107
107
|
summary?: string;
|
|
108
|
-
result?: {
|
|
109
|
-
[key: string]: unknown;
|
|
110
|
-
};
|
|
111
108
|
};
|
|
112
109
|
type PangeaValidationErrors = PangeaResponse;
|
|
110
|
+
type PangeaAcceptedResponse = PangeaResponse;
|
|
113
111
|
/**
|
|
114
112
|
* Device status. Allowed values are active, pending, disabled
|
|
115
113
|
*/
|
|
@@ -657,7 +655,7 @@ type ChatCompletionsGuard = {
|
|
|
657
655
|
/**
|
|
658
656
|
* (AIDR) Event Type.
|
|
659
657
|
*/
|
|
660
|
-
event_type?:
|
|
658
|
+
event_type?: string;
|
|
661
659
|
/**
|
|
662
660
|
* (AIDR) collector instance id.
|
|
663
661
|
*/
|
|
@@ -714,6 +712,10 @@ type ChatCompletionsGuard = {
|
|
|
714
712
|
tools: Array<string>;
|
|
715
713
|
}> | undefined;
|
|
716
714
|
};
|
|
715
|
+
/**
|
|
716
|
+
* FPE (Format Preserving Encryption) context from a previous guard request. When provided, the encrypted input will be unredacted before processing.
|
|
717
|
+
*/
|
|
718
|
+
input_fpe_context?: string;
|
|
717
719
|
};
|
|
718
720
|
type AidrPromptInjectionResult = {
|
|
719
721
|
/**
|
|
@@ -1521,10 +1523,6 @@ type AidrServiceConfigResult = AidrServiceConfig;
|
|
|
1521
1523
|
* A time in ISO-8601 format
|
|
1522
1524
|
*/
|
|
1523
1525
|
type AidrTimestamp = string;
|
|
1524
|
-
/**
|
|
1525
|
-
* A time in ISO-8601 format or null
|
|
1526
|
-
*/
|
|
1527
|
-
type AirdTimestampNullable = AuthnTimestamp | null;
|
|
1528
1526
|
/**
|
|
1529
1527
|
* Define field name and path mapping to extract from the log
|
|
1530
1528
|
*/
|
|
@@ -1761,9 +1759,28 @@ type AidrMetricResultDetectorItem = {
|
|
|
1761
1759
|
};
|
|
1762
1760
|
};
|
|
1763
1761
|
/**
|
|
1764
|
-
*
|
|
1762
|
+
* Configuration for an individual access rule used in an AI Guard recipe. Each rule defines its matching logic and the action to apply when the logic evaluates to true.
|
|
1765
1763
|
*/
|
|
1766
|
-
type
|
|
1764
|
+
type AccessRuleSettings = {
|
|
1765
|
+
/**
|
|
1766
|
+
* Unique identifier for this rule. Should be user-readable and consistent across recipe updates.
|
|
1767
|
+
*/
|
|
1768
|
+
rule_key: string;
|
|
1769
|
+
/**
|
|
1770
|
+
* Display label for the rule shown in user interfaces.
|
|
1771
|
+
*/
|
|
1772
|
+
name: string;
|
|
1773
|
+
/**
|
|
1774
|
+
* Action to apply if the rule matches. Use 'block' to stop further processing or 'report' to simply log the match.
|
|
1775
|
+
*/
|
|
1776
|
+
state: 'block' | 'report';
|
|
1777
|
+
/**
|
|
1778
|
+
* JSON Logic condition that determines whether this rule matches.
|
|
1779
|
+
*/
|
|
1780
|
+
logic: {
|
|
1781
|
+
[key: string]: unknown;
|
|
1782
|
+
};
|
|
1783
|
+
};
|
|
1767
1784
|
/**
|
|
1768
1785
|
* Details about the evaluation of a single rule, including whether it matched, the action to take, the rule name, and optional debugging information.
|
|
1769
1786
|
*/
|
|
@@ -1793,49 +1810,6 @@ type AccessRuleResult = {
|
|
|
1793
1810
|
[key: string]: unknown;
|
|
1794
1811
|
};
|
|
1795
1812
|
};
|
|
1796
|
-
/**
|
|
1797
|
-
* Defines an AI Guard recipe - a named configuration of detectors and redaction settings used to analyze and protect data flows in AI-powered applications.
|
|
1798
|
-
*
|
|
1799
|
-
* Recipes specify which detectors are active, how they behave, and may include reusable settings such as FPE tweaks.
|
|
1800
|
-
*
|
|
1801
|
-
* For details, see the [AI Guard Recipes](https://pangea.cloud/docs/ai-guard/recipes) documentation.
|
|
1802
|
-
*/
|
|
1803
|
-
type RecipeConfig = {
|
|
1804
|
-
/**
|
|
1805
|
-
* Human-readable name of the recipe
|
|
1806
|
-
*/
|
|
1807
|
-
name: string;
|
|
1808
|
-
/**
|
|
1809
|
-
* Detailed description of the recipe's purpose or use case
|
|
1810
|
-
*/
|
|
1811
|
-
description: string;
|
|
1812
|
-
/**
|
|
1813
|
-
* Optional version identifier for the recipe. Can be used to track changes.
|
|
1814
|
-
*/
|
|
1815
|
-
version?: string;
|
|
1816
|
-
/**
|
|
1817
|
-
* Settings for [AI Guard Detectors](https://pangea.cloud/docs/ai-guard/recipes#detectors), including which detectors to enable and how they behave
|
|
1818
|
-
*/
|
|
1819
|
-
detectors?: DetectorSettings;
|
|
1820
|
-
/**
|
|
1821
|
-
* Configuration for access rules used in an AI Guard recipe.
|
|
1822
|
-
*/
|
|
1823
|
-
access_rules?: Array<AccessRuleSettings>;
|
|
1824
|
-
/**
|
|
1825
|
-
* Connector-level Redact configuration. These settings allow you to define reusable redaction parameters, such as FPE tweak value.
|
|
1826
|
-
*/
|
|
1827
|
-
connector_settings?: {
|
|
1828
|
-
/**
|
|
1829
|
-
* Settings for Redact integration at the recipe level
|
|
1830
|
-
*/
|
|
1831
|
-
redact?: {
|
|
1832
|
-
/**
|
|
1833
|
-
* ID of a Vault secret containing the tweak value used for Format-Preserving Encryption (FPE). Enables deterministic encryption, ensuring that identical inputs produce consistent encrypted outputs.
|
|
1834
|
-
*/
|
|
1835
|
-
fpe_tweak_vault_secret_id?: string;
|
|
1836
|
-
};
|
|
1837
|
-
};
|
|
1838
|
-
};
|
|
1839
1813
|
/**
|
|
1840
1814
|
* Configuration for individual detectors used in an AI Guard recipe. Each entry specifies the detector to use, its enabled state, detector-specific settings, and the [action](https://pangea.cloud/docs/ai-guard/recipes#actions) to apply when detections occur.
|
|
1841
1815
|
*/
|
|
@@ -1880,6 +1854,49 @@ type DetectorSettings = Array<{
|
|
|
1880
1854
|
}>;
|
|
1881
1855
|
};
|
|
1882
1856
|
}>;
|
|
1857
|
+
/**
|
|
1858
|
+
* Defines an AI Guard recipe - a named configuration of detectors and redaction settings used to analyze and protect data flows in AI-powered applications.
|
|
1859
|
+
*
|
|
1860
|
+
* Recipes specify which detectors are active, how they behave, and may include reusable settings such as FPE tweaks.
|
|
1861
|
+
*
|
|
1862
|
+
* For details, see the [AI Guard Recipes](https://pangea.cloud/docs/ai-guard/recipes) documentation.
|
|
1863
|
+
*/
|
|
1864
|
+
type RecipeConfig = {
|
|
1865
|
+
/**
|
|
1866
|
+
* Human-readable name of the recipe
|
|
1867
|
+
*/
|
|
1868
|
+
name: string;
|
|
1869
|
+
/**
|
|
1870
|
+
* Detailed description of the recipe's purpose or use case
|
|
1871
|
+
*/
|
|
1872
|
+
description: string;
|
|
1873
|
+
/**
|
|
1874
|
+
* Optional version identifier for the recipe. Can be used to track changes.
|
|
1875
|
+
*/
|
|
1876
|
+
version?: string;
|
|
1877
|
+
/**
|
|
1878
|
+
* Settings for [AI Guard Detectors](https://pangea.cloud/docs/ai-guard/recipes#detectors), including which detectors to enable and how they behave
|
|
1879
|
+
*/
|
|
1880
|
+
detectors?: DetectorSettings;
|
|
1881
|
+
/**
|
|
1882
|
+
* Configuration for access rules used in an AI Guard recipe.
|
|
1883
|
+
*/
|
|
1884
|
+
access_rules?: Array<AccessRuleSettings>;
|
|
1885
|
+
/**
|
|
1886
|
+
* Connector-level Redact configuration. These settings allow you to define reusable redaction parameters, such as FPE tweak value.
|
|
1887
|
+
*/
|
|
1888
|
+
connector_settings?: {
|
|
1889
|
+
/**
|
|
1890
|
+
* Settings for Redact integration at the recipe level
|
|
1891
|
+
*/
|
|
1892
|
+
redact?: {
|
|
1893
|
+
/**
|
|
1894
|
+
* ID of a Vault secret containing the tweak value used for Format-Preserving Encryption (FPE). Enables deterministic encryption, ensuring that identical inputs produce consistent encrypted outputs.
|
|
1895
|
+
*/
|
|
1896
|
+
fpe_tweak_vault_secret_id?: string;
|
|
1897
|
+
};
|
|
1898
|
+
};
|
|
1899
|
+
};
|
|
1883
1900
|
type RuleRedactionConfig = ({
|
|
1884
1901
|
redaction_type?: 'mask' | 'detect_only';
|
|
1885
1902
|
} | {
|
|
@@ -1946,53 +1963,6 @@ type RuleRedactionConfig = ({
|
|
|
1946
1963
|
*/
|
|
1947
1964
|
fpe_alphabet?: 'numeric' | 'alphalower' | 'alphaupper' | 'alpha' | 'alphanumericlower' | 'alphanumericupper' | 'alphanumeric' | null;
|
|
1948
1965
|
};
|
|
1949
|
-
/**
|
|
1950
|
-
* Configuration for an individual access rule used in an AI Guard recipe. Each rule defines its matching logic and the action to apply when the logic evaluates to true.
|
|
1951
|
-
*/
|
|
1952
|
-
type AccessRuleSettings = {
|
|
1953
|
-
/**
|
|
1954
|
-
* Unique identifier for this rule. Should be user-readable and consistent across recipe updates.
|
|
1955
|
-
*/
|
|
1956
|
-
rule_key: string;
|
|
1957
|
-
/**
|
|
1958
|
-
* Display label for the rule shown in user interfaces.
|
|
1959
|
-
*/
|
|
1960
|
-
name: string;
|
|
1961
|
-
/**
|
|
1962
|
-
* Action to apply if the rule matches. Use 'block' to stop further processing or 'report' to simply log the match.
|
|
1963
|
-
*/
|
|
1964
|
-
state: 'block' | 'report';
|
|
1965
|
-
/**
|
|
1966
|
-
* JSON Logic condition that determines whether this rule matches.
|
|
1967
|
-
*/
|
|
1968
|
-
logic: {
|
|
1969
|
-
[key: string]: unknown;
|
|
1970
|
-
};
|
|
1971
|
-
};
|
|
1972
|
-
type LanguageResult = {
|
|
1973
|
-
/**
|
|
1974
|
-
* The action taken by this Detector
|
|
1975
|
-
*/
|
|
1976
|
-
action?: string;
|
|
1977
|
-
language?: string;
|
|
1978
|
-
};
|
|
1979
|
-
type RedactEntityResult = {
|
|
1980
|
-
/**
|
|
1981
|
-
* Detected redaction rules.
|
|
1982
|
-
*/
|
|
1983
|
-
entities?: Array<{
|
|
1984
|
-
/**
|
|
1985
|
-
* The action taken on this Entity
|
|
1986
|
-
*/
|
|
1987
|
-
action: string;
|
|
1988
|
-
type: string;
|
|
1989
|
-
value: string;
|
|
1990
|
-
redacted: boolean;
|
|
1991
|
-
start_pos?: number;
|
|
1992
|
-
}>;
|
|
1993
|
-
};
|
|
1994
|
-
type MaliciousEntityAction = 'report' | 'defang' | 'disabled' | 'block';
|
|
1995
|
-
type PiiEntityAction = 'disabled' | 'report' | 'block' | 'mask' | 'partial_masking' | 'replacement' | 'hash' | 'fpe';
|
|
1996
1966
|
type AidrPostV1GuardChatCompletionsData = {
|
|
1997
1967
|
body?: ChatCompletionsGuard;
|
|
1998
1968
|
path?: never;
|
|
@@ -2132,8 +2102,52 @@ type AidrPostV1GuardChatCompletionsResponses = {
|
|
|
2132
2102
|
fpe_context?: string;
|
|
2133
2103
|
};
|
|
2134
2104
|
};
|
|
2105
|
+
/**
|
|
2106
|
+
* Asynchronous request in progress
|
|
2107
|
+
*/
|
|
2108
|
+
202: PangeaResponse & PangeaAcceptedResponse;
|
|
2135
2109
|
};
|
|
2136
2110
|
type AidrPostV1GuardChatCompletionsResponse = AidrPostV1GuardChatCompletionsResponses[keyof AidrPostV1GuardChatCompletionsResponses];
|
|
2111
|
+
type AidrPostV1UnredactData = {
|
|
2112
|
+
body?: {
|
|
2113
|
+
/**
|
|
2114
|
+
* Data to unredact
|
|
2115
|
+
*/
|
|
2116
|
+
redacted_data: unknown;
|
|
2117
|
+
/**
|
|
2118
|
+
* FPE context used to decrypt and unredact data
|
|
2119
|
+
*/
|
|
2120
|
+
fpe_context: string;
|
|
2121
|
+
};
|
|
2122
|
+
path?: never;
|
|
2123
|
+
query?: never;
|
|
2124
|
+
url: '/v1/unredact';
|
|
2125
|
+
};
|
|
2126
|
+
type AidrPostV1UnredactErrors = {
|
|
2127
|
+
/**
|
|
2128
|
+
* Validation errors
|
|
2129
|
+
*/
|
|
2130
|
+
400: PangeaResponse & PangeaValidationErrors;
|
|
2131
|
+
};
|
|
2132
|
+
type AidrPostV1UnredactError = AidrPostV1UnredactErrors[keyof AidrPostV1UnredactErrors];
|
|
2133
|
+
type AidrPostV1UnredactResponses = {
|
|
2134
|
+
/**
|
|
2135
|
+
* The unredacted data
|
|
2136
|
+
*/
|
|
2137
|
+
200: PangeaResponse & {
|
|
2138
|
+
result?: {
|
|
2139
|
+
/**
|
|
2140
|
+
* The unredacted data
|
|
2141
|
+
*/
|
|
2142
|
+
data: unknown;
|
|
2143
|
+
};
|
|
2144
|
+
};
|
|
2145
|
+
/**
|
|
2146
|
+
* Asynchronous request in progress
|
|
2147
|
+
*/
|
|
2148
|
+
202: PangeaResponse & PangeaAcceptedResponse;
|
|
2149
|
+
};
|
|
2150
|
+
type AidrPostV1UnredactResponse = AidrPostV1UnredactResponses[keyof AidrPostV1UnredactResponses];
|
|
2137
2151
|
type GetAsyncRequestData = {
|
|
2138
2152
|
body?: never;
|
|
2139
2153
|
path: {
|
|
@@ -2154,11 +2168,12 @@ type GetAsyncRequestResponses = {
|
|
|
2154
2168
|
* Asynchronous request in progress
|
|
2155
2169
|
*/
|
|
2156
2170
|
202: PangeaResponse & {
|
|
2157
|
-
result
|
|
2171
|
+
result: {
|
|
2158
2172
|
ttl_mins?: number;
|
|
2159
2173
|
retry_counter?: number;
|
|
2160
2174
|
location?: string;
|
|
2161
2175
|
};
|
|
2176
|
+
status: 'Accepted';
|
|
2162
2177
|
};
|
|
2163
2178
|
};
|
|
2164
2179
|
type GetAsyncRequestResponse = GetAsyncRequestResponses[keyof GetAsyncRequestResponses];
|
|
@@ -2341,7 +2356,11 @@ declare class AIGuard extends Client {
|
|
|
2341
2356
|
* Analyze and redact content to avoid manipulation of the model, addition of
|
|
2342
2357
|
* malicious content, and other undesirable data transfers.
|
|
2343
2358
|
*/
|
|
2344
|
-
guardChatCompletions(body: ChatCompletionsGuard, options?: RequestOptions): Promise<MaybeAcceptedResponse<
|
|
2359
|
+
guardChatCompletions(body: ChatCompletionsGuard, options?: RequestOptions): Promise<MaybeAcceptedResponse<AidrPostV1GuardChatCompletionsResponses[200]['result']>>;
|
|
2360
|
+
/**
|
|
2361
|
+
* Decrypt or unredact fpe redactions
|
|
2362
|
+
*/
|
|
2363
|
+
unredact(body: AidrPostV1UnredactData['body'], options?: RequestOptions): Promise<MaybeAcceptedResponse<AidrPostV1UnredactResponses[200]['result']>>;
|
|
2345
2364
|
}
|
|
2346
2365
|
//#endregion
|
|
2347
|
-
export { AIGuard, APIResponse, AcceptedResponse, AccessRuleResult, AccessRuleSettings, AidrAccessRulesResponse, AidrAuditDataActivity, AidrCustomlist, AidrCustomlistResult, AidrCustomlistSearch, AidrCustomlistSearchResult, AidrDevice, AidrDeviceCheckResult, AidrDeviceId, AidrDeviceResult, AidrDeviceSearch, AidrDeviceSearchResult, AidrDeviceStatus, AidrDeviceTokenInfo, AidrEmpty, AidrFieldAlias, AidrFieldAliasResult, AidrFieldAliasSearch, AidrFieldAliasSearchResult, AidrGolangDuration, AidrIpv4OrV6, AidrLanguageResult, AidrLog, AidrLogs, AidrMaliciousEntityResult, AidrMetric, AidrMetricAggregateItem, AidrMetricAggregatesResult, AidrMetricAggregatesSearchParams, AidrMetricItem, AidrMetricOnlyData, AidrMetricResult, AidrMetricResultDetectorItem, AidrMetricpoolId, AidrMetricpoolResource, AidrOtelAnyValue, AidrOtelArrayValue, AidrOtelInstrumentationScope, AidrOtelKeyValue, AidrOtelKeyValueList, AidrOtelLogRecord, AidrOtelResource, AidrOtelResourceLogs, AidrOtelScopeLogs, AidrPolicy, AidrPolicyDefaults, AidrPolicyResult, AidrPolicySearch, AidrPolicySearchResult, AidrPolicycollectionResult, AidrPolicycollectionSearch, AidrPolicycollectionSearchResult, AidrPostV1GuardChatCompletionsData, AidrPostV1GuardChatCompletionsError, AidrPostV1GuardChatCompletionsErrors, AidrPostV1GuardChatCompletionsResponse, AidrPostV1GuardChatCompletionsResponses, AidrPromptInjectionResult, AidrPromptItem, AidrPromptItemListResult, AidrRedactEntityResult, AidrResourceFieldMapping, AidrSavedFilter, AidrSavedFilterResult, AidrSavedFilterSearch, AidrSavedFilterSearchResult, AidrSensorHealth, AidrSensorInsights, AidrSensorInsightsItem, AidrSensorInsightsResult, AidrServiceConfig, AidrServiceConfigList, AidrServiceConfigResult, AidrSingleEntityResult, AidrTimestamp, AidrTopicResult,
|
|
2366
|
+
export { AIGuard, APIResponse, AcceptedResponse, AccessRuleResult, AccessRuleSettings, AidrAccessRulesResponse, AidrAuditDataActivity, AidrCustomlist, AidrCustomlistResult, AidrCustomlistSearch, AidrCustomlistSearchResult, AidrDevice, AidrDeviceCheckResult, AidrDeviceId, AidrDeviceResult, AidrDeviceSearch, AidrDeviceSearchResult, AidrDeviceStatus, AidrDeviceTokenInfo, AidrEmpty, AidrFieldAlias, AidrFieldAliasResult, AidrFieldAliasSearch, AidrFieldAliasSearchResult, AidrGolangDuration, AidrIpv4OrV6, AidrLanguageResult, AidrLog, AidrLogs, AidrMaliciousEntityResult, AidrMetric, AidrMetricAggregateItem, AidrMetricAggregatesResult, AidrMetricAggregatesSearchParams, AidrMetricItem, AidrMetricOnlyData, AidrMetricResult, AidrMetricResultDetectorItem, AidrMetricpoolId, AidrMetricpoolResource, AidrOtelAnyValue, AidrOtelArrayValue, AidrOtelInstrumentationScope, AidrOtelKeyValue, AidrOtelKeyValueList, AidrOtelLogRecord, AidrOtelResource, AidrOtelResourceLogs, AidrOtelScopeLogs, AidrPolicy, AidrPolicyDefaults, AidrPolicyResult, AidrPolicySearch, AidrPolicySearchResult, AidrPolicycollectionResult, AidrPolicycollectionSearch, AidrPolicycollectionSearchResult, AidrPostV1GuardChatCompletionsData, AidrPostV1GuardChatCompletionsError, AidrPostV1GuardChatCompletionsErrors, AidrPostV1GuardChatCompletionsResponse, AidrPostV1GuardChatCompletionsResponses, AidrPostV1UnredactData, AidrPostV1UnredactError, AidrPostV1UnredactErrors, AidrPostV1UnredactResponse, AidrPostV1UnredactResponses, AidrPromptInjectionResult, AidrPromptItem, AidrPromptItemListResult, AidrRedactEntityResult, AidrResourceFieldMapping, AidrSavedFilter, AidrSavedFilterResult, AidrSavedFilterSearch, AidrSavedFilterSearchResult, AidrSensorHealth, AidrSensorInsights, AidrSensorInsightsItem, AidrSensorInsightsResult, AidrServiceConfig, AidrServiceConfigList, AidrServiceConfigResult, AidrSingleEntityResult, AidrTimestamp, AidrTopicResult, ChatCompletionsGuard, DetectorSettings, ErrorResponse, FilterId, GetAsyncRequestData, GetAsyncRequestResponse, GetAsyncRequestResponses, MaybeAcceptedResponse, PangeaAcceptedResponse, PangeaResponse, PangeaValidationErrors, PolicyId, RecipeConfig, RuleRedactionConfig, ServiceConfigId };
|