hiddenlayer-sdk 2.0.10__py3-none-any.whl → 3.0.0__py3-none-any.whl

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 (204) hide show
  1. hiddenlayer/__init__.py +109 -114
  2. hiddenlayer/_base_client.py +1995 -0
  3. hiddenlayer/_client.py +761 -0
  4. hiddenlayer/_compat.py +219 -0
  5. hiddenlayer/_constants.py +14 -0
  6. hiddenlayer/_exceptions.py +108 -0
  7. hiddenlayer/_files.py +123 -0
  8. hiddenlayer/_models.py +835 -0
  9. hiddenlayer/_oauth2.py +118 -0
  10. hiddenlayer/_qs.py +150 -0
  11. hiddenlayer/_resource.py +43 -0
  12. hiddenlayer/_response.py +832 -0
  13. hiddenlayer/_streaming.py +333 -0
  14. hiddenlayer/_types.py +260 -0
  15. hiddenlayer/_utils/__init__.py +64 -0
  16. hiddenlayer/_utils/_compat.py +45 -0
  17. hiddenlayer/_utils/_datetime_parse.py +136 -0
  18. hiddenlayer/_utils/_logs.py +25 -0
  19. hiddenlayer/_utils/_proxy.py +65 -0
  20. hiddenlayer/_utils/_reflection.py +42 -0
  21. hiddenlayer/_utils/_resources_proxy.py +24 -0
  22. hiddenlayer/_utils/_streams.py +12 -0
  23. hiddenlayer/_utils/_sync.py +86 -0
  24. hiddenlayer/_utils/_transform.py +457 -0
  25. hiddenlayer/_utils/_typing.py +156 -0
  26. hiddenlayer/_utils/_utils.py +421 -0
  27. hiddenlayer/_version.py +4 -0
  28. hiddenlayer/lib/.keep +4 -0
  29. hiddenlayer/lib/__init__.py +6 -0
  30. hiddenlayer/lib/community_scan.py +174 -0
  31. hiddenlayer/lib/model_scan.py +752 -0
  32. hiddenlayer/lib/scan_utils.py +142 -0
  33. hiddenlayer/pagination.py +127 -0
  34. hiddenlayer/resources/__init__.py +75 -0
  35. hiddenlayer/resources/interactions.py +205 -0
  36. hiddenlayer/resources/models/__init__.py +33 -0
  37. hiddenlayer/resources/models/cards.py +259 -0
  38. hiddenlayer/resources/models/models.py +284 -0
  39. hiddenlayer/resources/prompt_analyzer.py +207 -0
  40. hiddenlayer/resources/scans/__init__.py +61 -0
  41. hiddenlayer/resources/scans/jobs.py +499 -0
  42. hiddenlayer/resources/scans/results.py +169 -0
  43. hiddenlayer/resources/scans/scans.py +166 -0
  44. hiddenlayer/resources/scans/upload/__init__.py +33 -0
  45. hiddenlayer/resources/scans/upload/file.py +279 -0
  46. hiddenlayer/resources/scans/upload/upload.py +340 -0
  47. hiddenlayer/resources/sensors.py +575 -0
  48. hiddenlayer/types/__init__.py +16 -0
  49. hiddenlayer/types/interaction_analyze_params.py +62 -0
  50. hiddenlayer/types/interaction_analyze_response.py +199 -0
  51. hiddenlayer/types/model_retrieve_response.py +50 -0
  52. hiddenlayer/types/models/__init__.py +6 -0
  53. hiddenlayer/types/models/card_list_params.py +65 -0
  54. hiddenlayer/types/models/card_list_response.py +50 -0
  55. hiddenlayer/types/prompt_analyzer_create_params.py +23 -0
  56. hiddenlayer/types/prompt_analyzer_create_response.py +381 -0
  57. hiddenlayer/types/scans/__init__.py +14 -0
  58. hiddenlayer/types/scans/job_list_params.py +75 -0
  59. hiddenlayer/types/scans/job_list_response.py +22 -0
  60. hiddenlayer/types/scans/job_request_params.py +49 -0
  61. hiddenlayer/types/scans/job_retrieve_params.py +16 -0
  62. hiddenlayer/types/scans/result_sarif_response.py +7 -0
  63. hiddenlayer/types/scans/scan_job.py +46 -0
  64. hiddenlayer/types/scans/scan_report.py +367 -0
  65. hiddenlayer/types/scans/upload/__init__.py +6 -0
  66. hiddenlayer/types/scans/upload/file_add_response.py +24 -0
  67. hiddenlayer/types/scans/upload/file_complete_response.py +12 -0
  68. hiddenlayer/types/scans/upload_complete_all_response.py +12 -0
  69. hiddenlayer/types/scans/upload_start_params.py +34 -0
  70. hiddenlayer/types/scans/upload_start_response.py +12 -0
  71. hiddenlayer/types/sensor_create_params.py +24 -0
  72. hiddenlayer/types/sensor_create_response.py +33 -0
  73. hiddenlayer/types/sensor_query_params.py +39 -0
  74. hiddenlayer/types/sensor_query_response.py +43 -0
  75. hiddenlayer/types/sensor_retrieve_response.py +33 -0
  76. hiddenlayer/types/sensor_update_params.py +20 -0
  77. hiddenlayer/types/sensor_update_response.py +9 -0
  78. hiddenlayer_sdk-3.0.0.dist-info/METADATA +431 -0
  79. hiddenlayer_sdk-3.0.0.dist-info/RECORD +82 -0
  80. {hiddenlayer_sdk-2.0.10.dist-info → hiddenlayer_sdk-3.0.0.dist-info}/WHEEL +1 -2
  81. {hiddenlayer_sdk-2.0.10.dist-info → hiddenlayer_sdk-3.0.0.dist-info}/licenses/LICENSE +1 -1
  82. hiddenlayer/sdk/constants.py +0 -26
  83. hiddenlayer/sdk/exceptions.py +0 -12
  84. hiddenlayer/sdk/models.py +0 -58
  85. hiddenlayer/sdk/rest/__init__.py +0 -135
  86. hiddenlayer/sdk/rest/api/__init__.py +0 -10
  87. hiddenlayer/sdk/rest/api/aidr_predictive_api.py +0 -308
  88. hiddenlayer/sdk/rest/api/health_api.py +0 -272
  89. hiddenlayer/sdk/rest/api/model_api.py +0 -559
  90. hiddenlayer/sdk/rest/api/model_supply_chain_api.py +0 -4063
  91. hiddenlayer/sdk/rest/api/readiness_api.py +0 -272
  92. hiddenlayer/sdk/rest/api/sensor_api.py +0 -1432
  93. hiddenlayer/sdk/rest/api_client.py +0 -770
  94. hiddenlayer/sdk/rest/api_response.py +0 -21
  95. hiddenlayer/sdk/rest/configuration.py +0 -445
  96. hiddenlayer/sdk/rest/exceptions.py +0 -199
  97. hiddenlayer/sdk/rest/models/__init__.py +0 -113
  98. hiddenlayer/sdk/rest/models/address.py +0 -110
  99. hiddenlayer/sdk/rest/models/artifact.py +0 -155
  100. hiddenlayer/sdk/rest/models/artifact_change.py +0 -108
  101. hiddenlayer/sdk/rest/models/artifact_content.py +0 -101
  102. hiddenlayer/sdk/rest/models/artifact_location.py +0 -109
  103. hiddenlayer/sdk/rest/models/attachment.py +0 -129
  104. hiddenlayer/sdk/rest/models/begin_multi_file_upload200_response.py +0 -87
  105. hiddenlayer/sdk/rest/models/begin_multipart_file_upload200_response.py +0 -97
  106. hiddenlayer/sdk/rest/models/begin_multipart_file_upload200_response_parts_inner.py +0 -94
  107. hiddenlayer/sdk/rest/models/code_flow.py +0 -113
  108. hiddenlayer/sdk/rest/models/configuration_override.py +0 -108
  109. hiddenlayer/sdk/rest/models/conversion.py +0 -114
  110. hiddenlayer/sdk/rest/models/create_sensor_request.py +0 -95
  111. hiddenlayer/sdk/rest/models/edge.py +0 -108
  112. hiddenlayer/sdk/rest/models/edge_traversal.py +0 -122
  113. hiddenlayer/sdk/rest/models/errors_inner.py +0 -91
  114. hiddenlayer/sdk/rest/models/exception.py +0 -113
  115. hiddenlayer/sdk/rest/models/external_properties.py +0 -273
  116. hiddenlayer/sdk/rest/models/external_property_file_reference.py +0 -102
  117. hiddenlayer/sdk/rest/models/external_property_file_references.py +0 -240
  118. hiddenlayer/sdk/rest/models/file_details_v3.py +0 -139
  119. hiddenlayer/sdk/rest/models/file_result_v3.py +0 -117
  120. hiddenlayer/sdk/rest/models/file_scan_report_v3.py +0 -132
  121. hiddenlayer/sdk/rest/models/file_scan_reports_v3.py +0 -95
  122. hiddenlayer/sdk/rest/models/fix.py +0 -113
  123. hiddenlayer/sdk/rest/models/get_condensed_model_scan_reports200_response.py +0 -102
  124. hiddenlayer/sdk/rest/models/graph.py +0 -123
  125. hiddenlayer/sdk/rest/models/graph_traversal.py +0 -97
  126. hiddenlayer/sdk/rest/models/inventory_v3.py +0 -101
  127. hiddenlayer/sdk/rest/models/invocation.py +0 -199
  128. hiddenlayer/sdk/rest/models/location.py +0 -146
  129. hiddenlayer/sdk/rest/models/location_inner.py +0 -138
  130. hiddenlayer/sdk/rest/models/location_relationship.py +0 -107
  131. hiddenlayer/sdk/rest/models/logical_location.py +0 -104
  132. hiddenlayer/sdk/rest/models/message.py +0 -92
  133. hiddenlayer/sdk/rest/models/mitre_atlas_inner.py +0 -110
  134. hiddenlayer/sdk/rest/models/model.py +0 -103
  135. hiddenlayer/sdk/rest/models/model_inventory_info.py +0 -103
  136. hiddenlayer/sdk/rest/models/model_version.py +0 -97
  137. hiddenlayer/sdk/rest/models/multi_file_upload_request_v3.py +0 -97
  138. hiddenlayer/sdk/rest/models/multiformat_message_string.py +0 -95
  139. hiddenlayer/sdk/rest/models/node.py +0 -122
  140. hiddenlayer/sdk/rest/models/notification.py +0 -157
  141. hiddenlayer/sdk/rest/models/notify_model_scan_completed200_response.py +0 -87
  142. hiddenlayer/sdk/rest/models/paged_response_with_total.py +0 -94
  143. hiddenlayer/sdk/rest/models/pagination_v3.py +0 -95
  144. hiddenlayer/sdk/rest/models/physical_location.py +0 -94
  145. hiddenlayer/sdk/rest/models/problem_details.py +0 -103
  146. hiddenlayer/sdk/rest/models/property_bag.py +0 -101
  147. hiddenlayer/sdk/rest/models/rectangle.py +0 -110
  148. hiddenlayer/sdk/rest/models/region.py +0 -127
  149. hiddenlayer/sdk/rest/models/replacement.py +0 -103
  150. hiddenlayer/sdk/rest/models/reporting_configuration.py +0 -113
  151. hiddenlayer/sdk/rest/models/reporting_descriptor.py +0 -162
  152. hiddenlayer/sdk/rest/models/reporting_descriptor_reference.py +0 -103
  153. hiddenlayer/sdk/rest/models/reporting_descriptor_relationship.py +0 -115
  154. hiddenlayer/sdk/rest/models/result.py +0 -312
  155. hiddenlayer/sdk/rest/models/result_provenance.py +0 -133
  156. hiddenlayer/sdk/rest/models/rule_details_inner.py +0 -102
  157. hiddenlayer/sdk/rest/models/run.py +0 -318
  158. hiddenlayer/sdk/rest/models/run_automation_details.py +0 -129
  159. hiddenlayer/sdk/rest/models/sarif210.py +0 -123
  160. hiddenlayer/sdk/rest/models/scan_create_request.py +0 -87
  161. hiddenlayer/sdk/rest/models/scan_detection_v3.py +0 -159
  162. hiddenlayer/sdk/rest/models/scan_detection_v31.py +0 -158
  163. hiddenlayer/sdk/rest/models/scan_header_v3.py +0 -129
  164. hiddenlayer/sdk/rest/models/scan_job.py +0 -115
  165. hiddenlayer/sdk/rest/models/scan_job_access.py +0 -97
  166. hiddenlayer/sdk/rest/models/scan_model_details_v3.py +0 -99
  167. hiddenlayer/sdk/rest/models/scan_model_details_v31.py +0 -97
  168. hiddenlayer/sdk/rest/models/scan_model_ids_v3.py +0 -89
  169. hiddenlayer/sdk/rest/models/scan_report_v3.py +0 -139
  170. hiddenlayer/sdk/rest/models/scan_results_map_v3.py +0 -105
  171. hiddenlayer/sdk/rest/models/scan_results_v3.py +0 -120
  172. hiddenlayer/sdk/rest/models/security_posture.py +0 -89
  173. hiddenlayer/sdk/rest/models/sensor.py +0 -100
  174. hiddenlayer/sdk/rest/models/sensor_query_response.py +0 -101
  175. hiddenlayer/sdk/rest/models/sensor_sor_model_card_query_response.py +0 -101
  176. hiddenlayer/sdk/rest/models/sensor_sor_model_card_response.py +0 -127
  177. hiddenlayer/sdk/rest/models/sensor_sor_query_filter.py +0 -108
  178. hiddenlayer/sdk/rest/models/sensor_sor_query_request.py +0 -109
  179. hiddenlayer/sdk/rest/models/special_locations.py +0 -97
  180. hiddenlayer/sdk/rest/models/stack.py +0 -113
  181. hiddenlayer/sdk/rest/models/stack_frame.py +0 -104
  182. hiddenlayer/sdk/rest/models/submission_response.py +0 -95
  183. hiddenlayer/sdk/rest/models/submission_v2.py +0 -109
  184. hiddenlayer/sdk/rest/models/suppression.py +0 -133
  185. hiddenlayer/sdk/rest/models/thread_flow.py +0 -144
  186. hiddenlayer/sdk/rest/models/thread_flow_location.py +0 -166
  187. hiddenlayer/sdk/rest/models/tool.py +0 -107
  188. hiddenlayer/sdk/rest/models/tool_component.py +0 -251
  189. hiddenlayer/sdk/rest/models/tool_component_reference.py +0 -108
  190. hiddenlayer/sdk/rest/models/translation_metadata.py +0 -110
  191. hiddenlayer/sdk/rest/models/validation_error_model.py +0 -99
  192. hiddenlayer/sdk/rest/models/version_control_details.py +0 -108
  193. hiddenlayer/sdk/rest/models/web_request.py +0 -112
  194. hiddenlayer/sdk/rest/models/web_response.py +0 -112
  195. hiddenlayer/sdk/rest/rest.py +0 -257
  196. hiddenlayer/sdk/services/__init__.py +0 -0
  197. hiddenlayer/sdk/services/aidr_predictive.py +0 -130
  198. hiddenlayer/sdk/services/model_scan.py +0 -505
  199. hiddenlayer/sdk/utils.py +0 -92
  200. hiddenlayer/sdk/version.py +0 -1
  201. hiddenlayer_sdk-2.0.10.dist-info/METADATA +0 -368
  202. hiddenlayer_sdk-2.0.10.dist-info/RECORD +0 -126
  203. hiddenlayer_sdk-2.0.10.dist-info/top_level.txt +0 -1
  204. /hiddenlayer/{sdk/__init__.py → py.typed} +0 -0
