@crowdstrike/aidr 1.0.2

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.
Files changed (51) hide show
  1. package/.editorconfig +9 -0
  2. package/.github/CODEOWNERS +1 -0
  3. package/.github/workflows/ci.yml +128 -0
  4. package/.pnpmfile.cjs +17 -0
  5. package/.releaserc.json +21 -0
  6. package/LICENSE.txt +21 -0
  7. package/README.md +3 -0
  8. package/biome.json +67 -0
  9. package/dist/chunk.cjs +34 -0
  10. package/dist/index.cjs +356 -0
  11. package/dist/index.d.cts +2347 -0
  12. package/dist/index.d.mts +2347 -0
  13. package/dist/index.mjs +354 -0
  14. package/dist/schemas/ai-guard.cjs +1000 -0
  15. package/dist/schemas/ai-guard.d.cts +1232 -0
  16. package/dist/schemas/ai-guard.d.mts +1232 -0
  17. package/dist/schemas/ai-guard.mjs +907 -0
  18. package/dist/schemas/index.cjs +7 -0
  19. package/dist/schemas/index.d.cts +64 -0
  20. package/dist/schemas/index.d.mts +64 -0
  21. package/dist/schemas/index.mjs +3 -0
  22. package/dist/schemas.cjs +139 -0
  23. package/dist/schemas.mjs +108 -0
  24. package/flake.lock +59 -0
  25. package/flake.nix +26 -0
  26. package/openapi-ts.config.ts +15 -0
  27. package/package.json +55 -0
  28. package/pnpm-workspace.yaml +3 -0
  29. package/scripts/generate-models +15 -0
  30. package/scripts/test +10 -0
  31. package/specs/ai-guard.openapi.json +3721 -0
  32. package/src/client.ts +441 -0
  33. package/src/core/error.ts +78 -0
  34. package/src/index.ts +2 -0
  35. package/src/internal/builtin-types.ts +18 -0
  36. package/src/internal/errors.ts +34 -0
  37. package/src/internal/headers.ts +100 -0
  38. package/src/internal/parse.ts +30 -0
  39. package/src/internal/request-options.ts +57 -0
  40. package/src/internal/types.ts +3 -0
  41. package/src/internal/utils/sleep.ts +3 -0
  42. package/src/internal/utils/values.ts +38 -0
  43. package/src/schemas/ai-guard.ts +1215 -0
  44. package/src/schemas/index.ts +114 -0
  45. package/src/services/ai-guard.ts +27 -0
  46. package/src/types/ai-guard.ts +2276 -0
  47. package/src/types/index.ts +161 -0
  48. package/tests/ai-guard.test.ts +29 -0
  49. package/tsconfig.json +26 -0
  50. package/tsdown.config.mts +14 -0
  51. package/vitest.config.mts +4 -0
