@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/dist/index.d.mts 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?: 'input' | 'output' | 'tool_input' | 'tool_output' | 'tool_listing';
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
- * A time in ISO-8601 format
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 AuthnTimestamp = string;
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<AidrPostV1GuardChatCompletionsResponse['result']>>;
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, AirdTimestampNullable, AuthnTimestamp, ChatCompletionsGuard, DetectorSettings, ErrorResponse, FilterId, GetAsyncRequestData, GetAsyncRequestResponse, GetAsyncRequestResponses, LanguageResult, MaliciousEntityAction, MaybeAcceptedResponse, PangeaResponse, PangeaValidationErrors, PiiEntityAction, PolicyId, RecipeConfig, RedactEntityResult, RuleRedactionConfig, ServiceConfigId };
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 };
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.picklist([
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
- * A time in ISO-8601 format
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 AirdTimestampNullableSchema = valibot.union([AuthnTimestampSchema, valibot.null()]);
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({ result: valibot.optional(valibot.object({
903
- ttl_mins: valibot.optional(valibot.pipe(valibot.number(), valibot.integer())),
904
- retry_counter: valibot.optional(valibot.pipe(valibot.number(), valibot.integer())),
905
- location: valibot.optional(valibot.string())
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.LanguageResultSchema = LanguageResultSchema;
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;