@crowdstrike/aidr 1.0.2 → 1.1.0
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 +121 -99
- package/dist/index.d.mts +121 -99
- 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/package.json +1 -1
- package/specs/ai-guard.openapi.json +302 -210
- package/src/schemas/ai-guard.ts +121 -142
- package/src/services/ai-guard.ts +12 -0
- package/src/types/ai-guard.ts +125 -118
- package/tests/ai-guard.test.ts +26 -1
package/dist/index.d.mts
CHANGED
|
@@ -110,6 +110,7 @@ type PangeaResponse = {
|
|
|
110
110
|
};
|
|
111
111
|
};
|
|
112
112
|
type PangeaValidationErrors = PangeaResponse;
|
|
113
|
+
type PangeaAcceptedResponse = PangeaResponse;
|
|
113
114
|
/**
|
|
114
115
|
* Device status. Allowed values are active, pending, disabled
|
|
115
116
|
*/
|
|
@@ -657,7 +658,7 @@ type ChatCompletionsGuard = {
|
|
|
657
658
|
/**
|
|
658
659
|
* (AIDR) Event Type.
|
|
659
660
|
*/
|
|
660
|
-
event_type?:
|
|
661
|
+
event_type?: string;
|
|
661
662
|
/**
|
|
662
663
|
* (AIDR) collector instance id.
|
|
663
664
|
*/
|
|
@@ -714,6 +715,10 @@ type ChatCompletionsGuard = {
|
|
|
714
715
|
tools: Array<string>;
|
|
715
716
|
}> | undefined;
|
|
716
717
|
};
|
|
718
|
+
/**
|
|
719
|
+
* FPE (Format Preserving Encryption) context from a previous guard request. When provided, the encrypted input will be unredacted before processing.
|
|
720
|
+
*/
|
|
721
|
+
input_fpe_context?: string;
|
|
717
722
|
};
|
|
718
723
|
type AidrPromptInjectionResult = {
|
|
719
724
|
/**
|
|
@@ -1521,10 +1526,6 @@ type AidrServiceConfigResult = AidrServiceConfig;
|
|
|
1521
1526
|
* A time in ISO-8601 format
|
|
1522
1527
|
*/
|
|
1523
1528
|
type AidrTimestamp = string;
|
|
1524
|
-
/**
|
|
1525
|
-
* A time in ISO-8601 format or null
|
|
1526
|
-
*/
|
|
1527
|
-
type AirdTimestampNullable = AuthnTimestamp | null;
|
|
1528
1529
|
/**
|
|
1529
1530
|
* Define field name and path mapping to extract from the log
|
|
1530
1531
|
*/
|
|
@@ -1761,9 +1762,28 @@ type AidrMetricResultDetectorItem = {
|
|
|
1761
1762
|
};
|
|
1762
1763
|
};
|
|
1763
1764
|
/**
|
|
1764
|
-
*
|
|
1765
|
+
* 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
1766
|
*/
|
|
1766
|
-
type
|
|
1767
|
+
type AccessRuleSettings = {
|
|
1768
|
+
/**
|
|
1769
|
+
* Unique identifier for this rule. Should be user-readable and consistent across recipe updates.
|
|
1770
|
+
*/
|
|
1771
|
+
rule_key: string;
|
|
1772
|
+
/**
|
|
1773
|
+
* Display label for the rule shown in user interfaces.
|
|
1774
|
+
*/
|
|
1775
|
+
name: string;
|
|
1776
|
+
/**
|
|
1777
|
+
* Action to apply if the rule matches. Use 'block' to stop further processing or 'report' to simply log the match.
|
|
1778
|
+
*/
|
|
1779
|
+
state: 'block' | 'report';
|
|
1780
|
+
/**
|
|
1781
|
+
* JSON Logic condition that determines whether this rule matches.
|
|
1782
|
+
*/
|
|
1783
|
+
logic: {
|
|
1784
|
+
[key: string]: unknown;
|
|
1785
|
+
};
|
|
1786
|
+
};
|
|
1767
1787
|
/**
|
|
1768
1788
|
* Details about the evaluation of a single rule, including whether it matched, the action to take, the rule name, and optional debugging information.
|
|
1769
1789
|
*/
|
|
@@ -1793,49 +1813,6 @@ type AccessRuleResult = {
|
|
|
1793
1813
|
[key: string]: unknown;
|
|
1794
1814
|
};
|
|
1795
1815
|
};
|
|
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
1816
|
/**
|
|
1840
1817
|
* 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
1818
|
*/
|
|
@@ -1880,6 +1857,49 @@ type DetectorSettings = Array<{
|
|
|
1880
1857
|
}>;
|
|
1881
1858
|
};
|
|
1882
1859
|
}>;
|
|
1860
|
+
/**
|
|
1861
|
+
* Defines an AI Guard recipe - a named configuration of detectors and redaction settings used to analyze and protect data flows in AI-powered applications.
|
|
1862
|
+
*
|
|
1863
|
+
* Recipes specify which detectors are active, how they behave, and may include reusable settings such as FPE tweaks.
|
|
1864
|
+
*
|
|
1865
|
+
* For details, see the [AI Guard Recipes](https://pangea.cloud/docs/ai-guard/recipes) documentation.
|
|
1866
|
+
*/
|
|
1867
|
+
type RecipeConfig = {
|
|
1868
|
+
/**
|
|
1869
|
+
* Human-readable name of the recipe
|
|
1870
|
+
*/
|
|
1871
|
+
name: string;
|
|
1872
|
+
/**
|
|
1873
|
+
* Detailed description of the recipe's purpose or use case
|
|
1874
|
+
*/
|
|
1875
|
+
description: string;
|
|
1876
|
+
/**
|
|
1877
|
+
* Optional version identifier for the recipe. Can be used to track changes.
|
|
1878
|
+
*/
|
|
1879
|
+
version?: string;
|
|
1880
|
+
/**
|
|
1881
|
+
* Settings for [AI Guard Detectors](https://pangea.cloud/docs/ai-guard/recipes#detectors), including which detectors to enable and how they behave
|
|
1882
|
+
*/
|
|
1883
|
+
detectors?: DetectorSettings;
|
|
1884
|
+
/**
|
|
1885
|
+
* Configuration for access rules used in an AI Guard recipe.
|
|
1886
|
+
*/
|
|
1887
|
+
access_rules?: Array<AccessRuleSettings>;
|
|
1888
|
+
/**
|
|
1889
|
+
* Connector-level Redact configuration. These settings allow you to define reusable redaction parameters, such as FPE tweak value.
|
|
1890
|
+
*/
|
|
1891
|
+
connector_settings?: {
|
|
1892
|
+
/**
|
|
1893
|
+
* Settings for Redact integration at the recipe level
|
|
1894
|
+
*/
|
|
1895
|
+
redact?: {
|
|
1896
|
+
/**
|
|
1897
|
+
* 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.
|
|
1898
|
+
*/
|
|
1899
|
+
fpe_tweak_vault_secret_id?: string;
|
|
1900
|
+
};
|
|
1901
|
+
};
|
|
1902
|
+
};
|
|
1883
1903
|
type RuleRedactionConfig = ({
|
|
1884
1904
|
redaction_type?: 'mask' | 'detect_only';
|
|
1885
1905
|
} | {
|
|
@@ -1946,53 +1966,6 @@ type RuleRedactionConfig = ({
|
|
|
1946
1966
|
*/
|
|
1947
1967
|
fpe_alphabet?: 'numeric' | 'alphalower' | 'alphaupper' | 'alpha' | 'alphanumericlower' | 'alphanumericupper' | 'alphanumeric' | null;
|
|
1948
1968
|
};
|
|
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
1969
|
type AidrPostV1GuardChatCompletionsData = {
|
|
1997
1970
|
body?: ChatCompletionsGuard;
|
|
1998
1971
|
path?: never;
|
|
@@ -2132,8 +2105,52 @@ type AidrPostV1GuardChatCompletionsResponses = {
|
|
|
2132
2105
|
fpe_context?: string;
|
|
2133
2106
|
};
|
|
2134
2107
|
};
|
|
2108
|
+
/**
|
|
2109
|
+
* Asynchronous request in progress
|
|
2110
|
+
*/
|
|
2111
|
+
202: PangeaResponse & PangeaAcceptedResponse;
|
|
2135
2112
|
};
|
|
2136
2113
|
type AidrPostV1GuardChatCompletionsResponse = AidrPostV1GuardChatCompletionsResponses[keyof AidrPostV1GuardChatCompletionsResponses];
|
|
2114
|
+
type AidrPostV1UnredactData = {
|
|
2115
|
+
body?: {
|
|
2116
|
+
/**
|
|
2117
|
+
* Data to unredact
|
|
2118
|
+
*/
|
|
2119
|
+
redacted_data: unknown;
|
|
2120
|
+
/**
|
|
2121
|
+
* FPE context used to decrypt and unredact data
|
|
2122
|
+
*/
|
|
2123
|
+
fpe_context: string;
|
|
2124
|
+
};
|
|
2125
|
+
path?: never;
|
|
2126
|
+
query?: never;
|
|
2127
|
+
url: '/v1/unredact';
|
|
2128
|
+
};
|
|
2129
|
+
type AidrPostV1UnredactErrors = {
|
|
2130
|
+
/**
|
|
2131
|
+
* Validation errors
|
|
2132
|
+
*/
|
|
2133
|
+
400: PangeaResponse & PangeaValidationErrors;
|
|
2134
|
+
};
|
|
2135
|
+
type AidrPostV1UnredactError = AidrPostV1UnredactErrors[keyof AidrPostV1UnredactErrors];
|
|
2136
|
+
type AidrPostV1UnredactResponses = {
|
|
2137
|
+
/**
|
|
2138
|
+
* The unredacted data
|
|
2139
|
+
*/
|
|
2140
|
+
200: PangeaResponse & {
|
|
2141
|
+
result?: {
|
|
2142
|
+
/**
|
|
2143
|
+
* The unredacted data
|
|
2144
|
+
*/
|
|
2145
|
+
data: unknown;
|
|
2146
|
+
};
|
|
2147
|
+
};
|
|
2148
|
+
/**
|
|
2149
|
+
* Asynchronous request in progress
|
|
2150
|
+
*/
|
|
2151
|
+
202: PangeaResponse & PangeaAcceptedResponse;
|
|
2152
|
+
};
|
|
2153
|
+
type AidrPostV1UnredactResponse = AidrPostV1UnredactResponses[keyof AidrPostV1UnredactResponses];
|
|
2137
2154
|
type GetAsyncRequestData = {
|
|
2138
2155
|
body?: never;
|
|
2139
2156
|
path: {
|
|
@@ -2154,11 +2171,12 @@ type GetAsyncRequestResponses = {
|
|
|
2154
2171
|
* Asynchronous request in progress
|
|
2155
2172
|
*/
|
|
2156
2173
|
202: PangeaResponse & {
|
|
2157
|
-
result
|
|
2174
|
+
result: {
|
|
2158
2175
|
ttl_mins?: number;
|
|
2159
2176
|
retry_counter?: number;
|
|
2160
2177
|
location?: string;
|
|
2161
2178
|
};
|
|
2179
|
+
status: 'Accepted';
|
|
2162
2180
|
};
|
|
2163
2181
|
};
|
|
2164
2182
|
type GetAsyncRequestResponse = GetAsyncRequestResponses[keyof GetAsyncRequestResponses];
|
|
@@ -2342,6 +2360,10 @@ declare class AIGuard extends Client {
|
|
|
2342
2360
|
* malicious content, and other undesirable data transfers.
|
|
2343
2361
|
*/
|
|
2344
2362
|
guardChatCompletions(body: ChatCompletionsGuard, options?: RequestOptions): Promise<MaybeAcceptedResponse<AidrPostV1GuardChatCompletionsResponse['result']>>;
|
|
2363
|
+
/**
|
|
2364
|
+
* Decrypt or unredact fpe redactions
|
|
2365
|
+
*/
|
|
2366
|
+
unredact(body: AidrPostV1UnredactData['body'], options?: RequestOptions): Promise<MaybeAcceptedResponse<AidrPostV1UnredactResponse['result']>>;
|
|
2345
2367
|
}
|
|
2346
2368
|
//#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,
|
|
2369
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -348,6 +348,15 @@ var AIGuard = class extends Client {
|
|
|
348
348
|
...options
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Decrypt or unredact fpe redactions
|
|
353
|
+
*/
|
|
354
|
+
unredact(body, options) {
|
|
355
|
+
return this.post("/v1/unredact", {
|
|
356
|
+
body,
|
|
357
|
+
...options
|
|
358
|
+
});
|
|
359
|
+
}
|
|
351
360
|
};
|
|
352
361
|
|
|
353
362
|
//#endregion
|
|
@@ -17,6 +17,7 @@ const PangeaResponseSchema = valibot.object({
|
|
|
17
17
|
result: valibot.optional(valibot.record(valibot.string(), valibot.unknown()))
|
|
18
18
|
});
|
|
19
19
|
const PangeaValidationErrorsSchema = PangeaResponseSchema;
|
|
20
|
+
const PangeaAcceptedResponseSchema = PangeaResponseSchema;
|
|
20
21
|
/**
|
|
21
22
|
* Device status. Allowed values are active, pending, disabled
|
|
22
23
|
*/
|
|
@@ -207,13 +208,7 @@ const ChatCompletionsGuardSchema = valibot.strictObject({
|
|
|
207
208
|
source_ip: valibot.optional(valibot.string()),
|
|
208
209
|
source_location: valibot.optional(valibot.string()),
|
|
209
210
|
tenant_id: valibot.optional(valibot.string()),
|
|
210
|
-
event_type: valibot.optional(valibot.
|
|
211
|
-
"input",
|
|
212
|
-
"output",
|
|
213
|
-
"tool_input",
|
|
214
|
-
"tool_output",
|
|
215
|
-
"tool_listing"
|
|
216
|
-
])),
|
|
211
|
+
event_type: valibot.optional(valibot.string(), "input"),
|
|
217
212
|
collector_instance_id: valibot.optional(valibot.string()),
|
|
218
213
|
extra_info: valibot.optional(valibot.objectWithRest({
|
|
219
214
|
app_name: valibot.optional(valibot.string()),
|
|
@@ -227,7 +222,8 @@ const ChatCompletionsGuardSchema = valibot.strictObject({
|
|
|
227
222
|
server_name: valibot.pipe(valibot.string(), valibot.minLength(1)),
|
|
228
223
|
tools: valibot.pipe(valibot.array(valibot.pipe(valibot.string(), valibot.minLength(1))), valibot.minLength(1))
|
|
229
224
|
})))
|
|
230
|
-
}, valibot.unknown()))
|
|
225
|
+
}, valibot.unknown())),
|
|
226
|
+
input_fpe_context: valibot.optional(valibot.string())
|
|
231
227
|
});
|
|
232
228
|
const AidrPromptInjectionResultSchema = valibot.object({
|
|
233
229
|
action: valibot.optional(valibot.string()),
|
|
@@ -593,7 +589,7 @@ const AidrMetricSchema = valibot.strictObject({
|
|
|
593
589
|
tag_filters: valibot.optional(valibot.strictObject({})),
|
|
594
590
|
detector_filters: valibot.optional(valibot.strictObject({})),
|
|
595
591
|
group_by: valibot.optional(valibot.array(valibot.pipe(valibot.string(), valibot.regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}$/)))),
|
|
596
|
-
order_by: valibot.optional(valibot.string()),
|
|
592
|
+
order_by: valibot.optional(valibot.pipe(valibot.string(), valibot.regex(/^[A-Za-z_][A-Za-z0-9_.]{0,63}$/))),
|
|
597
593
|
order: valibot.optional(valibot.picklist(["asc", "desc"])),
|
|
598
594
|
limit: valibot.optional(valibot.pipe(valibot.number(), valibot.integer())),
|
|
599
595
|
offset: valibot.optional(valibot.pipe(valibot.number(), valibot.integer()))
|
|
@@ -616,7 +612,7 @@ const AidrMetricAggregatesSearchParamsSchema = valibot.strictObject({
|
|
|
616
612
|
detector_filters: valibot.optional(valibot.strictObject({})),
|
|
617
613
|
tag_filters: valibot.optional(valibot.strictObject({})),
|
|
618
614
|
group_by: valibot.optional(valibot.array(valibot.pipe(valibot.string(), valibot.regex(/^[A-Za-z_][A-Za-z0-9_]{0,63}$/)))),
|
|
619
|
-
order_by: valibot.optional(valibot.string()),
|
|
615
|
+
order_by: valibot.optional(valibot.pipe(valibot.string(), valibot.regex(/^[A-Za-z_][A-Za-z0-9_.]{0,63}$/))),
|
|
620
616
|
order: valibot.optional(valibot.picklist(["asc", "desc"])),
|
|
621
617
|
limit: valibot.optional(valibot.pipe(valibot.number(), valibot.integer())),
|
|
622
618
|
offset: valibot.optional(valibot.pipe(valibot.number(), valibot.integer()))
|
|
@@ -645,13 +641,14 @@ const AidrMetricItemSchema = valibot.array(valibot.object({
|
|
|
645
641
|
*/
|
|
646
642
|
const AidrMetricResultSchema = valibot.object({ items: valibot.optional(valibot.array(AidrMetricItemSchema)) });
|
|
647
643
|
/**
|
|
648
|
-
*
|
|
649
|
-
*/
|
|
650
|
-
const AuthnTimestampSchema = valibot.pipe(valibot.string(), valibot.isoTimestamp());
|
|
651
|
-
/**
|
|
652
|
-
* A time in ISO-8601 format or null
|
|
644
|
+
* 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.
|
|
653
645
|
*/
|
|
654
|
-
const
|
|
646
|
+
const AccessRuleSettingsSchema = valibot.strictObject({
|
|
647
|
+
rule_key: valibot.pipe(valibot.string(), valibot.regex(/^([a-zA-Z0-9_][a-zA-Z0-9/|_]*)$/)),
|
|
648
|
+
name: valibot.string(),
|
|
649
|
+
state: valibot.picklist(["block", "report"]),
|
|
650
|
+
logic: valibot.record(valibot.string(), valibot.unknown())
|
|
651
|
+
});
|
|
655
652
|
/**
|
|
656
653
|
* Details about the evaluation of a single rule, including whether it matched, the action to take, the rule name, and optional debugging information.
|
|
657
654
|
*/
|
|
@@ -718,15 +715,6 @@ const DetectorSettingsSchema = valibot.array(valibot.strictObject({
|
|
|
718
715
|
transform_if_malicious: valibot.optional(valibot.boolean())
|
|
719
716
|
}))) })
|
|
720
717
|
}));
|
|
721
|
-
/**
|
|
722
|
-
* 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.
|
|
723
|
-
*/
|
|
724
|
-
const AccessRuleSettingsSchema = valibot.strictObject({
|
|
725
|
-
rule_key: valibot.pipe(valibot.string(), valibot.regex(/^([a-zA-Z0-9_][a-zA-Z0-9/|_]*)$/)),
|
|
726
|
-
name: valibot.string(),
|
|
727
|
-
state: valibot.picklist(["block", "report"]),
|
|
728
|
-
logic: valibot.record(valibot.string(), valibot.unknown())
|
|
729
|
-
});
|
|
730
718
|
const AidrPolicySchema = valibot.strictObject({
|
|
731
719
|
key: valibot.string(),
|
|
732
720
|
name: valibot.string(),
|
|
@@ -770,33 +758,6 @@ const RecipeConfigSchema = valibot.strictObject({
|
|
|
770
758
|
connector_settings: valibot.optional(valibot.object({ redact: valibot.optional(valibot.object({ fpe_tweak_vault_secret_id: valibot.optional(valibot.string()) })) }))
|
|
771
759
|
});
|
|
772
760
|
const AidrPolicyDefaultsSchema = valibot.object({ default_policies: valibot.record(valibot.string(), valibot.unknown()) });
|
|
773
|
-
const LanguageResultSchema = valibot.object({
|
|
774
|
-
action: valibot.optional(valibot.string()),
|
|
775
|
-
language: valibot.optional(valibot.string())
|
|
776
|
-
});
|
|
777
|
-
const RedactEntityResultSchema = valibot.object({ entities: valibot.optional(valibot.array(valibot.object({
|
|
778
|
-
action: valibot.string(),
|
|
779
|
-
type: valibot.string(),
|
|
780
|
-
value: valibot.string(),
|
|
781
|
-
redacted: valibot.boolean(),
|
|
782
|
-
start_pos: valibot.optional(valibot.pipe(valibot.number(), valibot.integer(), valibot.minValue(0)))
|
|
783
|
-
}))) });
|
|
784
|
-
const MaliciousEntityActionSchema = valibot.picklist([
|
|
785
|
-
"report",
|
|
786
|
-
"defang",
|
|
787
|
-
"disabled",
|
|
788
|
-
"block"
|
|
789
|
-
]);
|
|
790
|
-
const PiiEntityActionSchema = valibot.picklist([
|
|
791
|
-
"disabled",
|
|
792
|
-
"report",
|
|
793
|
-
"block",
|
|
794
|
-
"mask",
|
|
795
|
-
"partial_masking",
|
|
796
|
-
"replacement",
|
|
797
|
-
"hash",
|
|
798
|
-
"fpe"
|
|
799
|
-
]);
|
|
800
761
|
const AidrOtelResourceLogsSchema = valibot.objectWithRest({
|
|
801
762
|
resource: valibot.optional(valibot.lazy(() => AidrOtelResourceSchema)),
|
|
802
763
|
scopeLogs: valibot.array(valibot.lazy(() => AidrOtelScopeLogsSchema))
|
|
@@ -845,10 +806,7 @@ const AidrPostV1GuardChatCompletionsRequestSchema = valibot.object({
|
|
|
845
806
|
path: valibot.optional(valibot.never()),
|
|
846
807
|
query: valibot.optional(valibot.never())
|
|
847
808
|
});
|
|
848
|
-
|
|
849
|
-
* No description provided
|
|
850
|
-
*/
|
|
851
|
-
const AidrPostV1GuardChatCompletionsResponseSchema = valibot.intersect([PangeaResponseSchema, valibot.object({ result: valibot.optional(valibot.object({
|
|
809
|
+
const AidrPostV1GuardChatCompletionsResponseSchema = valibot.union([valibot.intersect([PangeaResponseSchema, valibot.object({ result: valibot.optional(valibot.object({
|
|
852
810
|
guard_output: valibot.optional(valibot.record(valibot.string(), valibot.unknown())),
|
|
853
811
|
blocked: valibot.optional(valibot.boolean()),
|
|
854
812
|
transformed: valibot.optional(valibot.boolean()),
|
|
@@ -893,17 +851,29 @@ const AidrPostV1GuardChatCompletionsResponseSchema = valibot.intersect([PangeaRe
|
|
|
893
851
|
}),
|
|
894
852
|
access_rules: valibot.optional(AidrAccessRulesResponseSchema),
|
|
895
853
|
fpe_context: valibot.optional(valibot.string())
|
|
896
|
-
})) })]);
|
|
854
|
+
})) })]), valibot.intersect([PangeaResponseSchema, PangeaAcceptedResponseSchema])]);
|
|
855
|
+
const AidrPostV1UnredactRequestSchema = valibot.object({
|
|
856
|
+
body: valibot.optional(valibot.strictObject({
|
|
857
|
+
redacted_data: valibot.unknown(),
|
|
858
|
+
fpe_context: valibot.string()
|
|
859
|
+
})),
|
|
860
|
+
path: valibot.optional(valibot.never()),
|
|
861
|
+
query: valibot.optional(valibot.never())
|
|
862
|
+
});
|
|
863
|
+
const AidrPostV1UnredactResponseSchema = valibot.union([valibot.intersect([PangeaResponseSchema, valibot.object({ result: valibot.optional(valibot.object({ data: valibot.unknown() })) })]), valibot.intersect([PangeaResponseSchema, PangeaAcceptedResponseSchema])]);
|
|
897
864
|
const GetAsyncRequestRequestSchema = valibot.object({
|
|
898
865
|
body: valibot.optional(valibot.never()),
|
|
899
866
|
path: valibot.object({ requestId: valibot.string() }),
|
|
900
867
|
query: valibot.optional(valibot.never())
|
|
901
868
|
});
|
|
902
|
-
const GetAsyncRequestResponseSchema = valibot.union([PangeaResponseSchema, valibot.intersect([PangeaResponseSchema, valibot.object({
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
869
|
+
const GetAsyncRequestResponseSchema = valibot.union([PangeaResponseSchema, valibot.intersect([PangeaResponseSchema, valibot.object({
|
|
870
|
+
result: valibot.object({
|
|
871
|
+
ttl_mins: valibot.optional(valibot.pipe(valibot.number(), valibot.integer())),
|
|
872
|
+
retry_counter: valibot.optional(valibot.pipe(valibot.number(), valibot.integer())),
|
|
873
|
+
location: valibot.optional(valibot.string())
|
|
874
|
+
}),
|
|
875
|
+
status: valibot.picklist(["Accepted"])
|
|
876
|
+
})])]);
|
|
907
877
|
|
|
908
878
|
//#endregion
|
|
909
879
|
exports.AccessRuleResultSchema = AccessRuleResultSchema;
|
|
@@ -962,6 +932,8 @@ exports.AidrPolicycollectionSearchResultSchema = AidrPolicycollectionSearchResul
|
|
|
962
932
|
exports.AidrPolicycollectionSearchSchema = AidrPolicycollectionSearchSchema;
|
|
963
933
|
exports.AidrPostV1GuardChatCompletionsRequestSchema = AidrPostV1GuardChatCompletionsRequestSchema;
|
|
964
934
|
exports.AidrPostV1GuardChatCompletionsResponseSchema = AidrPostV1GuardChatCompletionsResponseSchema;
|
|
935
|
+
exports.AidrPostV1UnredactRequestSchema = AidrPostV1UnredactRequestSchema;
|
|
936
|
+
exports.AidrPostV1UnredactResponseSchema = AidrPostV1UnredactResponseSchema;
|
|
965
937
|
exports.AidrPromptInjectionResultSchema = AidrPromptInjectionResultSchema;
|
|
966
938
|
exports.AidrPromptItemListResultSchema = AidrPromptItemListResultSchema;
|
|
967
939
|
exports.AidrPromptItemSchema = AidrPromptItemSchema;
|
|
@@ -981,20 +953,15 @@ exports.AidrServiceConfigSchema = AidrServiceConfigSchema;
|
|
|
981
953
|
exports.AidrSingleEntityResultSchema = AidrSingleEntityResultSchema;
|
|
982
954
|
exports.AidrTimestampSchema = AidrTimestampSchema;
|
|
983
955
|
exports.AidrTopicResultSchema = AidrTopicResultSchema;
|
|
984
|
-
exports.AirdTimestampNullableSchema = AirdTimestampNullableSchema;
|
|
985
|
-
exports.AuthnTimestampSchema = AuthnTimestampSchema;
|
|
986
956
|
exports.ChatCompletionsGuardSchema = ChatCompletionsGuardSchema;
|
|
987
957
|
exports.DetectorSettingsSchema = DetectorSettingsSchema;
|
|
988
958
|
exports.FilterIdSchema = FilterIdSchema;
|
|
989
959
|
exports.GetAsyncRequestRequestSchema = GetAsyncRequestRequestSchema;
|
|
990
960
|
exports.GetAsyncRequestResponseSchema = GetAsyncRequestResponseSchema;
|
|
991
|
-
exports.
|
|
992
|
-
exports.MaliciousEntityActionSchema = MaliciousEntityActionSchema;
|
|
961
|
+
exports.PangeaAcceptedResponseSchema = PangeaAcceptedResponseSchema;
|
|
993
962
|
exports.PangeaResponseSchema = PangeaResponseSchema;
|
|
994
963
|
exports.PangeaValidationErrorsSchema = PangeaValidationErrorsSchema;
|
|
995
|
-
exports.PiiEntityActionSchema = PiiEntityActionSchema;
|
|
996
964
|
exports.PolicyIdSchema = PolicyIdSchema;
|
|
997
965
|
exports.RecipeConfigSchema = RecipeConfigSchema;
|
|
998
|
-
exports.RedactEntityResultSchema = RedactEntityResultSchema;
|
|
999
966
|
exports.RuleRedactionConfigSchema = RuleRedactionConfigSchema;
|
|
1000
967
|
exports.ServiceConfigIdSchema = ServiceConfigIdSchema;
|