@@ -0,0 +1,381 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from pydantic import Field as FieldInfo
7
+
8
+ from .._models import BaseModel
9
+
10
+ __all__ = [
11
+ "PromptAnalyzerCreateResponse",
12
+ "Categories",
13
+ "Frameworks",
14
+ "FrameworksMitre",
15
+ "FrameworksOwasp",
16
+ "FrameworksOwasp2025",
17
+ "Policy",
18
+ "Response",
19
+ "Results",
20
+ "ResultsGuardrailResults",
21
+ "ResultsGuardrailResultsRefusalClassifierResults",
22
+ "ResultsInputBlockListResults",
23
+ "ResultsInputCodeResults",
24
+ "ResultsInputDosResults",
25
+ "ResultsInputLanguageResults",
26
+ "ResultsInputPiiResults",
27
+ "ResultsInputURLResults",
28
+ "ResultsOutputCodeResults",
29
+ "ResultsOutputPiiResults",
30
+ "ResultsOutputURLResults",
31
+ "ResultsPromptInjectionClassifierResult",
32
+ ]
33
+
34
+
35
+ class Categories(BaseModel):
36
+ guardrail: Optional[bool] = None
37
+ """The input activated the upstream guardrails"""
38
+
39
+ input_code: Optional[bool] = None
40
+ """The input contains code"""
41
+
42
+ input_dos: Optional[bool] = None
43
+ """The input contains a denial of service attack"""
44
+
45
+ input_language: Optional[bool] = None
46
+ """The input contains a disallowed language"""
47
+
48
+ input_pii: Optional[bool] = None
49
+ """The input contains personally identifiable information"""
50
+
51
+ output_code: Optional[bool] = None
52
+ """The output contains code"""
53
+
54
+ output_pii: Optional[bool] = None
55
+ """The output contains personally identifiable information"""
56
+
57
+ prompt_injection: Optional[bool] = None
58
+ """The input contains prompt injection"""
59
+
60
+ unsafe_input: Optional[bool] = None
61
+ """The input is unsafe"""
62
+
63
+ unsafe_output: Optional[bool] = None
64
+ """The output is unsafe"""
65
+
66
+
67
+ class FrameworksMitre(BaseModel):
68
+ label: Optional[str] = None
69
+ """The label of the MITRE Atlas framework label"""
70
+
71
+ name: Optional[str] = None
72
+ """The name of the MITRE Atlas framework label"""
73
+
74
+
75
+ class FrameworksOwasp(BaseModel):
76
+ label: Optional[str] = None
77
+ """The label of the OWASP framework label"""
78
+
79
+ name: Optional[str] = None
80
+ """The name of the OWASP framework label"""
81
+
82
+
83
+ class FrameworksOwasp2025(BaseModel):
84
+ label: Optional[str] = None
85
+ """The label of the OWASP:2025 framework label"""
86
+
87
+ name: Optional[str] = None
88
+ """The name of the OWASP:2025 framework label"""
89
+
90
+
91
+ class Frameworks(BaseModel):
92
+ mitre: Optional[List[FrameworksMitre]] = None
93
+
94
+ owasp: Optional[List[FrameworksOwasp]] = None
95
+
96
+ owasp_2025: Optional[List[FrameworksOwasp2025]] = FieldInfo(alias="owasp:2025", default=None)
97
+
98
+
99
+ class Policy(BaseModel):
100
+ block_guardrail_detection: Optional[bool] = None
101
+ """Block guardrail detection"""
102
+
103
+ block_input_code_detection: Optional[bool] = None
104
+ """Block input code detection"""
105
+
106
+ block_input_dos_detection: Optional[bool] = None
107
+ """Block input denial of service detection"""
108
+
109
+ block_input_pii: Optional[bool] = None
110
+ """Block input personally identifiable information"""
111
+
112
+ block_output_code_detection: Optional[bool] = None
113
+ """Block output code detection"""
114
+
115
+ block_output_pii: Optional[bool] = None
116
+ """Block output personally identifiable information"""
117
+
118
+ block_prompt_injection: Optional[bool] = None
119
+ """Block prompt injection"""
120
+
121
+ block_unsafe: Optional[bool] = None
122
+ """Block unsafe input and output"""
123
+
124
+ block_unsafe_input: Optional[bool] = None
125
+ """Block unsafe input"""
126
+
127
+ block_unsafe_output: Optional[bool] = None
128
+ """Block unsafe output"""
129
+
130
+ entity_type: Optional[Literal["strict", "all"]] = None
131
+ """The type of entity to redact"""
132
+
133
+ input_dos_detection_threshold: Optional[float] = None
134
+ """The threshold for input denial of service detection"""
135
+
136
+ prompt_injection_scan_type: Optional[Literal["quick", "full"]] = None
137
+ """The type of prompt injection scan to use"""
138
+
139
+ redact_input_pii: Optional[bool] = None
140
+ """Redact input personally identifiable information"""
141
+
142
+ redact_output_pii: Optional[bool] = None
143
+ """Redact output personally identifiable information"""
144
+
145
+ redact_type: Optional[Literal["entity", "strict"]] = None
146
+ """The type of redaction to use"""
147
+
148
+ skip_guardrail_detection: Optional[bool] = None
149
+ """Skip guardrail detection"""
150
+
151
+ skip_input_code_detection: Optional[bool] = None
152
+ """Skip input code detection"""
153
+
154
+ skip_input_dos_detection: Optional[bool] = None
155
+ """Skip input denial of service detection"""
156
+
157
+ skip_input_pii_detection: Optional[bool] = None
158
+ """Skip input personally identifiable information detection"""
159
+
160
+ skip_input_url_detection: Optional[bool] = None
161
+ """Skip input URL detection"""
162
+
163
+ skip_output_code_detection: Optional[bool] = None
164
+ """Skip output code detection"""
165
+
166
+ skip_output_pii_detection: Optional[bool] = None
167
+ """Skip output personally identifiable information detection"""
168
+
169
+ skip_output_url_detection: Optional[bool] = None
170
+ """Skip output URL detection"""
171
+
172
+ skip_prompt_injection_detection: Optional[bool] = None
173
+ """Skip prompt injection detection"""
174
+
175
+
176
+ class Response(BaseModel):
177
+ model: Optional[str] = None
178
+
179
+ output: Optional[str] = None
180
+
181
+ prompt: Optional[str] = None
182
+
183
+ provider: Optional[str] = None
184
+
185
+ unmodified_output: Optional[str] = None
186
+
187
+ unmodified_prompt: Optional[str] = None
188
+
189
+
190
+ class ResultsGuardrailResultsRefusalClassifierResults(BaseModel):
191
+ elapsed_ms: Optional[float] = None
192
+ """The time in milliseconds it took to process the refusal classifier"""
193
+
194
+ probabilities: Optional[List[float]] = None
195
+
196
+ verdict: Optional[bool] = None
197
+ """The verdict of the refusal classifier"""
198
+
199
+ version: Optional[float] = None
200
+ """The version of the refusal classifier"""
201
+
202
+
203
+ class ResultsGuardrailResults(BaseModel):
204
+ elapsed_ms: Optional[float] = None
205
+ """The time in milliseconds it took to process the guardrail"""
206
+
207
+ refusal_classifier_results: Optional[ResultsGuardrailResultsRefusalClassifierResults] = None
208
+ """The refusal classifier results"""
209
+
210
+ verdict: Optional[bool] = None
211
+ """The verdict of the guardrail analysis"""
212
+
213
+
214
+ class ResultsInputBlockListResults(BaseModel):
215
+ elapsed_ms: Optional[float] = None
216
+ """The time in milliseconds it took to process the input block list"""
217
+
218
+ matches: Optional[List[str]] = None
219
+
220
+ verdict: Optional[bool] = None
221
+ """The verdict of the input block list analysis"""
222
+
223
+
224
+ class ResultsInputCodeResults(BaseModel):
225
+ elapsed_ms: Optional[float] = None
226
+ """The time in milliseconds it took to process the input code"""
227
+
228
+ verdict: Optional[bool] = None
229
+ """The verdict of the input code analysis"""
230
+
231
+
232
+ class ResultsInputDosResults(BaseModel):
233
+ elapsed_ms: Optional[float] = None
234
+ """The time in milliseconds it took to process the input denial of service"""
235
+
236
+ embeddings_length: Optional[float] = None
237
+ """The length of the embeddings analyzed"""
238
+
239
+ verdict: Optional[bool] = None
240
+ """The verdict of the input denial of service analysis"""
241
+
242
+
243
+ class ResultsInputLanguageResults(BaseModel):
244
+ elapsed_ms: Optional[float] = None
245
+ """The time in milliseconds it took to process the input language detection"""
246
+
247
+ language: Optional[str] = None
248
+ """Language detected in the input"""
249
+
250
+ verdict: Optional[bool] = None
251
+ """The verdict of the input language analysis"""
252
+
253
+
254
+ class ResultsInputPiiResults(BaseModel):
255
+ elapsed_ms: Optional[float] = None
256
+ """
257
+ The time in milliseconds it took to process the input personally identifiable
258
+ information
259
+ """
260
+
261
+ entities: Optional[List[str]] = None
262
+
263
+ verdict: Optional[bool] = None
264
+ """The verdict of the input personally identifiable information analysis"""
265
+
266
+
267
+ class ResultsInputURLResults(BaseModel):
268
+ elapsed_ms: Optional[float] = None
269
+ """The time in milliseconds it took to process the guardrail"""
270
+
271
+ urls: Optional[List[str]] = None
272
+
273
+
274
+ class ResultsOutputCodeResults(BaseModel):
275
+ elapsed_ms: Optional[float] = None
276
+ """The time in milliseconds it took to process the output code"""
277
+
278
+ verdict: Optional[bool] = None
279
+ """The verdict of the output code analysis"""
280
+
281
+
282
+ class ResultsOutputPiiResults(BaseModel):
283
+ elapsed_ms: Optional[float] = None
284
+ """
285
+ The time in milliseconds it took to process the output personally identifiable
286
+ information
287
+ """
288
+
289
+ entities: Optional[List[str]] = None
290
+
291
+ verdict: Optional[bool] = None
292
+ """The verdict of the output personally identifiable information analysis"""
293
+
294
+
295
+ class ResultsOutputURLResults(BaseModel):
296
+ elapsed_ms: Optional[float] = None
297
+ """The time in milliseconds it took to process the guardrail"""
298
+
299
+ urls: Optional[List[str]] = None
300
+
301
+
302
+ class ResultsPromptInjectionClassifierResult(BaseModel):
303
+ allow_override: Optional[str] = None
304
+ """The allow override applied to the prompt"""
305
+
306
+ block_override: Optional[str] = None
307
+ """The block override applied to the prompt"""
308
+
309
+ elapsed_ms: Optional[float] = None
310
+ """The time in milliseconds it took to process the prompt injection classifier"""
311
+
312
+ probabilities: Optional[List[float]] = None
313
+
314
+ verdict: Optional[bool] = None
315
+ """The verdict of the prompt injection classifier"""
316
+
317
+ version: Optional[float] = None
318
+ """The version of the prompt injection classifier"""
319
+
320
+
321
+ class Results(BaseModel):
322
+ guardrail_results: Optional[ResultsGuardrailResults] = None
323
+ """The guardrail results"""
324
+
325
+ input_block_list_results: Optional[ResultsInputBlockListResults] = None
326
+ """The input block list results"""
327
+
328
+ input_code_results: Optional[ResultsInputCodeResults] = None
329
+ """The input code results"""
330
+
331
+ input_dos_results: Optional[ResultsInputDosResults] = None
332
+ """The input denial of service results"""
333
+
334
+ input_language_results: Optional[ResultsInputLanguageResults] = None
335
+ """The input language results"""
336
+
337
+ input_pii_results: Optional[ResultsInputPiiResults] = None
338
+ """The input personally identifiable information results"""
339
+
340
+ input_url_results: Optional[ResultsInputURLResults] = None
341
+ """The input URL results"""
342
+
343
+ output_code_results: Optional[ResultsOutputCodeResults] = None
344
+ """The output code results"""
345
+
346
+ output_pii_results: Optional[ResultsOutputPiiResults] = None
347
+ """The output personally identifiable information results"""
348
+
349
+ output_url_results: Optional[ResultsOutputURLResults] = None
350
+ """The output URL results"""
351
+
352
+ prompt_injection_classifier_results: Optional[List[ResultsPromptInjectionClassifierResult]] = None
353
+
354
+
355
+ class PromptAnalyzerCreateResponse(BaseModel):
356
+ categories: Optional[Categories] = None
357
+ """The analysis detection categories"""
358
+
359
+ elapsed_ms: Optional[float] = None
360
+ """The time in milliseconds it took to process the request"""
361
+
362
+ frameworks: Optional[Frameworks] = None
363
+ """The framework labels identified during analysis"""
364
+
365
+ model: Optional[str] = None
366
+
367
+ policy: Optional[Policy] = None
368
+ """The policy used during analysis"""
369
+
370
+ provider: Optional[str] = None
371
+
372
+ response: Optional[Response] = None
373
+
374
+ results: Optional[Results] = None
375
+ """The analysis results"""
376
+
377
+ upstream_elapsed_ms: Optional[float] = None
378
+ """The time in milliseconds the upstream LLM took to process the request"""
379
+
380
+ verdict: Optional[bool] = None
381
+ """The overall verdict of the analysis"""
@@ -0,0 +1,14 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .scan_job import ScanJob as ScanJob
6
+ from .scan_report import ScanReport as ScanReport
7
+ from .job_list_params import JobListParams as JobListParams
8
+ from .job_list_response import JobListResponse as JobListResponse
9
+ from .job_request_params import JobRequestParams as JobRequestParams
10
+ from .job_retrieve_params import JobRetrieveParams as JobRetrieveParams
11
+ from .upload_start_params import UploadStartParams as UploadStartParams
12
+ from .result_sarif_response import ResultSarifResponse as ResultSarifResponse
13
+ from .upload_start_response import UploadStartResponse as UploadStartResponse
14
+ from .upload_complete_all_response import UploadCompleteAllResponse as UploadCompleteAllResponse
@@ -0,0 +1,75 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import List, Union
6
+ from datetime import datetime
7
+ from typing_extensions import Literal, Annotated, TypedDict
8
+
9
+ from ..._types import SequenceNotStr
10
+ from ..._utils import PropertyInfo
11
+
12
+ __all__ = ["JobListParams", "ModelName", "Source"]
13
+
14
+
15
+ class JobListParams(TypedDict, total=False):
16
+ compliance_status: List[Literal["COMPLIANT", "NONCOMPLIANT"]]
17
+ """A comma separated list of rule set evaluation statuses to include"""
18
+
19
+ detection_category: str
20
+ """filter by a single detection category"""
21
+
22
+ end_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
23
+ """End Time"""
24
+
25
+ latest_per_model_version_only: bool
26
+ """only return latest result per model version"""
27
+
28
+ limit: int
29
+
30
+ model_ids: SequenceNotStr[str]
31
+ """Model ID"""
32
+
33
+ model_name: ModelName
34
+ """filter by the model name"""
35
+
36
+ model_version_ids: SequenceNotStr[str]
37
+ """Model Version IDs"""
38
+
39
+ offset: int
40
+
41
+ request_source: List[Literal["Hybrid Upload", "API Upload", "Integration", "UI Upload"]]
42
+ """Filter by request source using a comma-separated list"""
43
+
44
+ scanner_version: str
45
+ """filter by version of the scanner"""
46
+
47
+ severity: SequenceNotStr[str]
48
+ """Severities"""
49
+
50
+ sort: str
51
+ """
52
+ allow sorting by model name, status, severity or created at, ascending (+) or
53
+ the default descending (-)
54
+ """
55
+
56
+ source: Source
57
+ """source of model related to scans"""
58
+
59
+ start_time: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
60
+ """Start Time"""
61
+
62
+ status: SequenceNotStr[str]
63
+ """Statuses"""
64
+
65
+ x_correlation_id: Annotated[str, PropertyInfo(alias="X-Correlation-Id")]
66
+
67
+
68
+ class ModelName(TypedDict, total=False):
69
+ contains: str
70
+
71
+ eq: str
72
+
73
+
74
+ class Source(TypedDict, total=False):
75
+ eq: Literal["adhoc"]
@@ -0,0 +1,22 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+
5
+ from ..._models import BaseModel
6
+ from .scan_report import ScanReport
7
+
8
+ __all__ = ["JobListResponse"]
9
+
10
+
11
+ class JobListResponse(BaseModel):
12
+ items: List[ScanReport]
13
+ """List of items. If no matching items are found, then `[]` will be returned."""
14
+
15
+ limit: int
16
+ """Maximum number of items to return"""
17
+
18
+ offset: int
19
+ """Begin returning the results from this offset"""
20
+
21
+ total: float
22
+ """Total number of items available based on the query criteria."""
@@ -0,0 +1,49 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal, Required, TypedDict
6
+
7
+ __all__ = ["JobRequestParams", "Access", "Inventory"]
8
+
9
+
10
+ class JobRequestParams(TypedDict, total=False):
11
+ access: Required[Access]
12
+
13
+ inventory: Required[Inventory]
14
+
15
+
16
+ class Access(TypedDict, total=False):
17
+ source: Literal[
18
+ "LOCAL",
19
+ "AWS_PRESIGNED",
20
+ "AWS_IAM_ROLE",
21
+ "AZURE_BLOB_SAS",
22
+ "AZURE_BLOB_AD",
23
+ "GOOGLE_SIGNED",
24
+ "GOOGLE_OAUTH",
25
+ "HUGGING_FACE",
26
+ ]
27
+
28
+
29
+ class Inventory(TypedDict, total=False):
30
+ model_name: Required[str]
31
+ """Name of the model"""
32
+
33
+ model_version: Required[str]
34
+ """If you do not provide a version, one will be generated for you."""
35
+
36
+ requested_scan_location: Required[str]
37
+ """Location to be scanned"""
38
+
39
+ requesting_entity: Required[str]
40
+ """Entity that requested the scan"""
41
+
42
+ origin: str
43
+ """
44
+ Specifies the platform or service where the model originated before being
45
+ scanned
46
+ """
47
+
48
+ request_source: Literal["Hybrid Upload", "API Upload", "Integration", "UI Upload"]
49
+ """Identifies the system that requested the scan"""
@@ -0,0 +1,16 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Annotated, TypedDict
6
+
7
+ from ..._utils import PropertyInfo
8
+
9
+ __all__ = ["JobRetrieveParams"]
10
+
11
+
12
+ class JobRetrieveParams(TypedDict, total=False):
13
+ has_detections: bool
14
+ """Filter file_results to only those that have detections (and parents)"""
15
+
16
+ x_correlation_id: Annotated[str, PropertyInfo(alias="X-Correlation-Id")]
@@ -0,0 +1,7 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing_extensions import TypeAlias
4
+
5
+ __all__ = ["ResultSarifResponse"]
6
+
7
+ ResultSarifResponse: TypeAlias = str
@@ -0,0 +1,46 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from ..._compat import PYDANTIC_V1, ConfigDict
7
+ from ..._models import BaseModel
8
+
9
+ __all__ = ["ScanJob", "Inventory"]
10
+
11
+
12
+ class Inventory(BaseModel):
13
+ model_name: str
14
+ """Name of the model"""
15
+
16
+ model_version: str
17
+ """If you do not provide a version, one will be generated for you."""
18
+
19
+ requested_scan_location: str
20
+ """Location to be scanned"""
21
+
22
+ requesting_entity: str
23
+ """Entity that requested the scan"""
24
+
25
+ origin: Optional[str] = None
26
+ """
27
+ Specifies the platform or service where the model originated before being
28
+ scanned
29
+ """
30
+
31
+ request_source: Optional[Literal["Hybrid Upload", "API Upload", "Integration", "UI Upload"]] = None
32
+ """Identifies the system that requested the scan"""
33
+
34
+ if not PYDANTIC_V1:
35
+ # allow fields with a `model_` prefix
36
+ model_config = ConfigDict(protected_namespaces=tuple())
37
+
38
+
39
+ class ScanJob(BaseModel):
40
+ inventory: Inventory
41
+
42
+ scan_id: Optional[str] = None
43
+ """unique identifier for the scan"""
44
+
45
+ status: Optional[Literal["pending", "running", "done", "failed", "canceled"]] = None
46
+ """Status of the scan"""