@@ -0,0 +1,2276 @@
1
+ /** biome-ignore-all lint/style/useConsistentArrayType: generated. */
2
+
3
+ /**
4
+ * Response Schema
5
+ *
6
+ * Pangea standard response schema
7
+ */
8
+ export type PangeaResponse = {
9
+ /**
10
+ * A unique identifier assigned to each request made to the API. It is used to track and identify a specific request and its associated data. The `request_id` can be helpful for troubleshooting, auditing, and tracing the flow of requests within the system. It allows users to reference and retrieve information related to a particular request, such as the response, parameters, and raw data associated with that specific request.
11
+ *
12
+ * ```
13
+ * "request_id":"prq_x6fdiizbon6j3bsdvnpmwxsz2aan7fqd"
14
+ * ```
15
+ */
16
+ request_id: string;
17
+ /**
18
+ * The timestamp indicates the exact moment when a request is made to the API. It represents the date and time at which the request was initiated by the client. The `request_time` is useful for tracking and analyzing the timing of requests, measuring response times, and monitoring performance metrics. It allows users to determine the duration between the request initiation and the corresponding response, aiding in the assessment of API performance and latency.
19
+ *
20
+ * ```
21
+ * "request_time":"2022-09-21T17:24:33.105Z"
22
+ * ```
23
+ */
24
+ request_time: string;
25
+ /**
26
+ * Duration it takes for the API to process a request and generate a response. It represents the elapsed time from when the request is received by the API to when the corresponding response is returned to the client.
27
+ *
28
+ * ```
29
+ * "response_time":"2022-09-21T17:24:34.007Z"
30
+ * ```
31
+ */
32
+ response_time: string;
33
+ /**
34
+ * It represents the status or outcome of the API request made for IP information. It indicates the current state or condition of the request and provides information on the success or failure of the request.
35
+ *
36
+ * ```
37
+ * "status":"success"
38
+ * ```
39
+ */
40
+ status: string;
41
+ /**
42
+ * 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.
43
+ */
44
+ summary?: string;
45
+ result?: {
46
+ [key: string]: unknown;
47
+ };
48
+ };
49
+
50
+ export type PangeaValidationErrors = PangeaResponse;
51
+
52
+ /**
53
+ * Device status. Allowed values are active, pending, disabled
54
+ */
55
+ export type AidrDeviceStatus = 'pending' | 'active' | 'disabled';
56
+
57
+ export type AidrIpv4OrV6 = string;
58
+
59
+ export type AidrDevice = {
60
+ /**
61
+ * client generated unique ID.
62
+ */
63
+ id: string;
64
+ /**
65
+ * Device name
66
+ */
67
+ name?: string;
68
+ status?: AidrDeviceStatus;
69
+ /**
70
+ * Arbitrary device metadata.
71
+ */
72
+ metadata?: {
73
+ [key: string]: unknown;
74
+ };
75
+ /**
76
+ * Owning user identifier.
77
+ */
78
+ user_id?: string;
79
+ /**
80
+ * Last observed IP address for this device.
81
+ */
82
+ last_used_ip?: AidrIpv4OrV6;
83
+ };
84
+
85
+ export type AidrDeviceCheckResult = {
86
+ device?: AidrDeviceResult;
87
+ config?: AidrServiceConfigResult;
88
+ access_token?: AidrDeviceTokenInfo;
89
+ };
90
+
91
+ export type AidrDeviceTokenInfo = {
92
+ /**
93
+ * The access token issued for given device.
94
+ */
95
+ token?: string;
96
+ /**
97
+ * The lifetime in seconds of the access token.
98
+ */
99
+ expires_in?: number;
100
+ /**
101
+ * Timestamp when the record when token is created (RFC 3339 format)
102
+ */
103
+ created_at?: string;
104
+ };
105
+
106
+ export type AidrDeviceResult = {
107
+ /**
108
+ * client generated unique ID.
109
+ */
110
+ id: string;
111
+ /**
112
+ * Device name
113
+ */
114
+ name?: string;
115
+ status: AidrDeviceStatus;
116
+ /**
117
+ * Arbitrary device metadata.
118
+ */
119
+ metadata?: {
120
+ [key: string]: unknown;
121
+ };
122
+ /**
123
+ * Owning user identifier (UUID/string).
124
+ */
125
+ user_id?: string;
126
+ /**
127
+ * Last observed IP address for this device.
128
+ */
129
+ last_used_ip?: AidrIpv4OrV6;
130
+ /**
131
+ * Timestamp when the record was created (RFC 3339 format)
132
+ */
133
+ created_at?: string;
134
+ /**
135
+ * Timestamp when the record was last updated (RFC 3339 format)
136
+ */
137
+ updated_at?: string;
138
+ };
139
+
140
+ /**
141
+ * client generated unique ID.
142
+ */
143
+ export type AidrDeviceId = string;
144
+
145
+ /**
146
+ * List or filter/search device records.
147
+ */
148
+ export type AidrDeviceSearch = {
149
+ filter?: {
150
+ /**
151
+ * Only records where created_at equals this value.
152
+ */
153
+ created_at?: string;
154
+ /**
155
+ * Only records where created_at is greater than this value.
156
+ */
157
+ created_at__gt?: string;
158
+ /**
159
+ * Only records where created_at is greater than or equal to this value.
160
+ */
161
+ created_at__gte?: string;
162
+ /**
163
+ * Only records where created_at is less than this value.
164
+ */
165
+ created_at__lt?: string;
166
+ /**
167
+ * Only records where created_at is less than or equal to this value.
168
+ */
169
+ created_at__lte?: string;
170
+ /**
171
+ * Only records where updated_at equals this value.
172
+ */
173
+ updated_at?: string;
174
+ /**
175
+ * Only records where updated_at is greater than this value.
176
+ */
177
+ updated_at__gt?: string;
178
+ /**
179
+ * Only records where updated_at is greater than or equal to this value.
180
+ */
181
+ updated_at__gte?: string;
182
+ /**
183
+ * Only records where updated_at is less than this value.
184
+ */
185
+ updated_at__lt?: string;
186
+ /**
187
+ * Only records where updated_at is less than or equal to this value.
188
+ */
189
+ updated_at__lte?: string;
190
+ /**
191
+ * Only records where id is equal to the value
192
+ */
193
+ id?: string;
194
+ /**
195
+ * Only records where id includes each substring.
196
+ */
197
+ id__contains?: Array<string>;
198
+ /**
199
+ * Only records where id equals one of the provided substrings.
200
+ */
201
+ id__in?: Array<string>;
202
+ /**
203
+ * Only records where name is equal to the value
204
+ */
205
+ name?: string;
206
+ /**
207
+ * Only records where name includes each substring.
208
+ */
209
+ name__contains?: Array<string>;
210
+ /**
211
+ * Only records where name equals one of the provided substrings.
212
+ */
213
+ name__in?: Array<string>;
214
+ /**
215
+ * Only records where status is equal to the value
216
+ */
217
+ status?: AidrDeviceStatus;
218
+ /**
219
+ * Only records where status includes each substring.
220
+ */
221
+ status__contains?: Array<AidrDeviceStatus>;
222
+ /**
223
+ * Only records where status equals one of the provided substrings.
224
+ */
225
+ status__in?: Array<AidrDeviceStatus>;
226
+ };
227
+ /**
228
+ * Reflected value from a previous response to obtain the next page of results.
229
+ */
230
+ last?: string;
231
+ /**
232
+ * Order results asc(ending) or desc(ending).
233
+ */
234
+ order?: 'asc' | 'desc';
235
+ /**
236
+ * Which field to order results by.
237
+ */
238
+ order_by?: 'name' | 'created_at' | 'updated_at';
239
+ /**
240
+ * Maximum results to include in the response.
241
+ */
242
+ size?: number;
243
+ };
244
+
245
+ export type AidrDeviceSearchResult = {
246
+ /**
247
+ * Pagination count of returned records
248
+ */
249
+ count?: number;
250
+ /**
251
+ * Pagination last cursor
252
+ */
253
+ last?: string;
254
+ devices?: Array<AidrDeviceResult>;
255
+ };
256
+
257
+ /**
258
+ * MetricEvent data
259
+ */
260
+ export type AidrMetricOnlyData = {
261
+ /**
262
+ * Application ID
263
+ */
264
+ app_id?: string;
265
+ /**
266
+ * Actor/User ID
267
+ */
268
+ actor_id?: string;
269
+ /**
270
+ * LLM provider name
271
+ */
272
+ llm_provider?: string;
273
+ /**
274
+ * Model name
275
+ */
276
+ model?: string;
277
+ /**
278
+ * Version of the model
279
+ */
280
+ model_version?: string;
281
+ /**
282
+ * Number of tokens in the request
283
+ */
284
+ request_token_count?: number;
285
+ /**
286
+ * Number of tokens in the response
287
+ */
288
+ response_token_count?: number;
289
+ /**
290
+ * Source IP address
291
+ */
292
+ source_ip?: string;
293
+ /**
294
+ * Geographic source location
295
+ */
296
+ source_location?: string;
297
+ /**
298
+ * Type of event
299
+ */
300
+ event_type?: string;
301
+ /**
302
+ * Unique collector instance ID
303
+ */
304
+ collector_instance_id?: string;
305
+ /**
306
+ * Additional metadata as key-value pairs
307
+ */
308
+ extra_info?: {
309
+ [key: string]: unknown;
310
+ };
311
+ };
312
+
313
+ /**
314
+ * List or filter/search saved filter records.
315
+ */
316
+ export type AidrSavedFilterSearch = {
317
+ filter?: {
318
+ /**
319
+ * Only records where created_at equals this value.
320
+ */
321
+ created_at?: string;
322
+ /**
323
+ * Only records where created_at is greater than this value.
324
+ */
325
+ created_at__gt?: string;
326
+ /**
327
+ * Only records where created_at is greater than or equal to this value.
328
+ */
329
+ created_at__gte?: string;
330
+ /**
331
+ * Only records where created_at is less than this value.
332
+ */
333
+ created_at__lt?: string;
334
+ /**
335
+ * Only records where created_at is less than or equal to this value.
336
+ */
337
+ created_at__lte?: string;
338
+ /**
339
+ * Only records where updated_at equals this value.
340
+ */
341
+ updated_at?: string;
342
+ /**
343
+ * Only records where updated_at is greater than this value.
344
+ */
345
+ updated_at__gt?: string;
346
+ /**
347
+ * Only records where updated_at is greater than or equal to this value.
348
+ */
349
+ updated_at__gte?: string;
350
+ /**
351
+ * Only records where updated_at is less than this value.
352
+ */
353
+ updated_at__lt?: string;
354
+ /**
355
+ * Only records where updated_at is less than or equal to this value.
356
+ */
357
+ updated_at__lte?: string;
358
+ /**
359
+ * Only records where id is equal to the value
360
+ */
361
+ id?: string;
362
+ /**
363
+ * Only records where id includes each substring.
364
+ */
365
+ id__contains?: Array<string>;
366
+ /**
367
+ * Only records where id equals one of the provided substrings.
368
+ */
369
+ id__in?: Array<string>;
370
+ /**
371
+ * Only records where name is equal to the value
372
+ */
373
+ name?: string;
374
+ /**
375
+ * Only records where name includes each substring.
376
+ */
377
+ name__contains?: Array<string>;
378
+ /**
379
+ * Only records where name equals one of the provided substrings.
380
+ */
381
+ name__in?: Array<string>;
382
+ };
383
+ /**
384
+ * Reflected value from a previous response to obtain the next page of results.
385
+ */
386
+ last?: string;
387
+ /**
388
+ * Order results asc(ending) or desc(ending).
389
+ */
390
+ order?: 'asc' | 'desc';
391
+ /**
392
+ * Which field to order results by.
393
+ */
394
+ order_by?: 'name' | 'created_at' | 'updated_at';
395
+ /**
396
+ * Maximum results to include in the response.
397
+ */
398
+ size?: number;
399
+ };
400
+
401
+ export type AidrSavedFilterSearchResult = {
402
+ /**
403
+ * Pagination count of returned records
404
+ */
405
+ count?: number;
406
+ /**
407
+ * Pagination last cursor
408
+ */
409
+ last?: string;
410
+ saved_filters?: Array<AidrSavedFilterResult>;
411
+ };
412
+
413
+ export type AidrSavedFilter = {
414
+ /**
415
+ * Unique name for the saved filter
416
+ */
417
+ name: string;
418
+ /**
419
+ * Filter details
420
+ */
421
+ filter: {
422
+ [key: string]: unknown;
423
+ };
424
+ };
425
+
426
+ export type AidrSavedFilterResult = {
427
+ /**
428
+ * Unique name for the saved filter
429
+ */
430
+ name: string;
431
+ /**
432
+ * Filter details
433
+ */
434
+ filter: {
435
+ [key: string]: unknown;
436
+ };
437
+ /**
438
+ * Timestamp when the record was created (RFC 3339 format)
439
+ */
440
+ created_at: string;
441
+ /**
442
+ * Timestamp when the record was last updated (RFC 3339 format)
443
+ */
444
+ updated_at: string;
445
+ };
446
+
447
+ /**
448
+ * List or filter/search field alias records.
449
+ */
450
+ export type AidrFieldAliasSearch = {
451
+ filter?: {
452
+ /**
453
+ * Only records where created_at equals this value.
454
+ */
455
+ created_at?: string;
456
+ /**
457
+ * Only records where created_at is greater than this value.
458
+ */
459
+ created_at__gt?: string;
460
+ /**
461
+ * Only records where created_at is greater than or equal to this value.
462
+ */
463
+ created_at__gte?: string;
464
+ /**
465
+ * Only records where created_at is less than this value.
466
+ */
467
+ created_at__lt?: string;
468
+ /**
469
+ * Only records where created_at is less than or equal to this value.
470
+ */
471
+ created_at__lte?: string;
472
+ /**
473
+ * Only records where field name is equal to the value
474
+ */
475
+ field_name?: string;
476
+ /**
477
+ * Only records where field name includes each substring.
478
+ */
479
+ field_name__contains?: Array<string>;
480
+ /**
481
+ * Only records where name equals one of the provided substrings.
482
+ */
483
+ field_name__in?: Array<string>;
484
+ /**
485
+ * Only records where field type equals this value.
486
+ */
487
+ field_type?: string;
488
+ /**
489
+ * Only records where field type includes each substring.
490
+ */
491
+ field_type__contains?: Array<string>;
492
+ /**
493
+ * Only records where field type equals one of the provided substrings.
494
+ */
495
+ field_type__in?: Array<string>;
496
+ /**
497
+ * Only records where field alias equals this value.
498
+ */
499
+ field_alias?: string;
500
+ /**
501
+ * Only records where field alias includes each substring.
502
+ */
503
+ field_alias__contains?: Array<string>;
504
+ /**
505
+ * Only records where field alias equals one of the provided substrings.
506
+ */
507
+ field_alias__in?: Array<string>;
508
+ /**
509
+ * Only records where updated_at equals this value.
510
+ */
511
+ updated_at?: string;
512
+ /**
513
+ * Only records where updated_at is greater than this value.
514
+ */
515
+ updated_at__gt?: string;
516
+ /**
517
+ * Only records where updated_at is greater than or equal to this value.
518
+ */
519
+ updated_at__gte?: string;
520
+ /**
521
+ * Only records where updated_at is less than this value.
522
+ */
523
+ updated_at__lt?: string;
524
+ /**
525
+ * Only records where updated_at is less than or equal to this value.
526
+ */
527
+ updated_at__lte?: string;
528
+ };
529
+ /**
530
+ * Reflected value from a previous response to obtain the next page of results.
531
+ */
532
+ last?: string;
533
+ /**
534
+ * Order results asc(ending) or desc(ending).
535
+ */
536
+ order?: 'asc' | 'desc';
537
+ /**
538
+ * Which field to order results by.
539
+ */
540
+ order_by?:
541
+ | 'field_name'
542
+ | 'field_type'
543
+ | 'created_at'
544
+ | 'updated_at'
545
+ | 'published_at'
546
+ | 'field_alias';
547
+ /**
548
+ * Maximum results to include in the response.
549
+ */
550
+ size?: number;
551
+ };
552
+
553
+ export type AidrFieldAliasSearchResult = {
554
+ /**
555
+ * Pagination limit
556
+ */
557
+ count?: number;
558
+ /**
559
+ * Pagination last count
560
+ */
561
+ last?: string;
562
+ items?: Array<AidrFieldAliasResult>;
563
+ };
564
+
565
+ export type AidrCustomlist = {
566
+ /**
567
+ * Name of the list
568
+ */
569
+ name?: string;
570
+ /**
571
+ * Type of the list
572
+ */
573
+ type?: 'site';
574
+ /**
575
+ * Content of the list based on type
576
+ */
577
+ content?: Array<unknown>;
578
+ };
579
+
580
+ export type ChatCompletionsGuard = {
581
+ /**
582
+ * 'messages' contains Prompt content and role array in JSON format. The `content` is the multimodel text or image input that will be analyzed. Additional properties such as 'tools' may be provided for analysis.
583
+ */
584
+ guard_input: {
585
+ [key: string]: unknown;
586
+ };
587
+ /**
588
+ * Id of source application/agent
589
+ */
590
+ app_id?: string;
591
+ /**
592
+ * User/Service account id/service account
593
+ */
594
+ user_id?: string;
595
+ /**
596
+ * Underlying LLM. Example: 'OpenAI'.
597
+ */
598
+ llm_provider?: string;
599
+ /**
600
+ * Model used to perform the event. Example: 'gpt'.
601
+ */
602
+ model?: string;
603
+ /**
604
+ * Model version used to perform the event. Example: '3.5'.
605
+ */
606
+ model_version?: string;
607
+ /**
608
+ * IP address of user or app or agent.
609
+ */
610
+ source_ip?: string;
611
+ /**
612
+ * Location of user or app or agent.
613
+ */
614
+ source_location?: string;
615
+ /**
616
+ * For gateway-like integrations with multi-tenant support.
617
+ */
618
+ tenant_id?: string;
619
+ /**
620
+ * (AIDR) Event Type.
621
+ */
622
+ event_type?:
623
+ | 'input'
624
+ | 'output'
625
+ | 'tool_input'
626
+ | 'tool_output'
627
+ | 'tool_listing';
628
+ /**
629
+ * (AIDR) collector instance id.
630
+ */
631
+ collector_instance_id?: string;
632
+ /**
633
+ * (AIDR) Logging schema.
634
+ */
635
+ extra_info?: {
636
+ /**
637
+ * Name of source application/agent.
638
+ */
639
+ app_name?: string;
640
+ /**
641
+ * The group of source application/agent.
642
+ */
643
+ app_group?: string;
644
+ /**
645
+ * Version of the source application/agent.
646
+ */
647
+ app_version?: string;
648
+ /**
649
+ * Name of subject actor/service account.
650
+ */
651
+ actor_name?: string;
652
+ /**
653
+ * The group of subject actor.
654
+ */
655
+ actor_group?: string;
656
+ /**
657
+ * Geographic region or data center.
658
+ */
659
+ source_region?: string;
660
+ /**
661
+ * Sub tenant of the user or organization
662
+ */
663
+ sub_tenant?: string;
664
+ /**
665
+ * MCP tools grouped by server
666
+ *
667
+ * Each item groups tools for a given MCP server.
668
+ */
669
+ mcp_tools?: Array<{
670
+ /**
671
+ * MCP server name
672
+ */
673
+ server_name: string;
674
+ tools: Array<string>;
675
+ }>;
676
+ [key: string]:
677
+ | unknown
678
+ | string
679
+ | Array<{
680
+ /**
681
+ * MCP server name
682
+ */
683
+ server_name: string;
684
+ tools: Array<string>;
685
+ }>
686
+ | undefined;
687
+ };
688
+ };
689
+
690
+ export type AidrPromptInjectionResult = {
691
+ /**
692
+ * The action taken by this Detector
693
+ */
694
+ action?: string;
695
+ /**
696
+ * Triggered prompt injection analyzers.
697
+ */
698
+ analyzer_responses?: Array<{
699
+ analyzer: string;
700
+ confidence: number;
701
+ }>;
702
+ };
703
+
704
+ export type AidrRedactEntityResult = {
705
+ /**
706
+ * Detected redaction rules.
707
+ */
708
+ entities?: Array<{
709
+ /**
710
+ * The action taken on this Entity
711
+ */
712
+ action: string;
713
+ type: string;
714
+ value: string;
715
+ start_pos?: number;
716
+ }>;
717
+ };
718
+
719
+ export type AidrMaliciousEntityResult = {
720
+ /**
721
+ * Detected harmful items.
722
+ */
723
+ entities?: Array<{
724
+ type: string;
725
+ value: string;
726
+ start_pos?: number;
727
+ raw?: {
728
+ [key: string]: unknown;
729
+ };
730
+ }>;
731
+ };
732
+
733
+ export type AidrSingleEntityResult = {
734
+ /**
735
+ * The action taken by this Detector
736
+ */
737
+ action?: string;
738
+ /**
739
+ * Detected entities.
740
+ */
741
+ entities?: Array<string>;
742
+ };
743
+
744
+ export type AidrLanguageResult = {
745
+ /**
746
+ * The action taken by this Detector
747
+ */
748
+ action?: string;
749
+ language?: string;
750
+ };
751
+
752
+ export type AidrTopicResult = {
753
+ /**
754
+ * The action taken by this Detector
755
+ */
756
+ action?: string;
757
+ /**
758
+ * List of topics detected
759
+ */
760
+ topics?: Array<{
761
+ topic: string;
762
+ confidence: number;
763
+ }>;
764
+ };
765
+
766
+ /**
767
+ * Result of the recipe evaluating configured rules
768
+ */
769
+ export type AidrAccessRulesResponse = {
770
+ [key: string]: unknown | AccessRuleResult;
771
+ };
772
+
773
+ export type AidrPolicy = {
774
+ /**
775
+ * Unique identifier for the policy
776
+ */
777
+ key: string;
778
+ /**
779
+ * A friendly display name for the policy
780
+ */
781
+ name: string;
782
+ /**
783
+ * A detailed description for the policy
784
+ */
785
+ description?: string;
786
+ /**
787
+ * The schema version used for the policy definition
788
+ */
789
+ schema_version: 'v1.1';
790
+ /**
791
+ * Settings for Detectors, including which detectors to enable and how they behave
792
+ */
793
+ detector_settings?: DetectorSettings;
794
+ /**
795
+ * Configuration for access rules used in an AIDR policy.
796
+ */
797
+ access_rules?: Array<AccessRuleSettings>;
798
+ /**
799
+ * Connector-level Redact configuration. These settings allow you to define reusable redaction parameters, such as FPE tweak value.
800
+ */
801
+ connector_settings?: {
802
+ /**
803
+ * Settings for Redact integration at the policy level
804
+ */
805
+ redact?: {
806
+ /**
807
+ * 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.
808
+ */
809
+ fpe_tweak_vault_secret_id?: string;
810
+ };
811
+ };
812
+ };
813
+
814
+ export type AidrCustomlistResult = {
815
+ /**
816
+ * Unique identifier for the list
817
+ */
818
+ id?: string;
819
+ /**
820
+ * Name of the list
821
+ */
822
+ name?: string;
823
+ /**
824
+ * Type of the list
825
+ */
826
+ type?: 'site';
827
+ /**
828
+ * Content of the list
829
+ */
830
+ content?: Array<{
831
+ [key: string]: unknown;
832
+ }>;
833
+ created_at?: string;
834
+ updated_at?: string;
835
+ };
836
+
837
+ export type AidrPolicyResult = {
838
+ id: PolicyId;
839
+ /**
840
+ * Unique identifier for the policy
841
+ */
842
+ key: string;
843
+ /**
844
+ * A friendly display name for the policy
845
+ */
846
+ name: string;
847
+ /**
848
+ * A detailed description for the policy
849
+ */
850
+ description?: string;
851
+ /**
852
+ * The schema version used for the policy definition
853
+ */
854
+ schema_version: 'v1.1';
855
+ /**
856
+ * The current revision of the policy
857
+ */
858
+ revision: number;
859
+ /**
860
+ * Settings for Detectors, including which detectors to enable and how they behave
861
+ */
862
+ detector_settings?: DetectorSettings;
863
+ /**
864
+ * Configuration for access rules used in an AIDR policy.
865
+ */
866
+ access_rules?: Array<AccessRuleSettings>;
867
+ /**
868
+ * Connector-level Redact configuration. These settings allow you to define reusable redaction parameters, such as FPE tweak value.
869
+ */
870
+ connector_settings?: {
871
+ /**
872
+ * Settings for Redact integration at the policy level
873
+ */
874
+ redact?: {
875
+ /**
876
+ * 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.
877
+ */
878
+ fpe_tweak_vault_secret_id?: string;
879
+ };
880
+ };
881
+ /**
882
+ * Timestamp when the record was created (RFC 3339 format)
883
+ */
884
+ created_at?: string;
885
+ /**
886
+ * Timestamp when the record was last updated (RFC 3339 format)
887
+ */
888
+ updated_at?: string;
889
+ };
890
+
891
+ export type AidrPolicyDefaults = {
892
+ default_policies: {
893
+ [key: string]: unknown | RecipeConfig;
894
+ };
895
+ };
896
+
897
+ /**
898
+ * List or filter/search policy records.
899
+ */
900
+ export type AidrPolicySearch = {
901
+ filter?: {
902
+ /**
903
+ * Only records where key is equal to the value
904
+ */
905
+ key?: string;
906
+ /**
907
+ * Only records where key includes each substring.
908
+ */
909
+ key__contains?: Array<string>;
910
+ /**
911
+ * Only records where name equals one of the provided substrings.
912
+ */
913
+ name__in?: Array<string>;
914
+ /**
915
+ * Only records where status equals this value.
916
+ */
917
+ status?: string;
918
+ };
919
+ /**
920
+ * Reflected value from a previous response to obtain the next page of results.
921
+ */
922
+ last?: string;
923
+ /**
924
+ * Order results asc(ending) or desc(ending).
925
+ */
926
+ order?: 'asc' | 'desc';
927
+ /**
928
+ * Which field to order results by.
929
+ */
930
+ order_by?: 'key' | 'name' | 'created_at' | 'updated_at';
931
+ /**
932
+ * Maximum results to include in the response.
933
+ */
934
+ size?: number;
935
+ };
936
+
937
+ export type AidrPolicySearchResult = {
938
+ /**
939
+ * Pagination limit
940
+ */
941
+ count?: number;
942
+ /**
943
+ * Pagination last count
944
+ */
945
+ last?: string;
946
+ policies?: Array<AidrPolicyResult>;
947
+ };
948
+
949
+ export type AidrPromptItemListResult = {
950
+ policies?: Array<AidrPromptItem>;
951
+ };
952
+
953
+ export type AidrPromptItem = {
954
+ /**
955
+ * Unique id for the item
956
+ */
957
+ id?: string;
958
+ /**
959
+ * Type for the item
960
+ */
961
+ type?: string;
962
+ /**
963
+ * Data for the item
964
+ */
965
+ content?: string;
966
+ };
967
+
968
+ export type AidrFieldAlias = {
969
+ /**
970
+ * Unique name for the field
971
+ */
972
+ field_name: string;
973
+ /**
974
+ * Field type
975
+ */
976
+ field_type: string;
977
+ /**
978
+ * Alternate display name or alias
979
+ */
980
+ field_alias: string;
981
+ /**
982
+ * Array of tag strings
983
+ */
984
+ field_tags?: Array<string>;
985
+ };
986
+
987
+ export type AidrFieldAliasResult = {
988
+ /**
989
+ * Unique name for the field
990
+ */
991
+ field_name: string;
992
+ /**
993
+ * Field type
994
+ */
995
+ field_type: string;
996
+ /**
997
+ * Alternate display name or alias
998
+ */
999
+ field_alias: string;
1000
+ /**
1001
+ * Array of tag strings
1002
+ */
1003
+ field_tags?: Array<string>;
1004
+ /**
1005
+ * Timestamp when the record was created (RFC 3339 format)
1006
+ */
1007
+ created_at: string;
1008
+ /**
1009
+ * Timestamp when the record was last updated (RFC 3339 format)
1010
+ */
1011
+ updated_at: string;
1012
+ };
1013
+
1014
+ export type AidrPolicycollectionResult = {
1015
+ /**
1016
+ * Unique identifier for the policy collection
1017
+ */
1018
+ key?: string;
1019
+ /**
1020
+ * Name of the policy collection
1021
+ */
1022
+ name?: string;
1023
+ /**
1024
+ * Type of the policy collection
1025
+ */
1026
+ type?: 'logging' | 'gateway' | 'browser' | 'application' | 'agentic';
1027
+ /**
1028
+ * Settings for the policy collection
1029
+ */
1030
+ settings?: {
1031
+ [key: string]: unknown;
1032
+ };
1033
+ created_at?: string;
1034
+ updated_at?: string;
1035
+ };
1036
+
1037
+ /**
1038
+ * List or filter/search policy collection records.
1039
+ */
1040
+ export type AidrPolicycollectionSearch = {
1041
+ filter?: {
1042
+ /**
1043
+ * Only records where created_at equals this value.
1044
+ */
1045
+ created_at?: string;
1046
+ /**
1047
+ * Only records where created_at is greater than this value.
1048
+ */
1049
+ created_at__gt?: string;
1050
+ /**
1051
+ * Only records where created_at is greater than or equal to this value.
1052
+ */
1053
+ created_at__gte?: string;
1054
+ /**
1055
+ * Only records where created_at is less than this value.
1056
+ */
1057
+ created_at__lt?: string;
1058
+ /**
1059
+ * Only records where created_at is less than or equal to this value.
1060
+ */
1061
+ created_at__lte?: string;
1062
+ /**
1063
+ * Only records where updated_at equals this value.
1064
+ */
1065
+ updated_at?: string;
1066
+ /**
1067
+ * Only records where updated_at is greater than this value.
1068
+ */
1069
+ updated_at__gt?: string;
1070
+ /**
1071
+ * Only records where updated_at is greater than or equal to this value.
1072
+ */
1073
+ updated_at__gte?: string;
1074
+ /**
1075
+ * Only records where updated_at is less than this value.
1076
+ */
1077
+ updated_at__lt?: string;
1078
+ /**
1079
+ * Only records where updated_at is less than or equal to this value.
1080
+ */
1081
+ updated_at__lte?: string;
1082
+ /**
1083
+ * Only records where type is equal to the value
1084
+ */
1085
+ type?: 'logging' | 'gateway' | 'browser' | 'application' | 'agentic';
1086
+ /**
1087
+ * Only records where type equals one of the provided values.
1088
+ */
1089
+ type__in?: Array<
1090
+ 'logging' | 'gateway' | 'browser' | 'application' | 'agentic'
1091
+ >;
1092
+ /**
1093
+ * Only records where key is equal to the value
1094
+ */
1095
+ key?: string;
1096
+ /**
1097
+ * Only records where key includes each substring.
1098
+ */
1099
+ key__contains?: Array<string>;
1100
+ /**
1101
+ * Only records where key equals one of the provided substrings.
1102
+ */
1103
+ key__in?: Array<string>;
1104
+ /**
1105
+ * Only records where name is equal to the value
1106
+ */
1107
+ name?: string;
1108
+ /**
1109
+ * Only records where name includes each substring.
1110
+ */
1111
+ name__contains?: Array<string>;
1112
+ /**
1113
+ * Only records where name equals one of the provided substrings.
1114
+ */
1115
+ name__in?: Array<string>;
1116
+ };
1117
+ /**
1118
+ * Reflected value from a previous response to obtain the next page of results.
1119
+ */
1120
+ last?: string;
1121
+ /**
1122
+ * Order results asc(ending) or desc(ending).
1123
+ */
1124
+ order?: 'asc' | 'desc';
1125
+ /**
1126
+ * Which field to order results by.
1127
+ */
1128
+ order_by?: 'key' | 'name' | 'type' | 'created_at' | 'updated_at';
1129
+ /**
1130
+ * Maximum results to include in the response.
1131
+ */
1132
+ size?: number;
1133
+ };
1134
+
1135
+ export type AidrPolicycollectionSearchResult = {
1136
+ collections?: Array<AidrPolicycollectionResult>;
1137
+ /**
1138
+ * Total number of policy collections
1139
+ */
1140
+ count?: number;
1141
+ /**
1142
+ * Pagination cursor
1143
+ */
1144
+ last?: string;
1145
+ };
1146
+
1147
+ /**
1148
+ * List or filter/search list records.
1149
+ */
1150
+ export type AidrCustomlistSearch = {
1151
+ filter?: {
1152
+ /**
1153
+ * Only records where created_at equals this value.
1154
+ */
1155
+ created_at?: string;
1156
+ /**
1157
+ * Only records where created_at is greater than this value.
1158
+ */
1159
+ created_at__gt?: string;
1160
+ /**
1161
+ * Only records where created_at is greater than or equal to this value.
1162
+ */
1163
+ created_at__gte?: string;
1164
+ /**
1165
+ * Only records where created_at is less than this value.
1166
+ */
1167
+ created_at__lt?: string;
1168
+ /**
1169
+ * Only records where created_at is less than or equal to this value.
1170
+ */
1171
+ created_at__lte?: string;
1172
+ /**
1173
+ * Only records where updated_at equals this value.
1174
+ */
1175
+ updated_at?: string;
1176
+ /**
1177
+ * Only records where updated_at is greater than this value.
1178
+ */
1179
+ updated_at__gt?: string;
1180
+ /**
1181
+ * Only records where updated_at is greater than or equal to this value.
1182
+ */
1183
+ updated_at__gte?: string;
1184
+ /**
1185
+ * Only records where updated_at is less than this value.
1186
+ */
1187
+ updated_at__lt?: string;
1188
+ /**
1189
+ * Only records where updated_at is less than or equal to this value.
1190
+ */
1191
+ updated_at__lte?: string;
1192
+ /**
1193
+ * Only records where type is equal to the value
1194
+ */
1195
+ type?: string;
1196
+ /**
1197
+ * Only records where name is equal to the value
1198
+ */
1199
+ name?: string;
1200
+ /**
1201
+ * Only records where name includes each substring.
1202
+ */
1203
+ name__contains?: Array<string>;
1204
+ /**
1205
+ * Only records where name equals one of the provided substrings.
1206
+ */
1207
+ name__in?: Array<string>;
1208
+ };
1209
+ /**
1210
+ * Reflected value from a previous response to obtain the next page of results.
1211
+ */
1212
+ last?: string;
1213
+ /**
1214
+ * Order results asc(ending) or desc(ending).
1215
+ */
1216
+ order?: 'asc' | 'desc';
1217
+ /**
1218
+ * Which field to order results by.
1219
+ */
1220
+ order_by?: 'id' | 'name' | 'created_at' | 'updated_at';
1221
+ /**
1222
+ * Maximum results to include in the response.
1223
+ */
1224
+ size?: number;
1225
+ };
1226
+
1227
+ export type AidrCustomlistSearchResult = {
1228
+ lists?: Array<AidrCustomlistResult>;
1229
+ /**
1230
+ * Total number of lists
1231
+ */
1232
+ count?: number;
1233
+ /**
1234
+ * Pagination cursor
1235
+ */
1236
+ last?: string;
1237
+ };
1238
+
1239
+ /**
1240
+ * AIDR Collector Summary list
1241
+ */
1242
+ export type AidrSensorInsights = {
1243
+ /**
1244
+ * set to get instance level data
1245
+ */
1246
+ is_instance_data?: boolean;
1247
+ /**
1248
+ * Optional filters of the form `<field>__contains` or `<field>__in`
1249
+ */
1250
+ filters?: {
1251
+ /**
1252
+ * Only records where id equals this value.
1253
+ */
1254
+ collector_id?: string;
1255
+ /**
1256
+ * Only records where id includes each substring.
1257
+ */
1258
+ collector_id__contains?: Array<string>;
1259
+ /**
1260
+ * Only records where id equals one of the provided substrings.
1261
+ */
1262
+ collector_id__in?: Array<string>;
1263
+ /**
1264
+ * Only records where instance id equals this value.
1265
+ */
1266
+ instance_id?: string;
1267
+ /**
1268
+ * Only records where id includes each substring.
1269
+ */
1270
+ instance_id__contains?: Array<string>;
1271
+ /**
1272
+ * Only records where id equals one of the provided substrings.
1273
+ */
1274
+ instance_id__in?: Array<string>;
1275
+ /**
1276
+ * Only records where sensor type equals this value.
1277
+ */
1278
+ collector_type?: string;
1279
+ /**
1280
+ * Only records where id includes each substring.
1281
+ */
1282
+ collector_type_contains?: Array<string>;
1283
+ /**
1284
+ * Only records where id equals one of the provided substrings.
1285
+ */
1286
+ collector_type__in?: Array<string>;
1287
+ };
1288
+ /**
1289
+ * field to sort by
1290
+ */
1291
+ order_by?: string;
1292
+ /**
1293
+ * Sort direction (default: asc)
1294
+ */
1295
+ order?: 'asc' | 'desc';
1296
+ /**
1297
+ * Pagination limit
1298
+ */
1299
+ count?: number;
1300
+ /**
1301
+ * Pagination last count
1302
+ */
1303
+ last?: string;
1304
+ };
1305
+
1306
+ /**
1307
+ * AIDR Collector Summary Result Data
1308
+ */
1309
+ export type AidrSensorInsightsResult = {
1310
+ /**
1311
+ * Pagination limit
1312
+ */
1313
+ count?: number;
1314
+ /**
1315
+ * Pagination last count
1316
+ */
1317
+ last?: string;
1318
+ items?: Array<AidrSensorInsightsItem>;
1319
+ };
1320
+
1321
+ /**
1322
+ * AIDR Collector Summary Result Data
1323
+ */
1324
+ export type AidrSensorInsightsItem = {
1325
+ /**
1326
+ * latest updated time
1327
+ */
1328
+ updated_at: string;
1329
+ /**
1330
+ * created time
1331
+ */
1332
+ created_at: string;
1333
+ /**
1334
+ * total event counts
1335
+ */
1336
+ count: number;
1337
+ collector_id: ServiceConfigId;
1338
+ /**
1339
+ * Collector instance id
1340
+ */
1341
+ instance_id?: string;
1342
+ /**
1343
+ * collector type
1344
+ */
1345
+ collector_type: string;
1346
+ };
1347
+
1348
+ /**
1349
+ * AIDR Service Config Settings
1350
+ */
1351
+ export type AidrServiceConfig = {
1352
+ id?: ServiceConfigId;
1353
+ name?: string;
1354
+ version?: string;
1355
+ metric_pool_rid?: AidrMetricpoolId;
1356
+ updated_at?: AidrTimestamp;
1357
+ collector_type?: string;
1358
+ /**
1359
+ * Collector type specific settings.
1360
+ */
1361
+ settings?: {
1362
+ [key: string]: unknown;
1363
+ };
1364
+ warning_threshold?: AidrGolangDuration;
1365
+ in_active_threshold?: AidrGolangDuration;
1366
+ [key: string]:
1367
+ | unknown
1368
+ | ServiceConfigId
1369
+ | string
1370
+ | AidrMetricpoolId
1371
+ | AidrTimestamp
1372
+ | {
1373
+ [key: string]: unknown;
1374
+ }
1375
+ | AidrGolangDuration
1376
+ | undefined;
1377
+ };
1378
+
1379
+ /**
1380
+ * Duration string (e.g., '100ms', '2h')
1381
+ */
1382
+ export type AidrGolangDuration = unknown | unknown;
1383
+
1384
+ /**
1385
+ * List or filter/config records.
1386
+ */
1387
+ export type AidrServiceConfigList = {
1388
+ filter?: {
1389
+ /**
1390
+ * Only records where name equals this value.
1391
+ */
1392
+ name?: string;
1393
+ /**
1394
+ * Only records where name includes each substring.
1395
+ */
1396
+ name__contains?: Array<string>;
1397
+ /**
1398
+ * Only records where name equals one of the provided substrings.
1399
+ */
1400
+ name__in?: Array<string>;
1401
+ /**
1402
+ * Only records where collector_type equals this value.
1403
+ */
1404
+ collector_type?: string;
1405
+ /**
1406
+ * Only records where collector_type includes each substring.
1407
+ */
1408
+ collector_type__contains?: Array<string>;
1409
+ /**
1410
+ * Only records where collector_type equals one of the provided substrings.
1411
+ */
1412
+ collector_type__in?: Array<string>;
1413
+ /**
1414
+ * Only records where id equals this value.
1415
+ */
1416
+ id?: string;
1417
+ /**
1418
+ * Only records where id includes each substring.
1419
+ */
1420
+ id__contains?: Array<string>;
1421
+ /**
1422
+ * Only records where id equals one of the provided substrings.
1423
+ */
1424
+ id__in?: Array<string>;
1425
+ /**
1426
+ * Only records where created_at equals this value.
1427
+ */
1428
+ created_at?: string;
1429
+ /**
1430
+ * Only records where created_at is greater than this value.
1431
+ */
1432
+ created_at__gt?: string;
1433
+ /**
1434
+ * Only records where created_at is greater than or equal to this value.
1435
+ */
1436
+ created_at__gte?: string;
1437
+ /**
1438
+ * Only records where created_at is less than this value.
1439
+ */
1440
+ created_at__lt?: string;
1441
+ /**
1442
+ * Only records where created_at is less than or equal to this value.
1443
+ */
1444
+ created_at__lte?: string;
1445
+ /**
1446
+ * Only records where updated_at equals this value.
1447
+ */
1448
+ updated_at?: string;
1449
+ /**
1450
+ * Only records where updated_at is greater than this value.
1451
+ */
1452
+ updated_at__gt?: string;
1453
+ /**
1454
+ * Only records where updated_at is greater than or equal to this value.
1455
+ */
1456
+ updated_at__gte?: string;
1457
+ /**
1458
+ * Only records where updated_at is less than this value.
1459
+ */
1460
+ updated_at__lt?: string;
1461
+ /**
1462
+ * Only records where updated_at is less than or equal to this value.
1463
+ */
1464
+ updated_at__lte?: string;
1465
+ };
1466
+ /**
1467
+ * Reflected value from a previous response to obtain the next page of results.
1468
+ */
1469
+ last?: string;
1470
+ /**
1471
+ * Order results asc(ending) or desc(ending).
1472
+ */
1473
+ order?: 'asc' | 'desc';
1474
+ /**
1475
+ * Which field to order results by.
1476
+ */
1477
+ order_by?: 'id' | 'created_at' | 'updated_at';
1478
+ /**
1479
+ * Maximum results to include in the response.
1480
+ */
1481
+ size?: number;
1482
+ };
1483
+
1484
+ /**
1485
+ * audit data activity configuration
1486
+ */
1487
+ export type AidrAuditDataActivity = {
1488
+ audit_config_id?: ServiceConfigId;
1489
+ enabled?: boolean;
1490
+ };
1491
+
1492
+ /**
1493
+ * A service config ID
1494
+ */
1495
+ export type AidrMetricpoolId = string;
1496
+
1497
+ export type AidrLog = {
1498
+ event: {
1499
+ [key: string]: unknown;
1500
+ };
1501
+ };
1502
+
1503
+ export type AidrLogs = {
1504
+ events: Array<{
1505
+ [key: string]: unknown;
1506
+ }>;
1507
+ };
1508
+
1509
+ /**
1510
+ * An empty object
1511
+ */
1512
+ export type AidrEmpty = {
1513
+ [key: string]: never;
1514
+ };
1515
+
1516
+ /**
1517
+ * Collector health endpoint object
1518
+ */
1519
+ export type AidrSensorHealth = {
1520
+ collector_instance_id: string;
1521
+ };
1522
+
1523
+ /**
1524
+ * A service config ID
1525
+ */
1526
+ export type ServiceConfigId = string;
1527
+
1528
+ /**
1529
+ * A filter ID
1530
+ */
1531
+ export type FilterId = string;
1532
+
1533
+ /**
1534
+ * A Policy ID
1535
+ */
1536
+ export type PolicyId = string;
1537
+
1538
+ export type AidrServiceConfigResult = AidrServiceConfig;
1539
+
1540
+ /**
1541
+ * A time in ISO-8601 format
1542
+ */
1543
+ export type AidrTimestamp = string;
1544
+
1545
+ /**
1546
+ * A time in ISO-8601 format or null
1547
+ */
1548
+ export type AirdTimestampNullable = AuthnTimestamp | null;
1549
+
1550
+ /**
1551
+ * Define field name and path mapping to extract from the log
1552
+ */
1553
+ export type AidrResourceFieldMapping = {
1554
+ [key: string]: {
1555
+ path: string;
1556
+ type: 'string' | 'int' | 'bool';
1557
+ disabled?: boolean;
1558
+ };
1559
+ };
1560
+
1561
+ /**
1562
+ * AIDR metric pool settings
1563
+ */
1564
+ export type AidrMetricpoolResource = {
1565
+ id?: AidrMetricpoolId;
1566
+ updated_at?: AidrTimestamp;
1567
+ field_mappings?: AidrResourceFieldMapping;
1568
+ };
1569
+
1570
+ export type AidrOtelResourceLogs = {
1571
+ resource?: AidrOtelResource;
1572
+ scopeLogs: Array<AidrOtelScopeLogs>;
1573
+ [key: string]:
1574
+ | unknown
1575
+ | AidrOtelResource
1576
+ | Array<AidrOtelScopeLogs>
1577
+ | undefined;
1578
+ };
1579
+
1580
+ export type AidrOtelResource = {
1581
+ attributes?: Array<AidrOtelKeyValue>;
1582
+ [key: string]: unknown | Array<AidrOtelKeyValue> | undefined;
1583
+ };
1584
+
1585
+ export type AidrOtelScopeLogs = {
1586
+ scope?: AidrOtelInstrumentationScope;
1587
+ logRecords: Array<AidrOtelLogRecord>;
1588
+ [key: string]:
1589
+ | unknown
1590
+ | AidrOtelInstrumentationScope
1591
+ | Array<AidrOtelLogRecord>
1592
+ | undefined;
1593
+ };
1594
+
1595
+ export type AidrOtelInstrumentationScope = {
1596
+ name?: string;
1597
+ version?: string;
1598
+ [key: string]: unknown | string | undefined;
1599
+ };
1600
+
1601
+ export type AidrOtelLogRecord = {
1602
+ timeUnixNano?: string;
1603
+ observedTimeUnixNano?: string;
1604
+ severityNumber?: number;
1605
+ severityText?: string;
1606
+ name?: string;
1607
+ body: AidrOtelAnyValue;
1608
+ attributes?: Array<AidrOtelKeyValue>;
1609
+ flags?: number;
1610
+ traceId?: string;
1611
+ spanId?: string;
1612
+ traceFlags?: string;
1613
+ [key: string]:
1614
+ | unknown
1615
+ | string
1616
+ | number
1617
+ | string
1618
+ | AidrOtelAnyValue
1619
+ | Array<AidrOtelKeyValue>
1620
+ | undefined;
1621
+ };
1622
+
1623
+ export type AidrOtelKeyValue = {
1624
+ key: string;
1625
+ value: AidrOtelAnyValue;
1626
+ [key: string]: unknown | string | AidrOtelAnyValue;
1627
+ };
1628
+
1629
+ export type AidrOtelAnyValue =
1630
+ | {
1631
+ stringValue: string;
1632
+ }
1633
+ | {
1634
+ boolValue: boolean | 'true' | 'false' | 'True' | 'False';
1635
+ }
1636
+ | {
1637
+ intValue: number | string;
1638
+ }
1639
+ | {
1640
+ doubleValue: number | string;
1641
+ }
1642
+ | {
1643
+ arrayValue: AidrOtelArrayValue;
1644
+ }
1645
+ | {
1646
+ kvlistValue: AidrOtelKeyValueList;
1647
+ }
1648
+ | {
1649
+ bytesValue: string;
1650
+ };
1651
+
1652
+ export type AidrOtelArrayValue = {
1653
+ values: Array<AidrOtelAnyValue>;
1654
+ [key: string]: unknown | Array<AidrOtelAnyValue>;
1655
+ };
1656
+
1657
+ export type AidrOtelKeyValueList = {
1658
+ values: Array<AidrOtelKeyValue>;
1659
+ [key: string]: unknown | Array<AidrOtelKeyValue>;
1660
+ };
1661
+
1662
+ /**
1663
+ * AIDR Search Request
1664
+ */
1665
+ export type AidrMetric = {
1666
+ /**
1667
+ * start of the query window
1668
+ */
1669
+ start_time: string;
1670
+ /**
1671
+ * end of the query window, if not specified then current time is used as end_time
1672
+ */
1673
+ end_time?: string;
1674
+ /**
1675
+ * Bucket size for time‐series aggregation
1676
+ */
1677
+ interval?: 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly';
1678
+ /**
1679
+ * Optional filters for the field. For example `<field>__gte` or `<field>__lt`
1680
+ */
1681
+ filters?: {
1682
+ [key: string]: number | number | boolean | number | boolean;
1683
+ };
1684
+ /**
1685
+ * Optional tag filters of the tag fields. For example `<field>__contains` or `<field>__in`
1686
+ */
1687
+ tag_filters?: {
1688
+ [key: string]: Array<string>;
1689
+ };
1690
+ /**
1691
+ * Per-detector filters. Use '<key>__exists' for key existence, or '<key>.(count|detected_count)__{op}' for numeric comparisons.
1692
+ */
1693
+ detector_filters?: {
1694
+ [key: string]: number | boolean;
1695
+ };
1696
+ /**
1697
+ * Optional list of tag keys to group by (for bar‑chart or Sankey)
1698
+ */
1699
+ group_by?: Array<string>;
1700
+ /**
1701
+ * field to sort by
1702
+ */
1703
+ order_by?: string;
1704
+ /**
1705
+ * Sort direction (default: asc)
1706
+ */
1707
+ order?: 'asc' | 'desc';
1708
+ limit?: number;
1709
+ offset?: number;
1710
+ };
1711
+
1712
+ /**
1713
+ * AIDR Aggregate Search Request
1714
+ */
1715
+ export type AidrMetricAggregatesSearchParams = {
1716
+ /**
1717
+ * start of the query window
1718
+ */
1719
+ start_time: string;
1720
+ /**
1721
+ * end of the query window, if not specified then current time is used as end_time
1722
+ */
1723
+ end_time?: string;
1724
+ /**
1725
+ * Bucket size for time‐series aggregation
1726
+ */
1727
+ interval?: 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly';
1728
+ /**
1729
+ * list of tag keys to aggregate
1730
+ */
1731
+ aggregate_fields?: Array<string>;
1732
+ /**
1733
+ * Optional filters for the field. For example `<field>__gte` or `<field>__lt`
1734
+ */
1735
+ filters?: {
1736
+ [key: string]: number | number | boolean | number | boolean;
1737
+ };
1738
+ /**
1739
+ * Per-detector filters. Use '<key>__exists' for key existence, or '<key>.(count|detected_count)__{op}' for numeric comparisons.
1740
+ */
1741
+ detector_filters?: {
1742
+ [key: string]: number | boolean;
1743
+ };
1744
+ /**
1745
+ * Optional tag filters of the tag fields. For example `<field>__contains` or `<field>__in`
1746
+ */
1747
+ tag_filters?: {
1748
+ [key: string]: Array<string>;
1749
+ };
1750
+ /**
1751
+ * Optional list of tag keys to group by (for bar‑chart or Sankey)
1752
+ */
1753
+ group_by?: Array<string>;
1754
+ /**
1755
+ * field to sort by
1756
+ */
1757
+ order_by?: string;
1758
+ /**
1759
+ * Sort direction (default: asc)
1760
+ */
1761
+ order?: 'asc' | 'desc';
1762
+ limit?: number;
1763
+ offset?: number;
1764
+ };
1765
+
1766
+ /**
1767
+ * AIDR Metric Search Result Data
1768
+ */
1769
+ export type AidrMetricResult = {
1770
+ items?: Array<AidrMetricItem>;
1771
+ };
1772
+
1773
+ /**
1774
+ * AIDR Metric Search Aggregate Result Data
1775
+ */
1776
+ export type AidrMetricAggregatesResult = {
1777
+ items?: Array<AidrMetricAggregateItem>;
1778
+ };
1779
+
1780
+ export type AidrMetricAggregateItem = Array<{
1781
+ /**
1782
+ * Bucketed time or null.
1783
+ */
1784
+ bucket_time?: string | null;
1785
+ /**
1786
+ * Map of tag keys to unique count.
1787
+ */
1788
+ counts: {
1789
+ [key: string]: number;
1790
+ };
1791
+ }>;
1792
+
1793
+ export type AidrMetricItem = Array<{
1794
+ /**
1795
+ * Bucketed time or null.
1796
+ */
1797
+ bucket_time?: string | null;
1798
+ /**
1799
+ * Map of tag keys to values.
1800
+ */
1801
+ tags?: {
1802
+ [key: string]: string;
1803
+ };
1804
+ count: number;
1805
+ detectors_count: number;
1806
+ is_blocked: boolean;
1807
+ request_token_count: number;
1808
+ response_token_count: number;
1809
+ detectors: AidrMetricResultDetectorItem;
1810
+ }>;
1811
+
1812
+ export type AidrMetricResultDetectorItem = {
1813
+ [key: string]:
1814
+ | unknown
1815
+ | {
1816
+ /**
1817
+ * Total occurrences for this detector key.
1818
+ */
1819
+ count: number;
1820
+ /**
1821
+ * Occurrences that were flagged/detected.
1822
+ */
1823
+ detected_count: number;
1824
+ };
1825
+ };
1826
+
1827
+ /**
1828
+ * A time in ISO-8601 format
1829
+ */
1830
+ export type AuthnTimestamp = string;
1831
+
1832
+ /**
1833
+ * Details about the evaluation of a single rule, including whether it matched, the action to take, the rule name, and optional debugging information.
1834
+ */
1835
+ export type AccessRuleResult = {
1836
+ /**
1837
+ * Whether this rule's logic evaluated to true for the input.
1838
+ */
1839
+ matched: boolean;
1840
+ /**
1841
+ * The action resulting from the rule evaluation. One of 'allowed', 'blocked', or 'reported'.
1842
+ */
1843
+ action: string;
1844
+ /**
1845
+ * A human-readable name for the rule.
1846
+ */
1847
+ name: string;
1848
+ /**
1849
+ * The JSON logic expression evaluated for this rule.
1850
+ */
1851
+ logic?: {
1852
+ [key: string]: unknown;
1853
+ };
1854
+ /**
1855
+ * The input attribute values that were available during rule evaluation.
1856
+ */
1857
+ attributes?: {
1858
+ [key: string]: unknown;
1859
+ };
1860
+ };
1861
+
1862
+ /**
1863
+ * Defines an AI Guard recipe - a named configuration of detectors and redaction settings used to analyze and protect data flows in AI-powered applications.
1864
+ *
1865
+ * Recipes specify which detectors are active, how they behave, and may include reusable settings such as FPE tweaks.
1866
+ *
1867
+ * For details, see the [AI Guard Recipes](https://pangea.cloud/docs/ai-guard/recipes) documentation.
1868
+ */
1869
+ export type RecipeConfig = {
1870
+ /**
1871
+ * Human-readable name of the recipe
1872
+ */
1873
+ name: string;
1874
+ /**
1875
+ * Detailed description of the recipe's purpose or use case
1876
+ */
1877
+ description: string;
1878
+ /**
1879
+ * Optional version identifier for the recipe. Can be used to track changes.
1880
+ */
1881
+ version?: string;
1882
+ /**
1883
+ * Settings for [AI Guard Detectors](https://pangea.cloud/docs/ai-guard/recipes#detectors), including which detectors to enable and how they behave
1884
+ */
1885
+ detectors?: DetectorSettings;
1886
+ /**
1887
+ * Configuration for access rules used in an AI Guard recipe.
1888
+ */
1889
+ access_rules?: Array<AccessRuleSettings>;
1890
+ /**
1891
+ * Connector-level Redact configuration. These settings allow you to define reusable redaction parameters, such as FPE tweak value.
1892
+ */
1893
+ connector_settings?: {
1894
+ /**
1895
+ * Settings for Redact integration at the recipe level
1896
+ */
1897
+ redact?: {
1898
+ /**
1899
+ * 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.
1900
+ */
1901
+ fpe_tweak_vault_secret_id?: string;
1902
+ };
1903
+ };
1904
+ };
1905
+
1906
+ /**
1907
+ * 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.
1908
+ */
1909
+ export type DetectorSettings = Array<{
1910
+ /**
1911
+ * Identifier of the detector to apply, such as `prompt_injection`, `pii_entity`, or `malicious_entity`
1912
+ */
1913
+ detector_name: string;
1914
+ /**
1915
+ * Specifies whether the detector is enabled or disabled in this configuration
1916
+ */
1917
+ state: 'disabled' | 'enabled';
1918
+ /**
1919
+ * Detector-specific settings
1920
+ */
1921
+ settings: {
1922
+ /**
1923
+ * List of detection and redaction rules applied by this detector
1924
+ */
1925
+ rules?: Array<{
1926
+ /**
1927
+ * Identifier of the redaction rule to apply. This should match a rule defined in the [Redact service](https://pangea.cloud/docs/redact/using-redact/using-redact).
1928
+ */
1929
+ redact_rule_id: string;
1930
+ redaction: RuleRedactionConfig;
1931
+ /**
1932
+ * If `true`, indicates that further processing should be stopped when this rule is triggered
1933
+ */
1934
+ block?: boolean;
1935
+ /**
1936
+ * If `true`, disables this specific rule even if the detector is enabled
1937
+ */
1938
+ disabled?: boolean;
1939
+ /**
1940
+ * If `true`, performs a reputation check using the configured intel provider. Applies to the Malicious Entity detector when using IP, URL, or Domain Intel services.
1941
+ */
1942
+ reputation_check?: boolean;
1943
+ /**
1944
+ * If `true`, applies redaction or transformation when the detected value is determined to be malicious by intel analysis
1945
+ */
1946
+ transform_if_malicious?: boolean;
1947
+ }>;
1948
+ };
1949
+ }>;
1950
+
1951
+ export type RuleRedactionConfig = (
1952
+ | {
1953
+ redaction_type?: 'mask' | 'detect_only';
1954
+ }
1955
+ | {
1956
+ redaction_type?: 'replacement';
1957
+ }
1958
+ | {
1959
+ redaction_type?: 'partial_masking';
1960
+ }
1961
+ | {
1962
+ redaction_type?: 'hash';
1963
+ }
1964
+ | {
1965
+ redaction_type?: 'fpe';
1966
+ }
1967
+ ) & {
1968
+ /**
1969
+ * Redaction method to apply for this rule
1970
+ */
1971
+ redaction_type:
1972
+ | 'mask'
1973
+ | 'partial_masking'
1974
+ | 'replacement'
1975
+ | 'hash'
1976
+ | 'detect_only'
1977
+ | 'fpe';
1978
+ /**
1979
+ * Replacement string to use when `redaction_type` is `replacement`
1980
+ */
1981
+ redaction_value?: string;
1982
+ /**
1983
+ * Parameters to control how text is masked when `redaction_type` is `partial_masking`
1984
+ */
1985
+ partial_masking?: {
1986
+ /**
1987
+ * Defines the masking strategy. Use `unmask` to specify how many characters to keep visible. Use `mask` to specify how many to hide.
1988
+ */
1989
+ masking_type?: 'unmask' | 'mask';
1990
+ /**
1991
+ * Number of leading characters to leave unmasked when `masking_type` is `unmask`
1992
+ */
1993
+ unmasked_from_left?: number;
1994
+ /**
1995
+ * Number of trailing characters to leave unmasked when `masking_type` is `unmask`
1996
+ */
1997
+ unmasked_from_right?: number;
1998
+ /**
1999
+ * Number of leading characters to mask when `masking_type` is `mask`
2000
+ */
2001
+ masked_from_left?: number;
2002
+ /**
2003
+ * Number of trailing characters to mask when `masking_type` is `mask`
2004
+ */
2005
+ masked_from_right?: number;
2006
+ /**
2007
+ * List of characters that should not be masked (for example, hyphens or periods)
2008
+ */
2009
+ chars_to_ignore?: Array<string>;
2010
+ /**
2011
+ * Character to use when masking text
2012
+ */
2013
+ masking_char?: string;
2014
+ };
2015
+ /**
2016
+ * Hash configuration when `redaction_type` is `hash`
2017
+ */
2018
+ hash?: {
2019
+ /**
2020
+ * Hashing algorithm to use for redaction
2021
+ */
2022
+ hash_type: 'md5' | 'sha256';
2023
+ } | null;
2024
+ /**
2025
+ * Alphabet used for Format-Preserving Encryption (FPE). Determines the character set for encryption.
2026
+ */
2027
+ fpe_alphabet?:
2028
+ | 'numeric'
2029
+ | 'alphalower'
2030
+ | 'alphaupper'
2031
+ | 'alpha'
2032
+ | 'alphanumericlower'
2033
+ | 'alphanumericupper'
2034
+ | 'alphanumeric'
2035
+ | null;
2036
+ };
2037
+
2038
+ /**
2039
+ * 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.
2040
+ */
2041
+ export type AccessRuleSettings = {
2042
+ /**
2043
+ * Unique identifier for this rule. Should be user-readable and consistent across recipe updates.
2044
+ */
2045
+ rule_key: string;
2046
+ /**
2047
+ * Display label for the rule shown in user interfaces.
2048
+ */
2049
+ name: string;
2050
+ /**
2051
+ * Action to apply if the rule matches. Use 'block' to stop further processing or 'report' to simply log the match.
2052
+ */
2053
+ state: 'block' | 'report';
2054
+ /**
2055
+ * JSON Logic condition that determines whether this rule matches.
2056
+ */
2057
+ logic: {
2058
+ [key: string]: unknown;
2059
+ };
2060
+ };
2061
+
2062
+ export type LanguageResult = {
2063
+ /**
2064
+ * The action taken by this Detector
2065
+ */
2066
+ action?: string;
2067
+ language?: string;
2068
+ };
2069
+
2070
+ export type RedactEntityResult = {
2071
+ /**
2072
+ * Detected redaction rules.
2073
+ */
2074
+ entities?: Array<{
2075
+ /**
2076
+ * The action taken on this Entity
2077
+ */
2078
+ action: string;
2079
+ type: string;
2080
+ value: string;
2081
+ redacted: boolean;
2082
+ start_pos?: number;
2083
+ }>;
2084
+ };
2085
+
2086
+ export type MaliciousEntityAction = 'report' | 'defang' | 'disabled' | 'block';
2087
+
2088
+ export type PiiEntityAction =
2089
+ | 'disabled'
2090
+ | 'report'
2091
+ | 'block'
2092
+ | 'mask'
2093
+ | 'partial_masking'
2094
+ | 'replacement'
2095
+ | 'hash'
2096
+ | 'fpe';
2097
+
2098
+ export type AidrPostV1GuardChatCompletionsData = {
2099
+ body?: ChatCompletionsGuard;
2100
+ path?: never;
2101
+ query?: never;
2102
+ url: '/v1/guard_chat_completions';
2103
+ };
2104
+
2105
+ export type AidrPostV1GuardChatCompletionsErrors = {
2106
+ /**
2107
+ * Validation errors
2108
+ */
2109
+ 400: PangeaResponse & PangeaValidationErrors;
2110
+ };
2111
+
2112
+ export type AidrPostV1GuardChatCompletionsError =
2113
+ AidrPostV1GuardChatCompletionsErrors[keyof AidrPostV1GuardChatCompletionsErrors];
2114
+
2115
+ export type AidrPostV1GuardChatCompletionsResponses = {
2116
+ /**
2117
+ * No description provided
2118
+ */
2119
+ 200: PangeaResponse & {
2120
+ result?: {
2121
+ /**
2122
+ * Updated structured prompt.
2123
+ */
2124
+ guard_output?: {
2125
+ [key: string]: unknown;
2126
+ };
2127
+ /**
2128
+ * Whether or not the prompt triggered a block detection.
2129
+ */
2130
+ blocked?: boolean;
2131
+ /**
2132
+ * Whether or not the original input was transformed.
2133
+ */
2134
+ transformed?: boolean;
2135
+ /**
2136
+ * The Policy that was used.
2137
+ */
2138
+ policy?: string;
2139
+ /**
2140
+ * Result of the policy analyzing and input prompt.
2141
+ */
2142
+ detectors: {
2143
+ malicious_prompt?: {
2144
+ /**
2145
+ * Whether or not the Malicious Prompt was detected.
2146
+ */
2147
+ detected?: boolean;
2148
+ /**
2149
+ * Details about the analyzers.
2150
+ */
2151
+ data?: AidrPromptInjectionResult;
2152
+ };
2153
+ confidential_and_pii_entity?: {
2154
+ /**
2155
+ * Whether or not the PII Entities were detected.
2156
+ */
2157
+ detected?: boolean;
2158
+ /**
2159
+ * Details about the detected entities.
2160
+ */
2161
+ data?: AidrRedactEntityResult;
2162
+ };
2163
+ malicious_entity?: {
2164
+ /**
2165
+ * Whether or not the Malicious Entities were detected.
2166
+ */
2167
+ detected?: boolean;
2168
+ /**
2169
+ * Details about the detected entities.
2170
+ */
2171
+ data?: AidrMaliciousEntityResult;
2172
+ };
2173
+ custom_entity?: {
2174
+ /**
2175
+ * Whether or not the Custom Entities were detected.
2176
+ */
2177
+ detected?: boolean;
2178
+ /**
2179
+ * Details about the detected entities.
2180
+ */
2181
+ data?: AidrRedactEntityResult;
2182
+ };
2183
+ secret_and_key_entity?: {
2184
+ /**
2185
+ * Whether or not the Secret Entities were detected.
2186
+ */
2187
+ detected?: boolean;
2188
+ /**
2189
+ * Details about the detected entities.
2190
+ */
2191
+ data?: AidrRedactEntityResult;
2192
+ };
2193
+ competitors?: {
2194
+ /**
2195
+ * Whether or not the Competitors were detected.
2196
+ */
2197
+ detected?: boolean;
2198
+ /**
2199
+ * Details about the detected entities.
2200
+ */
2201
+ data?: AidrSingleEntityResult;
2202
+ };
2203
+ language?: {
2204
+ /**
2205
+ * Whether or not the Languages were detected.
2206
+ */
2207
+ detected?: boolean;
2208
+ /**
2209
+ * Details about the detected languages.
2210
+ */
2211
+ data?: AidrLanguageResult;
2212
+ };
2213
+ topic?: {
2214
+ /**
2215
+ * Whether or not the Topics were detected.
2216
+ */
2217
+ detected?: boolean;
2218
+ /**
2219
+ * Details about the detected topics.
2220
+ */
2221
+ data?: AidrTopicResult;
2222
+ };
2223
+ code?: {
2224
+ /**
2225
+ * Whether or not the Code was detected.
2226
+ */
2227
+ detected?: boolean;
2228
+ /**
2229
+ * Details about the detected code.
2230
+ */
2231
+ data?: AidrLanguageResult;
2232
+ };
2233
+ };
2234
+ access_rules?: AidrAccessRulesResponse;
2235
+ /**
2236
+ * If an FPE redaction method returned results, this will be the context passed to unredact.
2237
+ */
2238
+ fpe_context?: string;
2239
+ };
2240
+ };
2241
+ };
2242
+
2243
+ export type AidrPostV1GuardChatCompletionsResponse =
2244
+ AidrPostV1GuardChatCompletionsResponses[keyof AidrPostV1GuardChatCompletionsResponses];
2245
+
2246
+ export type GetAsyncRequestData = {
2247
+ body?: never;
2248
+ path: {
2249
+ /**
2250
+ * The request ID to poll
2251
+ */
2252
+ requestId: string;
2253
+ };
2254
+ query?: never;
2255
+ url: '/request/{requestId}';
2256
+ };
2257
+
2258
+ export type GetAsyncRequestResponses = {
2259
+ /**
2260
+ * Response
2261
+ */
2262
+ 200: PangeaResponse;
2263
+ /**
2264
+ * Asynchronous request in progress
2265
+ */
2266
+ 202: PangeaResponse & {
2267
+ result?: {
2268
+ ttl_mins?: number;
2269
+ retry_counter?: number;
2270
+ location?: string;
2271
+ };
2272
+ };
2273
+ };
2274
+
2275
+ export type GetAsyncRequestResponse =
2276
+ GetAsyncRequestResponses[keyof GetAsyncRequestResponses];