@cdot65/prisma-airs-cli 2.11.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/README.md +27 -169
  2. package/dist/chunk-JXHYQFEK.js +1752 -0
  3. package/dist/cli/index.js +6511 -4
  4. package/dist/dlp-5XKWITZX.js +710 -0
  5. package/dist/index.d.ts +1396 -26
  6. package/dist/index.js +40 -37
  7. package/package.json +22 -25
  8. package/dist/airs/dlp/data-filtering-profiles.d.ts +0 -10
  9. package/dist/airs/dlp/data-filtering-profiles.d.ts.map +0 -1
  10. package/dist/airs/dlp/data-filtering-profiles.js +0 -17
  11. package/dist/airs/dlp/data-filtering-profiles.js.map +0 -1
  12. package/dist/airs/dlp/data-patterns.d.ts +0 -13
  13. package/dist/airs/dlp/data-patterns.d.ts.map +0 -1
  14. package/dist/airs/dlp/data-patterns.js +0 -26
  15. package/dist/airs/dlp/data-patterns.js.map +0 -1
  16. package/dist/airs/dlp/data-profiles.d.ts +0 -12
  17. package/dist/airs/dlp/data-profiles.d.ts.map +0 -1
  18. package/dist/airs/dlp/data-profiles.js +0 -23
  19. package/dist/airs/dlp/data-profiles.js.map +0 -1
  20. package/dist/airs/dlp/dictionaries.d.ts +0 -13
  21. package/dist/airs/dlp/dictionaries.d.ts.map +0 -1
  22. package/dist/airs/dlp/dictionaries.js +0 -34
  23. package/dist/airs/dlp/dictionaries.js.map +0 -1
  24. package/dist/airs/dlp/index.d.ts +0 -6
  25. package/dist/airs/dlp/index.d.ts.map +0 -1
  26. package/dist/airs/dlp/index.js +0 -6
  27. package/dist/airs/dlp/index.js.map +0 -1
  28. package/dist/airs/dlp/types.d.ts +0 -36
  29. package/dist/airs/dlp/types.d.ts.map +0 -1
  30. package/dist/airs/dlp/types.js +0 -2
  31. package/dist/airs/dlp/types.js.map +0 -1
  32. package/dist/airs/management.d.ts +0 -68
  33. package/dist/airs/management.d.ts.map +0 -1
  34. package/dist/airs/management.js +0 -317
  35. package/dist/airs/management.js.map +0 -1
  36. package/dist/airs/modelsecurity.d.ts +0 -74
  37. package/dist/airs/modelsecurity.d.ts.map +0 -1
  38. package/dist/airs/modelsecurity.js +0 -337
  39. package/dist/airs/modelsecurity.js.map +0 -1
  40. package/dist/airs/promptsets.d.ts +0 -50
  41. package/dist/airs/promptsets.d.ts.map +0 -1
  42. package/dist/airs/promptsets.js +0 -120
  43. package/dist/airs/promptsets.js.map +0 -1
  44. package/dist/airs/redteam.d.ts +0 -74
  45. package/dist/airs/redteam.d.ts.map +0 -1
  46. package/dist/airs/redteam.js +0 -406
  47. package/dist/airs/redteam.js.map +0 -1
  48. package/dist/airs/runtime.d.ts +0 -27
  49. package/dist/airs/runtime.d.ts.map +0 -1
  50. package/dist/airs/runtime.js +0 -158
  51. package/dist/airs/runtime.js.map +0 -1
  52. package/dist/airs/scanner.d.ts +0 -36
  53. package/dist/airs/scanner.d.ts.map +0 -1
  54. package/dist/airs/scanner.js +0 -101
  55. package/dist/airs/scanner.js.map +0 -1
  56. package/dist/airs/types.d.ts +0 -780
  57. package/dist/airs/types.d.ts.map +0 -1
  58. package/dist/airs/types.js +0 -6
  59. package/dist/airs/types.js.map +0 -1
  60. package/dist/audit/evaluator.d.ts +0 -17
  61. package/dist/audit/evaluator.d.ts.map +0 -1
  62. package/dist/audit/evaluator.js +0 -82
  63. package/dist/audit/evaluator.js.map +0 -1
  64. package/dist/audit/report.d.ts +0 -38
  65. package/dist/audit/report.d.ts.map +0 -1
  66. package/dist/audit/report.js +0 -141
  67. package/dist/audit/report.js.map +0 -1
  68. package/dist/audit/runner.d.ts +0 -18
  69. package/dist/audit/runner.d.ts.map +0 -1
  70. package/dist/audit/runner.js +0 -60
  71. package/dist/audit/runner.js.map +0 -1
  72. package/dist/audit/types.d.ts +0 -53
  73. package/dist/audit/types.d.ts.map +0 -1
  74. package/dist/audit/types.js +0 -5
  75. package/dist/audit/types.js.map +0 -1
  76. package/dist/backup/index.d.ts +0 -3
  77. package/dist/backup/index.d.ts.map +0 -1
  78. package/dist/backup/index.js +0 -3
  79. package/dist/backup/index.js.map +0 -1
  80. package/dist/backup/io.d.ts +0 -15
  81. package/dist/backup/io.d.ts.map +0 -1
  82. package/dist/backup/io.js +0 -67
  83. package/dist/backup/io.js.map +0 -1
  84. package/dist/backup/types.d.ts +0 -25
  85. package/dist/backup/types.d.ts.map +0 -1
  86. package/dist/backup/types.js +0 -2
  87. package/dist/backup/types.js.map +0 -1
  88. package/dist/cli/builders/profile-builder.d.ts +0 -45
  89. package/dist/cli/builders/profile-builder.d.ts.map +0 -1
  90. package/dist/cli/builders/profile-builder.js +0 -308
  91. package/dist/cli/builders/profile-builder.js.map +0 -1
  92. package/dist/cli/bulk-scan-state.d.ts +0 -15
  93. package/dist/cli/bulk-scan-state.d.ts.map +0 -1
  94. package/dist/cli/bulk-scan-state.js +0 -20
  95. package/dist/cli/bulk-scan-state.js.map +0 -1
  96. package/dist/cli/commands/audit.d.ts +0 -4
  97. package/dist/cli/commands/audit.d.ts.map +0 -1
  98. package/dist/cli/commands/audit.js +0 -113
  99. package/dist/cli/commands/audit.js.map +0 -1
  100. package/dist/cli/commands/backup.d.ts +0 -10
  101. package/dist/cli/commands/backup.d.ts.map +0 -1
  102. package/dist/cli/commands/backup.js +0 -102
  103. package/dist/cli/commands/backup.js.map +0 -1
  104. package/dist/cli/commands/dlp/build-body.d.ts +0 -28
  105. package/dist/cli/commands/dlp/build-body.d.ts.map +0 -1
  106. package/dist/cli/commands/dlp/build-body.js +0 -174
  107. package/dist/cli/commands/dlp/build-body.js.map +0 -1
  108. package/dist/cli/commands/dlp/dictionaries.d.ts +0 -3
  109. package/dist/cli/commands/dlp/dictionaries.d.ts.map +0 -1
  110. package/dist/cli/commands/dlp/dictionaries.js +0 -167
  111. package/dist/cli/commands/dlp/dictionaries.js.map +0 -1
  112. package/dist/cli/commands/dlp/filtering-profiles.d.ts +0 -3
  113. package/dist/cli/commands/dlp/filtering-profiles.d.ts.map +0 -1
  114. package/dist/cli/commands/dlp/filtering-profiles.js +0 -82
  115. package/dist/cli/commands/dlp/filtering-profiles.js.map +0 -1
  116. package/dist/cli/commands/dlp/generate.d.ts +0 -3
  117. package/dist/cli/commands/dlp/generate.d.ts.map +0 -1
  118. package/dist/cli/commands/dlp/generate.js +0 -51
  119. package/dist/cli/commands/dlp/generate.js.map +0 -1
  120. package/dist/cli/commands/dlp/index.d.ts +0 -3
  121. package/dist/cli/commands/dlp/index.d.ts.map +0 -1
  122. package/dist/cli/commands/dlp/index.js +0 -16
  123. package/dist/cli/commands/dlp/index.js.map +0 -1
  124. package/dist/cli/commands/dlp/patch.d.ts +0 -15
  125. package/dist/cli/commands/dlp/patch.d.ts.map +0 -1
  126. package/dist/cli/commands/dlp/patch.js +0 -70
  127. package/dist/cli/commands/dlp/patch.js.map +0 -1
  128. package/dist/cli/commands/dlp/patterns.d.ts +0 -3
  129. package/dist/cli/commands/dlp/patterns.d.ts.map +0 -1
  130. package/dist/cli/commands/dlp/patterns.js +0 -127
  131. package/dist/cli/commands/dlp/patterns.js.map +0 -1
  132. package/dist/cli/commands/dlp/profiles.d.ts +0 -3
  133. package/dist/cli/commands/dlp/profiles.d.ts.map +0 -1
  134. package/dist/cli/commands/dlp/profiles.js +0 -126
  135. package/dist/cli/commands/dlp/profiles.js.map +0 -1
  136. package/dist/cli/commands/modelsecurity.d.ts +0 -4
  137. package/dist/cli/commands/modelsecurity.d.ts.map +0 -1
  138. package/dist/cli/commands/modelsecurity.js +0 -605
  139. package/dist/cli/commands/modelsecurity.js.map +0 -1
  140. package/dist/cli/commands/profiles-cleanup.d.ts +0 -26
  141. package/dist/cli/commands/profiles-cleanup.d.ts.map +0 -1
  142. package/dist/cli/commands/profiles-cleanup.js +0 -113
  143. package/dist/cli/commands/profiles-cleanup.js.map +0 -1
  144. package/dist/cli/commands/redteam.d.ts +0 -12
  145. package/dist/cli/commands/redteam.d.ts.map +0 -1
  146. package/dist/cli/commands/redteam.js +0 -1071
  147. package/dist/cli/commands/redteam.js.map +0 -1
  148. package/dist/cli/commands/restore.d.ts +0 -11
  149. package/dist/cli/commands/restore.d.ts.map +0 -1
  150. package/dist/cli/commands/restore.js +0 -109
  151. package/dist/cli/commands/restore.js.map +0 -1
  152. package/dist/cli/commands/runtime.d.ts +0 -6
  153. package/dist/cli/commands/runtime.d.ts.map +0 -1
  154. package/dist/cli/commands/runtime.js +0 -822
  155. package/dist/cli/commands/runtime.js.map +0 -1
  156. package/dist/cli/commands/topics-apply.d.ts +0 -16
  157. package/dist/cli/commands/topics-apply.d.ts.map +0 -1
  158. package/dist/cli/commands/topics-apply.js +0 -69
  159. package/dist/cli/commands/topics-apply.js.map +0 -1
  160. package/dist/cli/commands/topics-create.d.ts +0 -16
  161. package/dist/cli/commands/topics-create.d.ts.map +0 -1
  162. package/dist/cli/commands/topics-create.js +0 -71
  163. package/dist/cli/commands/topics-create.js.map +0 -1
  164. package/dist/cli/commands/topics-eval.d.ts +0 -7
  165. package/dist/cli/commands/topics-eval.d.ts.map +0 -1
  166. package/dist/cli/commands/topics-eval.js +0 -65
  167. package/dist/cli/commands/topics-eval.js.map +0 -1
  168. package/dist/cli/commands/topics-revert.d.ts +0 -9
  169. package/dist/cli/commands/topics-revert.d.ts.map +0 -1
  170. package/dist/cli/commands/topics-revert.js +0 -52
  171. package/dist/cli/commands/topics-revert.js.map +0 -1
  172. package/dist/cli/commands/topics-sample.d.ts +0 -4
  173. package/dist/cli/commands/topics-sample.d.ts.map +0 -1
  174. package/dist/cli/commands/topics-sample.js +0 -27
  175. package/dist/cli/commands/topics-sample.js.map +0 -1
  176. package/dist/cli/debug-logger.d.ts +0 -11
  177. package/dist/cli/debug-logger.d.ts.map +0 -1
  178. package/dist/cli/debug-logger.js +0 -137
  179. package/dist/cli/debug-logger.js.map +0 -1
  180. package/dist/cli/index.d.ts +0 -3
  181. package/dist/cli/index.d.ts.map +0 -1
  182. package/dist/cli/index.js.map +0 -1
  183. package/dist/cli/parse-input.d.ts +0 -9
  184. package/dist/cli/parse-input.d.ts.map +0 -1
  185. package/dist/cli/parse-input.js +0 -109
  186. package/dist/cli/parse-input.js.map +0 -1
  187. package/dist/cli/program.d.ts +0 -3
  188. package/dist/cli/program.d.ts.map +0 -1
  189. package/dist/cli/program.js +0 -32
  190. package/dist/cli/program.js.map +0 -1
  191. package/dist/cli/renderer/audit.d.ts +0 -11
  192. package/dist/cli/renderer/audit.d.ts.map +0 -1
  193. package/dist/cli/renderer/audit.js +0 -58
  194. package/dist/cli/renderer/audit.js.map +0 -1
  195. package/dist/cli/renderer/backup.d.ts +0 -8
  196. package/dist/cli/renderer/backup.d.ts.map +0 -1
  197. package/dist/cli/renderer/backup.js +0 -50
  198. package/dist/cli/renderer/backup.js.map +0 -1
  199. package/dist/cli/renderer/common.d.ts +0 -14
  200. package/dist/cli/renderer/common.d.ts.map +0 -1
  201. package/dist/cli/renderer/common.js +0 -50
  202. package/dist/cli/renderer/common.js.map +0 -1
  203. package/dist/cli/renderer/dlp.d.ts +0 -34
  204. package/dist/cli/renderer/dlp.d.ts.map +0 -1
  205. package/dist/cli/renderer/dlp.js +0 -348
  206. package/dist/cli/renderer/dlp.js.map +0 -1
  207. package/dist/cli/renderer/eval.d.ts +0 -30
  208. package/dist/cli/renderer/eval.d.ts.map +0 -1
  209. package/dist/cli/renderer/eval.js +0 -61
  210. package/dist/cli/renderer/eval.js.map +0 -1
  211. package/dist/cli/renderer/index.d.ts +0 -9
  212. package/dist/cli/renderer/index.d.ts.map +0 -1
  213. package/dist/cli/renderer/index.js +0 -9
  214. package/dist/cli/renderer/index.js.map +0 -1
  215. package/dist/cli/renderer/modelsecurity.d.ts +0 -35
  216. package/dist/cli/renderer/modelsecurity.d.ts.map +0 -1
  217. package/dist/cli/renderer/modelsecurity.js +0 -339
  218. package/dist/cli/renderer/modelsecurity.js.map +0 -1
  219. package/dist/cli/renderer/redteam.d.ts +0 -216
  220. package/dist/cli/renderer/redteam.d.ts.map +0 -1
  221. package/dist/cli/renderer/redteam.js +0 -471
  222. package/dist/cli/renderer/redteam.js.map +0 -1
  223. package/dist/cli/renderer/runtime.d.ts +0 -107
  224. package/dist/cli/renderer/runtime.d.ts.map +0 -1
  225. package/dist/cli/renderer/runtime.js +0 -359
  226. package/dist/cli/renderer/runtime.js.map +0 -1
  227. package/dist/config/loader.d.ts +0 -3
  228. package/dist/config/loader.d.ts.map +0 -1
  229. package/dist/config/loader.js +0 -59
  230. package/dist/config/loader.js.map +0 -1
  231. package/dist/config/schema.d.ts +0 -63
  232. package/dist/config/schema.d.ts.map +0 -1
  233. package/dist/config/schema.js +0 -38
  234. package/dist/config/schema.js.map +0 -1
  235. package/dist/core/constraints.d.ts +0 -19
  236. package/dist/core/constraints.d.ts.map +0 -1
  237. package/dist/core/constraints.js +0 -82
  238. package/dist/core/constraints.js.map +0 -1
  239. package/dist/core/metrics.d.ts +0 -13
  240. package/dist/core/metrics.d.ts.map +0 -1
  241. package/dist/core/metrics.js +0 -73
  242. package/dist/core/metrics.js.map +0 -1
  243. package/dist/core/prompt-loader.d.ts +0 -14
  244. package/dist/core/prompt-loader.d.ts.map +0 -1
  245. package/dist/core/prompt-loader.js +0 -122
  246. package/dist/core/prompt-loader.js.map +0 -1
  247. package/dist/core/types.d.ts +0 -96
  248. package/dist/core/types.d.ts.map +0 -1
  249. package/dist/core/types.js +0 -5
  250. package/dist/core/types.js.map +0 -1
  251. package/dist/dlp/embed/docx.d.ts +0 -3
  252. package/dist/dlp/embed/docx.d.ts.map +0 -1
  253. package/dist/dlp/embed/docx.js +0 -54
  254. package/dist/dlp/embed/docx.js.map +0 -1
  255. package/dist/dlp/embed/index.d.ts +0 -6
  256. package/dist/dlp/embed/index.d.ts.map +0 -1
  257. package/dist/dlp/embed/index.js +0 -20
  258. package/dist/dlp/embed/index.js.map +0 -1
  259. package/dist/dlp/embed/jpeg.d.ts +0 -5
  260. package/dist/dlp/embed/jpeg.d.ts.map +0 -1
  261. package/dist/dlp/embed/jpeg.js +0 -60
  262. package/dist/dlp/embed/jpeg.js.map +0 -1
  263. package/dist/dlp/embed/pdf.d.ts +0 -7
  264. package/dist/dlp/embed/pdf.d.ts.map +0 -1
  265. package/dist/dlp/embed/pdf.js +0 -92
  266. package/dist/dlp/embed/pdf.js.map +0 -1
  267. package/dist/dlp/embed/png-chunks.d.ts +0 -12
  268. package/dist/dlp/embed/png-chunks.d.ts.map +0 -1
  269. package/dist/dlp/embed/png-chunks.js +0 -85
  270. package/dist/dlp/embed/png-chunks.js.map +0 -1
  271. package/dist/dlp/embed/png.d.ts +0 -5
  272. package/dist/dlp/embed/png.d.ts.map +0 -1
  273. package/dist/dlp/embed/png.js +0 -68
  274. package/dist/dlp/embed/png.js.map +0 -1
  275. package/dist/dlp/embed/svg.d.ts +0 -3
  276. package/dist/dlp/embed/svg.d.ts.map +0 -1
  277. package/dist/dlp/embed/svg.js +0 -28
  278. package/dist/dlp/embed/svg.js.map +0 -1
  279. package/dist/dlp/embed/zip.d.ts +0 -3
  280. package/dist/dlp/embed/zip.d.ts.map +0 -1
  281. package/dist/dlp/embed/zip.js +0 -25
  282. package/dist/dlp/embed/zip.js.map +0 -1
  283. package/dist/dlp/generate/docx.d.ts +0 -3
  284. package/dist/dlp/generate/docx.d.ts.map +0 -1
  285. package/dist/dlp/generate/docx.js +0 -24
  286. package/dist/dlp/generate/docx.js.map +0 -1
  287. package/dist/dlp/generate/index.d.ts +0 -5
  288. package/dist/dlp/generate/index.d.ts.map +0 -1
  289. package/dist/dlp/generate/index.js +0 -21
  290. package/dist/dlp/generate/index.js.map +0 -1
  291. package/dist/dlp/generate/jpeg.d.ts +0 -3
  292. package/dist/dlp/generate/jpeg.d.ts.map +0 -1
  293. package/dist/dlp/generate/jpeg.js +0 -8
  294. package/dist/dlp/generate/jpeg.js.map +0 -1
  295. package/dist/dlp/generate/pdf.d.ts +0 -3
  296. package/dist/dlp/generate/pdf.d.ts.map +0 -1
  297. package/dist/dlp/generate/pdf.js +0 -19
  298. package/dist/dlp/generate/pdf.js.map +0 -1
  299. package/dist/dlp/generate/png.d.ts +0 -3
  300. package/dist/dlp/generate/png.d.ts.map +0 -1
  301. package/dist/dlp/generate/png.js +0 -8
  302. package/dist/dlp/generate/png.js.map +0 -1
  303. package/dist/dlp/generate/raster.d.ts +0 -9
  304. package/dist/dlp/generate/raster.d.ts.map +0 -1
  305. package/dist/dlp/generate/raster.js +0 -20
  306. package/dist/dlp/generate/raster.js.map +0 -1
  307. package/dist/dlp/generate/svg.d.ts +0 -3
  308. package/dist/dlp/generate/svg.d.ts.map +0 -1
  309. package/dist/dlp/generate/svg.js +0 -17
  310. package/dist/dlp/generate/svg.js.map +0 -1
  311. package/dist/dlp/index.d.ts +0 -15
  312. package/dist/dlp/index.d.ts.map +0 -1
  313. package/dist/dlp/index.js +0 -54
  314. package/dist/dlp/index.js.map +0 -1
  315. package/dist/dlp/lorem.d.ts +0 -3
  316. package/dist/dlp/lorem.d.ts.map +0 -1
  317. package/dist/dlp/lorem.js +0 -65
  318. package/dist/dlp/lorem.js.map +0 -1
  319. package/dist/dlp/manifest.d.ts +0 -11
  320. package/dist/dlp/manifest.d.ts.map +0 -1
  321. package/dist/dlp/manifest.js +0 -14
  322. package/dist/dlp/manifest.js.map +0 -1
  323. package/dist/dlp/payload.d.ts +0 -6
  324. package/dist/dlp/payload.d.ts.map +0 -1
  325. package/dist/dlp/payload.js +0 -62
  326. package/dist/dlp/payload.js.map +0 -1
  327. package/dist/dlp/rng.d.ts +0 -9
  328. package/dist/dlp/rng.d.ts.map +0 -1
  329. package/dist/dlp/rng.js +0 -28
  330. package/dist/dlp/rng.js.map +0 -1
  331. package/dist/dlp/types.d.ts +0 -26
  332. package/dist/dlp/types.d.ts.map +0 -1
  333. package/dist/dlp/types.js +0 -2
  334. package/dist/dlp/types.js.map +0 -1
  335. package/dist/index.d.ts.map +0 -1
  336. package/dist/index.js.map +0 -1
  337. package/dist/llm/prompts/analyze-results.d.ts +0 -3
  338. package/dist/llm/prompts/analyze-results.d.ts.map +0 -1
  339. package/dist/llm/prompts/analyze-results.js +0 -52
  340. package/dist/llm/prompts/analyze-results.js.map +0 -1
  341. package/dist/llm/prompts/generate-companion.d.ts +0 -3
  342. package/dist/llm/prompts/generate-companion.d.ts.map +0 -1
  343. package/dist/llm/prompts/generate-companion.js +0 -42
  344. package/dist/llm/prompts/generate-companion.js.map +0 -1
  345. package/dist/llm/prompts/generate-tests.d.ts +0 -3
  346. package/dist/llm/prompts/generate-tests.d.ts.map +0 -1
  347. package/dist/llm/prompts/generate-tests.js +0 -46
  348. package/dist/llm/prompts/generate-tests.js.map +0 -1
  349. package/dist/llm/prompts/generate-topic.d.ts +0 -4
  350. package/dist/llm/prompts/generate-topic.d.ts.map +0 -1
  351. package/dist/llm/prompts/generate-topic.js +0 -41
  352. package/dist/llm/prompts/generate-topic.js.map +0 -1
  353. package/dist/llm/prompts/improve-topic.d.ts +0 -3
  354. package/dist/llm/prompts/improve-topic.d.ts.map +0 -1
  355. package/dist/llm/prompts/improve-topic.js +0 -77
  356. package/dist/llm/prompts/improve-topic.js.map +0 -1
  357. package/dist/llm/prompts/simplify-topic.d.ts +0 -3
  358. package/dist/llm/prompts/simplify-topic.d.ts.map +0 -1
  359. package/dist/llm/prompts/simplify-topic.js +0 -50
  360. package/dist/llm/prompts/simplify-topic.js.map +0 -1
  361. package/dist/llm/provider.d.ts +0 -21
  362. package/dist/llm/provider.d.ts.map +0 -1
  363. package/dist/llm/provider.js +0 -76
  364. package/dist/llm/provider.js.map +0 -1
  365. package/dist/llm/schemas.d.ts +0 -97
  366. package/dist/llm/schemas.d.ts.map +0 -1
  367. package/dist/llm/schemas.js +0 -24
  368. package/dist/llm/schemas.js.map +0 -1
  369. package/dist/llm/service.d.ts +0 -34
  370. package/dist/llm/service.d.ts.map +0 -1
  371. package/dist/llm/service.js +0 -268
  372. package/dist/llm/service.js.map +0 -1
  373. package/dist/llm/types.d.ts +0 -18
  374. package/dist/llm/types.d.ts.map +0 -1
  375. package/dist/llm/types.js +0 -2
  376. package/dist/llm/types.js.map +0 -1
  377. package/dist/report/html.d.ts +0 -6
  378. package/dist/report/html.d.ts.map +0 -1
  379. package/dist/report/html.js +0 -200
  380. package/dist/report/html.js.map +0 -1
  381. package/dist/report/json.d.ts +0 -11
  382. package/dist/report/json.d.ts.map +0 -1
  383. package/dist/report/json.js +0 -74
  384. package/dist/report/json.js.map +0 -1
  385. package/dist/report/types.d.ts +0 -58
  386. package/dist/report/types.d.ts.map +0 -1
  387. package/dist/report/types.js +0 -5
  388. package/dist/report/types.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,28 +1,1398 @@
1
+ import { CreateCustomTopicRequest, CustomTopic as CustomTopic$1, CreateSecurityProfileRequest, ManagementClientOptions, ModelSecurityClientOptions, RedTeamClientOptions, InitOptions } from '@cdot65/prisma-airs-sdk';
2
+ import { z } from 'zod';
3
+
1
4
  /**
2
- * Prisma AIRS CLIPublic library API
5
+ * AIRS integration types scan results and service interfaces for the
6
+ * Prisma AIRS scanner, topic management, and red team APIs.
7
+ */
8
+
9
+ /** Enriched topic entry read from a profile's policy. */
10
+ interface ProfileTopic {
11
+ topicId: string;
12
+ topicName: string;
13
+ action: 'allow' | 'block';
14
+ description: string;
15
+ examples: string[];
16
+ }
17
+
18
+ /** Normalized output from a single AIRS prompt scan. */
19
+ interface ScanResult {
20
+ scanId: string;
21
+ reportId: string;
22
+ action: 'allow' | 'block';
23
+ /** Whether the topic guardrail was triggered for this prompt. */
24
+ triggered: boolean;
25
+ category?: string;
26
+ raw?: unknown;
27
+ }
28
+ /** Normalized result from a runtime prompt scan (sync or async). */
29
+ interface RuntimeScanResult {
30
+ prompt: string;
31
+ response?: string;
32
+ scanId: string;
33
+ reportId: string;
34
+ action: 'allow' | 'block';
35
+ category: string;
36
+ triggered: boolean;
37
+ detections: Record<string, boolean>;
38
+ }
39
+ /** Contract for runtime scanning operations (sync + async). */
40
+ interface RuntimeService {
41
+ /** Scan a single prompt (and optional response) synchronously. */
42
+ scanPrompt(profileName: string, prompt: string, response?: string): Promise<RuntimeScanResult>;
43
+ /** Submit prompts for async bulk scanning, returns scan IDs. */
44
+ submitBulkScan(profileName: string, prompts: string[]): Promise<string[]>;
45
+ /** Poll async scan results until all complete. */
46
+ pollResults(scanIds: string[], intervalMs?: number): Promise<RuntimeScanResult[]>;
47
+ }
48
+ /** Contract for AIRS prompt scanning operations. */
49
+ interface ScanService {
50
+ /** Scan a single prompt against a security profile. */
51
+ scan(profileName: string, prompt: string, sessionId?: string): Promise<ScanResult>;
52
+ /** Scan multiple prompts with concurrency control. */
53
+ scanBatch(profileName: string, prompts: string[], concurrency?: number, sessionId?: string): Promise<ScanResult[]>;
54
+ }
55
+ /** Contract for custom prompt set operations in AI Red Team. */
56
+ interface PromptSetService {
57
+ /** Create a new custom prompt set. */
58
+ createPromptSet(name: string, description?: string): Promise<{
59
+ uuid: string;
60
+ name: string;
61
+ }>;
62
+ /** Add a prompt to an existing prompt set. */
63
+ addPrompt(promptSetId: string, prompt: string, goal?: string): Promise<{
64
+ uuid: string;
65
+ prompt: string;
66
+ }>;
67
+ /** List all custom prompt sets. */
68
+ listPromptSets(): Promise<Array<{
69
+ uuid: string;
70
+ name: string;
71
+ active: boolean;
72
+ }>>;
73
+ /** Get prompt set details. */
74
+ getPromptSet(uuid: string): Promise<PromptSetDetail>;
75
+ /** Update prompt set name/description. */
76
+ updatePromptSet(uuid: string, request: {
77
+ name?: string;
78
+ description?: string;
79
+ }): Promise<PromptSetDetail>;
80
+ /** Archive or unarchive a prompt set. */
81
+ archivePromptSet(uuid: string, archive: boolean): Promise<void>;
82
+ /** Get prompt set version info with stats. */
83
+ getPromptSetVersionInfo(uuid: string): Promise<PromptSetVersionInfo>;
84
+ /** Download CSV template for a prompt set. */
85
+ downloadTemplate(uuid: string): Promise<string>;
86
+ /** Upload CSV file to a prompt set. */
87
+ uploadPromptsCsv(uuid: string, file: Blob): Promise<{
88
+ message: string;
89
+ status: number;
90
+ }>;
91
+ /** List prompts in a prompt set. */
92
+ listPrompts(setUuid: string, opts?: {
93
+ limit?: number;
94
+ skip?: number;
95
+ }): Promise<PromptDetail[]>;
96
+ /** Get a single prompt. */
97
+ getPrompt(setUuid: string, promptUuid: string): Promise<PromptDetail>;
98
+ /** Update a prompt. */
99
+ updatePrompt(setUuid: string, promptUuid: string, request: {
100
+ prompt?: string;
101
+ goal?: string;
102
+ }): Promise<PromptDetail>;
103
+ /** Delete a prompt. */
104
+ deletePrompt(setUuid: string, promptUuid: string): Promise<void>;
105
+ /** List property names. */
106
+ getPropertyNames(): Promise<string[]>;
107
+ /** Create a property name. */
108
+ createPropertyName(name: string): Promise<MutationResponse>;
109
+ /** Get values for a property. */
110
+ getPropertyValues(name: string): Promise<PropertyValueList>;
111
+ /** Create a property value. */
112
+ createPropertyValue(name: string, value: string): Promise<MutationResponse>;
113
+ }
114
+ /** Normalized red team job/scan info. */
115
+ interface RedTeamJob {
116
+ uuid: string;
117
+ name: string;
118
+ status: string;
119
+ jobType: string;
120
+ targetId: string;
121
+ targetName?: string;
122
+ score?: number | null;
123
+ asr?: number | null;
124
+ total?: number | null;
125
+ completed?: number | null;
126
+ createdAt?: string | null;
127
+ }
128
+ /** Normalized red team target info. */
129
+ interface RedTeamTarget {
130
+ uuid: string;
131
+ name: string;
132
+ status: string;
133
+ targetType?: string;
134
+ active: boolean;
135
+ }
136
+ /** Detailed target info with connection params and metadata. */
137
+ interface RedTeamTargetDetail extends RedTeamTarget {
138
+ connectionType?: string | null;
139
+ apiEndpointType?: string | null;
140
+ responseMode?: string | null;
141
+ authType?: string | null;
142
+ authConfig?: Record<string, unknown> | null;
143
+ networkBrokerChannelUuid?: string | null;
144
+ sessionSupported?: boolean;
145
+ extraInfo?: Record<string, unknown> | null;
146
+ description?: string | null;
147
+ connectionParams?: Record<string, unknown>;
148
+ background?: {
149
+ industry?: string | null;
150
+ use_case?: string | null;
151
+ competitors?: string[] | null;
152
+ };
153
+ additionalContext?: {
154
+ system_prompt?: string | null;
155
+ use_case_description?: string | null;
156
+ documents?: unknown[] | null;
157
+ };
158
+ metadata?: {
159
+ multi_turn?: boolean;
160
+ rate_limit?: number | null;
161
+ rate_limit_error_json?: Record<string, unknown> | null;
162
+ is_streaming_enabled?: boolean | null;
163
+ max_turns?: number | null;
164
+ api_endpoint_type?: string | null;
165
+ response_mode?: string | null;
166
+ };
167
+ }
168
+ /** Request to create a red team target. */
169
+ interface RedTeamTargetCreateRequest {
170
+ name: string;
171
+ target_type: string;
172
+ connection_params: Record<string, unknown>;
173
+ background?: Record<string, unknown>;
174
+ additional_context?: Record<string, unknown>;
175
+ metadata?: Record<string, unknown>;
176
+ }
177
+ /** Request to update a red team target. */
178
+ interface RedTeamTargetUpdateRequest {
179
+ name?: string;
180
+ target_type?: string;
181
+ connection_params?: Record<string, unknown>;
182
+ background?: Record<string, unknown>;
183
+ additional_context?: Record<string, unknown>;
184
+ metadata?: Record<string, unknown>;
185
+ }
186
+ /** Options for target create/update operations. */
187
+ interface TargetOperationOptions {
188
+ validate?: boolean;
189
+ }
190
+ /** Normalized prompt set detail. */
191
+ interface PromptSetDetail {
192
+ uuid: string;
193
+ name: string;
194
+ active: boolean;
195
+ archive: boolean;
196
+ description?: string;
197
+ createdAt?: string;
198
+ updatedAt?: string;
199
+ }
200
+ /** Prompt set version info with stats. */
201
+ interface PromptSetVersionInfo {
202
+ uuid: string;
203
+ version: number;
204
+ stats: {
205
+ total: number;
206
+ active: number;
207
+ inactive: number;
208
+ };
209
+ }
210
+ /** Normalized individual prompt. */
211
+ interface PromptDetail {
212
+ uuid: string;
213
+ prompt: string;
214
+ goal?: string;
215
+ active: boolean;
216
+ promptSetId: string;
217
+ }
218
+ /** Values for a single property name (SDK 0.10.0 shape). */
219
+ interface PropertyValueList {
220
+ name: string;
221
+ values: string[];
222
+ }
223
+ /** Generic write-op response from custom-attack endpoints (SDK BaseResponseSchema). */
224
+ interface MutationResponse {
225
+ message: string;
226
+ status?: number;
227
+ }
228
+ /** Normalized attack category with subcategories. */
229
+ interface RedTeamCategory {
230
+ id: string;
231
+ displayName: string;
232
+ description?: string;
233
+ subCategories: Array<{
234
+ id: string;
235
+ displayName: string;
236
+ description?: string;
237
+ }>;
238
+ }
239
+ /** Normalized static report summary. */
240
+ interface RedTeamStaticReport {
241
+ score?: number | null;
242
+ asr?: number | null;
243
+ severityBreakdown: Array<{
244
+ severity: string;
245
+ successful: number;
246
+ failed: number;
247
+ }>;
248
+ reportSummary?: string | null;
249
+ categories: Array<{
250
+ id: string;
251
+ displayName: string;
252
+ asr: number;
253
+ successful: number;
254
+ failed: number;
255
+ total: number;
256
+ }>;
257
+ }
258
+ /** Normalized dynamic scan report summary. */
259
+ interface RedTeamDynamicReport {
260
+ score?: number;
261
+ asr?: number;
262
+ totalGoals?: number;
263
+ goalsAchieved?: number;
264
+ totalStreams?: number;
265
+ totalThreats?: number;
266
+ reportSummary?: string | null;
267
+ }
268
+ /** Normalized custom attack report summary. */
269
+ interface RedTeamCustomReport {
270
+ totalPrompts: number;
271
+ totalAttacks: number;
272
+ totalThreats: number;
273
+ failedAttacks: number;
274
+ score: number;
275
+ asr: number;
276
+ promptSets: Array<{
277
+ promptSetId: string;
278
+ promptSetName: string;
279
+ totalPrompts: number;
280
+ totalAttacks: number;
281
+ totalThreats: number;
282
+ threatRate: number;
283
+ }>;
284
+ }
285
+ /** Normalized attack list item (static/dynamic scans). */
286
+ interface RedTeamAttack {
287
+ id: string;
288
+ name: string;
289
+ severity?: string;
290
+ category?: string;
291
+ subCategory?: string;
292
+ subCategoryDisplayName?: string;
293
+ successful: boolean;
294
+ }
295
+ /** Normalized custom attack item (custom prompt set scans). */
296
+ interface RedTeamCustomAttack {
297
+ promptId: string;
298
+ promptText: string;
299
+ goal?: string;
300
+ threat: boolean;
301
+ asr?: number;
302
+ promptSetName?: string;
303
+ }
304
+ /** EULA content response. */
305
+ interface EulaContent {
306
+ content: string;
307
+ }
308
+ /** Normalized EULA acceptance status. */
309
+ interface EulaStatus {
310
+ isAccepted: boolean;
311
+ acceptedAt?: string;
312
+ acceptedByUserId?: string;
313
+ }
314
+ /** Request to validate target auth credentials. */
315
+ interface TargetAuthValidationRequest {
316
+ authType: string;
317
+ authConfig: unknown;
318
+ targetId?: string;
319
+ }
320
+ /** Result of target auth validation. */
321
+ interface TargetAuthValidationResult {
322
+ validated: boolean;
323
+ tokenPreview?: string;
324
+ expiresIn?: number;
325
+ }
326
+ /** Request to create/update an instance. */
327
+ interface InstanceRequest {
328
+ tsgId: string;
329
+ tenantId: string;
330
+ appId: string;
331
+ region: string;
332
+ }
333
+ /** Normalized instance response. */
334
+ interface InstanceResponse {
335
+ tsgId: string;
336
+ tenantId?: string;
337
+ appId?: string;
338
+ isSuccess?: boolean;
339
+ }
340
+ /** Normalized instance detail (from GET). */
341
+ interface InstanceDetail {
342
+ tsgId: string;
343
+ tenantId: string;
344
+ appId: string;
345
+ region: string;
346
+ }
347
+ /** Registry credentials. */
348
+ interface RegistryCredentials {
349
+ token: string;
350
+ expiry: string;
351
+ }
352
+ /** Contract for AI Red Team scan operations. */
353
+ interface RedTeamService {
354
+ /** Get EULA content. */
355
+ getEulaContent(): Promise<EulaContent>;
356
+ /** Get EULA acceptance status. */
357
+ getEulaStatus(): Promise<EulaStatus>;
358
+ /** Accept the EULA. */
359
+ acceptEula(eulaContent: string): Promise<EulaStatus>;
360
+ /** Create an instance. */
361
+ createInstance(request: InstanceRequest): Promise<InstanceResponse>;
362
+ /** Get instance details. */
363
+ getInstance(tenantId: string): Promise<InstanceDetail>;
364
+ /** Update an instance. */
365
+ updateInstance(tenantId: string, request: InstanceRequest): Promise<InstanceResponse>;
366
+ /** Delete an instance. */
367
+ deleteInstance(tenantId: string): Promise<InstanceResponse>;
368
+ /** Create devices for an instance. */
369
+ createDevices(tenantId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
370
+ /** Update devices (PATCH). */
371
+ updateDevices(tenantId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
372
+ /** Delete devices by serial numbers. */
373
+ deleteDevices(tenantId: string, serialNumbers: string): Promise<Record<string, unknown>>;
374
+ /** Get or create registry credentials. */
375
+ getRegistryCredentials(): Promise<RegistryCredentials>;
376
+ /** Validate target auth credentials. */
377
+ validateTargetAuth(request: TargetAuthValidationRequest): Promise<TargetAuthValidationResult>;
378
+ /** Get target field metadata. */
379
+ getTargetMetadata(): Promise<Record<string, unknown>>;
380
+ /** Get provider-specific target templates. */
381
+ getTargetTemplates(): Promise<Record<string, unknown>>;
382
+ /** List configured red team targets. */
383
+ listTargets(): Promise<RedTeamTarget[]>;
384
+ /** Get target details. */
385
+ getTarget(uuid: string): Promise<RedTeamTargetDetail>;
386
+ /** Create a red team target. */
387
+ createTarget(request: RedTeamTargetCreateRequest, opts?: TargetOperationOptions): Promise<RedTeamTargetDetail>;
388
+ /** Update a red team target. */
389
+ updateTarget(uuid: string, request: RedTeamTargetUpdateRequest, opts?: TargetOperationOptions): Promise<RedTeamTargetDetail>;
390
+ /** Delete a red team target. */
391
+ deleteTarget(uuid: string): Promise<void>;
392
+ /** Probe a target connection. */
393
+ probeTarget(request: Record<string, unknown>): Promise<Record<string, unknown>>;
394
+ /** Get target profile. */
395
+ getTargetProfile(uuid: string): Promise<Record<string, unknown>>;
396
+ /** Update target profile. */
397
+ updateTargetProfile(uuid: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
398
+ /** Create a red team scan job. */
399
+ createScan(request: {
400
+ name: string;
401
+ targetUuid: string;
402
+ jobType: string;
403
+ categories?: Record<string, unknown>;
404
+ customPromptSets?: string[];
405
+ attackGoals?: string[];
406
+ streamDepth?: number;
407
+ streamBreadth?: number;
408
+ }): Promise<RedTeamJob>;
409
+ /** Get scan status by job ID. */
410
+ getScan(jobId: string): Promise<RedTeamJob>;
411
+ /** List recent scans with optional filters. */
412
+ listScans(opts?: {
413
+ status?: string;
414
+ jobType?: string;
415
+ targetId?: string;
416
+ limit?: number;
417
+ }): Promise<RedTeamJob[]>;
418
+ /** Abort a running scan. */
419
+ abortScan(jobId: string): Promise<void>;
420
+ /** Get static scan report. */
421
+ getStaticReport(jobId: string): Promise<RedTeamStaticReport>;
422
+ /** Get dynamic scan report. */
423
+ getDynamicReport(jobId: string): Promise<RedTeamDynamicReport>;
424
+ /** Get custom attack report. */
425
+ getCustomReport(jobId: string): Promise<RedTeamCustomReport>;
426
+ /** List attacks from a static/dynamic scan. */
427
+ listAttacks(jobId: string, opts?: {
428
+ severity?: string;
429
+ limit?: number;
430
+ }): Promise<{
431
+ attacks: RedTeamAttack[];
432
+ totalItems?: number;
433
+ }>;
434
+ /** List attacks from a custom prompt set scan. */
435
+ listCustomAttacks(jobId: string, opts?: {
436
+ limit?: number;
437
+ }): Promise<RedTeamCustomAttack[]>;
438
+ /** List available attack categories. */
439
+ getCategories(): Promise<RedTeamCategory[]>;
440
+ /** Poll until scan completes. Calls onProgress for status updates. */
441
+ waitForCompletion(jobId: string, onProgress?: (job: RedTeamJob) => void, intervalMs?: number): Promise<RedTeamJob>;
442
+ }
443
+ /** Normalized security group. */
444
+ interface ModelSecurityGroup {
445
+ uuid: string;
446
+ name: string;
447
+ description: string;
448
+ sourceType: string;
449
+ state: string;
450
+ createdAt: string;
451
+ updatedAt: string;
452
+ }
453
+ /** Request to create a security group. */
454
+ interface ModelSecurityGroupCreateRequest {
455
+ name: string;
456
+ sourceType: string;
457
+ description?: string;
458
+ ruleConfigurations?: Record<string, Record<string, unknown>>;
459
+ }
460
+ /** Request to update a security group. */
461
+ interface ModelSecurityGroupUpdateRequest {
462
+ name?: string;
463
+ description?: string;
464
+ }
465
+ /** Filter options for listing security groups. */
466
+ interface ModelSecurityGroupListOptions {
467
+ sourceTypes?: string[];
468
+ searchQuery?: string;
469
+ sortField?: string;
470
+ sortDir?: string;
471
+ enabledRules?: string[];
472
+ skip?: number;
473
+ limit?: number;
474
+ }
475
+ /** Normalized security rule. */
476
+ interface ModelSecurityRule {
477
+ uuid: string;
478
+ name: string;
479
+ description: string;
480
+ ruleType: string;
481
+ compatibleSources: string[];
482
+ defaultState: string;
483
+ remediation: {
484
+ description: string;
485
+ steps: string[];
486
+ url: string;
487
+ };
488
+ editableFields: ModelSecurityRuleEditableField[];
489
+ constantValues: Record<string, unknown>;
490
+ defaultValues: Record<string, unknown>;
491
+ }
492
+ /** Editable field spec for a security rule. */
493
+ interface ModelSecurityRuleEditableField {
494
+ attributeName: string;
495
+ type: string;
496
+ displayName: string;
497
+ displayType: string;
498
+ description?: string;
499
+ dropdownValues?: Array<{
500
+ value: string;
501
+ label: string;
502
+ }>;
503
+ }
504
+ /** Filter options for listing security rules. */
505
+ interface ModelSecurityRuleListOptions {
506
+ sourceType?: string;
507
+ searchQuery?: string;
508
+ skip?: number;
509
+ limit?: number;
510
+ }
511
+ /** Normalized rule instance within a security group. */
512
+ interface ModelSecurityRuleInstance {
513
+ uuid: string;
514
+ securityGroupUuid: string;
515
+ securityRuleUuid: string;
516
+ state: string;
517
+ createdAt: string;
518
+ updatedAt: string;
519
+ rule: Record<string, unknown>;
520
+ fieldValues: Record<string, unknown>;
521
+ }
522
+ /** Filter options for listing rule instances. */
523
+ interface ModelSecurityRuleInstanceListOptions {
524
+ securityRuleUuid?: string;
525
+ state?: string;
526
+ skip?: number;
527
+ limit?: number;
528
+ }
529
+ /** Request to update a rule instance. */
530
+ interface ModelSecurityRuleInstanceUpdateRequest {
531
+ state?: string;
532
+ fieldValues?: Record<string, unknown>;
533
+ }
534
+ /** Normalized model security scan. */
535
+ interface ModelSecurityScan {
536
+ uuid: string;
537
+ evalOutcome: string;
538
+ modelUri: string;
539
+ scanOrigin: string;
540
+ sourceType: string;
541
+ securityGroupName: string;
542
+ evalSummary: {
543
+ rulesFailed: number;
544
+ rulesPassed: number;
545
+ totalRules: number;
546
+ } | null;
547
+ createdAt: string;
548
+ updatedAt: string;
549
+ labels: Array<{
550
+ key: string;
551
+ value: string;
552
+ }>;
553
+ }
554
+ /** Filter options for listing scans. */
555
+ interface ModelSecurityScanListOptions {
556
+ evalOutcome?: string;
557
+ sourceType?: string;
558
+ scanOrigin?: string;
559
+ search?: string;
560
+ skip?: number;
561
+ limit?: number;
562
+ }
563
+ /** Normalized rule evaluation from a scan. */
564
+ interface ModelSecurityEvaluation {
565
+ uuid: string;
566
+ result: string;
567
+ violationCount: number;
568
+ ruleInstanceUuid: string;
569
+ ruleName: string;
570
+ ruleDescription: string;
571
+ ruleInstanceState: string;
572
+ }
573
+ /** Normalized violation from a scan. */
574
+ interface ModelSecurityViolation {
575
+ uuid: string;
576
+ description: string;
577
+ threat: string;
578
+ threatDescription: string;
579
+ file: string;
580
+ ruleName: string;
581
+ ruleDescription: string;
582
+ ruleInstanceState: string;
583
+ }
584
+ /** Normalized scanned file from a scan. */
585
+ interface ModelSecurityFile {
586
+ uuid: string;
587
+ path: string;
588
+ type: string;
589
+ formats: string[];
590
+ result: string;
591
+ }
592
+ /** Filter options for listing scanned files. */
593
+ interface ModelSecurityFileListOptions {
594
+ type?: string;
595
+ result?: string;
596
+ skip?: number;
597
+ limit?: number;
598
+ }
599
+ /** Label key-value pair. */
600
+ interface ModelSecurityLabel {
601
+ key: string;
602
+ value: string;
603
+ }
604
+ /** PyPI authentication response. */
605
+ interface ModelSecurityPyPIAuth {
606
+ url: string;
607
+ expiresAt: string;
608
+ }
609
+ /** Contract for Model Security operations. */
610
+ interface ModelSecurityService {
611
+ listGroups(opts?: ModelSecurityGroupListOptions): Promise<{
612
+ totalItems: number;
613
+ groups: ModelSecurityGroup[];
614
+ }>;
615
+ getGroup(uuid: string): Promise<ModelSecurityGroup>;
616
+ createGroup(request: ModelSecurityGroupCreateRequest): Promise<ModelSecurityGroup>;
617
+ updateGroup(uuid: string, request: ModelSecurityGroupUpdateRequest): Promise<ModelSecurityGroup>;
618
+ deleteGroup(uuid: string): Promise<void>;
619
+ listRuleInstances(groupUuid: string, opts?: ModelSecurityRuleInstanceListOptions): Promise<{
620
+ totalItems: number;
621
+ ruleInstances: ModelSecurityRuleInstance[];
622
+ }>;
623
+ getRuleInstance(groupUuid: string, instanceUuid: string): Promise<ModelSecurityRuleInstance>;
624
+ updateRuleInstance(groupUuid: string, instanceUuid: string, request: ModelSecurityRuleInstanceUpdateRequest): Promise<ModelSecurityRuleInstance>;
625
+ listRules(opts?: ModelSecurityRuleListOptions): Promise<{
626
+ totalItems: number;
627
+ rules: ModelSecurityRule[];
628
+ }>;
629
+ getRule(uuid: string): Promise<ModelSecurityRule>;
630
+ createScan(request: Record<string, unknown>): Promise<ModelSecurityScan>;
631
+ listScans(opts?: ModelSecurityScanListOptions): Promise<{
632
+ totalItems: number;
633
+ scans: ModelSecurityScan[];
634
+ }>;
635
+ getScan(uuid: string): Promise<ModelSecurityScan>;
636
+ getEvaluations(scanUuid: string, opts?: {
637
+ skip?: number;
638
+ limit?: number;
639
+ }): Promise<{
640
+ totalItems: number;
641
+ evaluations: ModelSecurityEvaluation[];
642
+ }>;
643
+ getEvaluation(uuid: string): Promise<ModelSecurityEvaluation>;
644
+ getViolations(scanUuid: string, opts?: {
645
+ skip?: number;
646
+ limit?: number;
647
+ }): Promise<{
648
+ totalItems: number;
649
+ violations: ModelSecurityViolation[];
650
+ }>;
651
+ getViolation(uuid: string): Promise<ModelSecurityViolation>;
652
+ getFiles(scanUuid: string, opts?: ModelSecurityFileListOptions): Promise<{
653
+ totalItems: number;
654
+ files: ModelSecurityFile[];
655
+ }>;
656
+ addLabels(scanUuid: string, labels: ModelSecurityLabel[]): Promise<void>;
657
+ setLabels(scanUuid: string, labels: ModelSecurityLabel[]): Promise<void>;
658
+ deleteLabels(scanUuid: string, keys: string[]): Promise<void>;
659
+ getLabelKeys(opts?: {
660
+ skip?: number;
661
+ limit?: number;
662
+ }): Promise<{
663
+ totalItems: number;
664
+ keys: string[];
665
+ }>;
666
+ getLabelValues(key: string, opts?: {
667
+ skip?: number;
668
+ limit?: number;
669
+ }): Promise<{
670
+ totalItems: number;
671
+ values: string[];
672
+ }>;
673
+ getPyPIAuth(): Promise<ModelSecurityPyPIAuth>;
674
+ }
675
+ /** Normalized security profile. */
676
+ interface SecurityProfileInfo {
677
+ profileId: string;
678
+ profileName: string;
679
+ revision?: number;
680
+ active?: boolean;
681
+ createdBy?: string;
682
+ updatedBy?: string;
683
+ lastModifiedTs?: string;
684
+ policy?: Record<string, unknown>;
685
+ }
686
+ /** Paginated profile list result. */
687
+ interface SecurityProfileListResult {
688
+ profiles: SecurityProfileInfo[];
689
+ nextOffset?: number;
690
+ }
691
+ /** Delete response from profile/topic deletion. */
692
+ interface DeleteResponse {
693
+ message: string;
694
+ }
695
+ /** Pagination options for list operations. */
696
+ interface PaginationOptions {
697
+ offset?: number;
698
+ limit?: number;
699
+ }
700
+ /** Normalized API key. */
701
+ interface ApiKeyInfo {
702
+ id: string;
703
+ name: string;
704
+ apiKey?: string;
705
+ last8?: string;
706
+ createdAt?: string;
707
+ expiresAt?: string;
708
+ }
709
+ /** Paginated API key list. */
710
+ interface ApiKeyListResult {
711
+ apiKeys: ApiKeyInfo[];
712
+ nextOffset?: number;
713
+ }
714
+ /** Normalized customer app. */
715
+ interface CustomerAppInfo {
716
+ id?: string;
717
+ name: string;
718
+ description?: string;
719
+ raw: Record<string, unknown>;
720
+ }
721
+ /** Paginated customer app list. */
722
+ interface CustomerAppListResult {
723
+ apps: CustomerAppInfo[];
724
+ nextOffset?: number;
725
+ }
726
+ /**
727
+ * Per-app consumption + violation snapshot, normalized from the SDK's dashboard endpoints.
728
+ * Time window is fixed at construction.
729
+ */
730
+ interface CustomerAppConsumption {
731
+ appId: string;
732
+ appName: string;
733
+ cloud?: string;
734
+ source?: string;
735
+ /** ISO timestamp of first monitoring (corresponds to SCM panel's "Monitoring Since"). */
736
+ monitoringSince?: string;
737
+ /** Attached security profile names. */
738
+ profiles: string[];
739
+ /** Token consumption stats with scale qualifier (K = thousands, M = millions). */
740
+ tokens: {
741
+ dailyAverage?: number;
742
+ dailyAverageScale?: string;
743
+ monthlyTotal?: number;
744
+ monthlyTotalScale?: string;
745
+ };
746
+ /** Session activity counts over the window. */
747
+ sessions: {
748
+ total: number;
749
+ violating: number;
750
+ };
751
+ /** Per-detector violation severity counts, one entry per detection_type. */
752
+ detectors: Array<{
753
+ type: string;
754
+ critical: number;
755
+ high: number;
756
+ medium: number;
757
+ low: number;
758
+ total: number;
759
+ }>;
760
+ /** Sum of violating sessions across all detectors (mirrors SCM panel's badge). */
761
+ totalViolating: number;
762
+ }
763
+ /** Allowed values for `--time-interval`. The API enforces this enum (other values return 400). */
764
+ type ConsumptionTimeInterval = 7 | 30 | 60;
765
+ /** Options for {@link ManagementService.getCustomerAppConsumption}. */
766
+ interface ConsumptionQueryOptions {
767
+ timeInterval?: ConsumptionTimeInterval;
768
+ }
769
+ /**
770
+ * One entry from the dashboard's apps-overview enumeration.
771
+ *
772
+ * One per dashboard bucket. A single registered customer-app can produce multiple buckets when
773
+ * scan payloads sent under its API key carry different `metadata.app_name` values - the
774
+ * dashboard tracks each as its own bucket. The `id` field is the registered `customer_appId`
775
+ * UUID; the `name` field is the literal scan-payload value.
776
+ */
777
+ interface ConsumptionAppListEntry {
778
+ /** Registered customer_appId UUID. */
779
+ appId: string;
780
+ /** Dashboard bucket name (literal scan-payload `metadata.app_name`). */
781
+ appName: string;
782
+ /** Cloud provider tag, if reported by the dashboard. */
783
+ cloud?: string;
784
+ /** Origin of the bucket, e.g. 'api'. */
785
+ source?: string;
786
+ }
787
+ /** Normalized deployment profile. */
788
+ interface DeploymentProfileInfo {
789
+ raw: Record<string, unknown>;
790
+ }
791
+ /** Options for querying scan logs. */
792
+ interface ScanLogQueryOptions {
793
+ timeInterval: number;
794
+ timeUnit: string;
795
+ pageNumber: number;
796
+ pageSize: number;
797
+ filter: string;
798
+ pageToken?: string;
799
+ }
800
+ /** Scan log query result. */
801
+ interface ScanLogQueryResult {
802
+ results: Record<string, unknown>[];
803
+ pageToken?: string;
804
+ raw: Record<string, unknown>;
805
+ }
806
+ /** Contract for AIRS topic CRUD, profile CRUD, and profile linking operations. */
807
+ interface ManagementService {
808
+ /** Create a new custom topic. */
809
+ createTopic(request: CreateCustomTopicRequest): Promise<CustomTopic$1>;
810
+ /** Update an existing custom topic by ID. */
811
+ updateTopic(topicId: string, request: CreateCustomTopicRequest): Promise<CustomTopic$1>;
812
+ /** Delete a custom topic by ID. */
813
+ deleteTopic(topicId: string): Promise<void>;
814
+ /** Force-delete a custom topic (removes from all referencing profiles). */
815
+ forceDeleteTopic(topicId: string, updatedBy?: string): Promise<DeleteResponse>;
816
+ /** List all custom topics. */
817
+ listTopics(): Promise<CustomTopic$1[]>;
818
+ /** Get a single custom topic by ID. */
819
+ getTopic(topicId: string): Promise<CustomTopic$1>;
820
+ /** Get a single custom topic by name. */
821
+ getTopicByName(topicName: string): Promise<CustomTopic$1>;
822
+ /** Assign a topic to a security profile's topic-guardrails. */
823
+ assignTopicToProfile(profileName: string, topicId: string, topicName: string, action: 'allow' | 'block'): Promise<void>;
824
+ /** Assign multiple topics to a security profile's topic-guardrails. */
825
+ assignTopicsToProfile(profileName: string, topics: Array<{
826
+ topicId: string;
827
+ topicName: string;
828
+ action: 'allow' | 'block';
829
+ }>, guardrailAction?: 'allow' | 'block'): Promise<void>;
830
+ /** List all topics configured in a profile with full details. */
831
+ getProfileTopics(profileName: string): Promise<ProfileTopic[]>;
832
+ /** Get a single security profile by UUID. */
833
+ getProfile(profileId: string): Promise<SecurityProfileInfo>;
834
+ /** Get a single security profile by name (returns highest revision). */
835
+ getProfileByName(profileName: string): Promise<SecurityProfileInfo>;
836
+ /** List security profiles. */
837
+ listProfiles(opts?: PaginationOptions): Promise<SecurityProfileListResult>;
838
+ /** Create a security profile. */
839
+ createProfile(request: CreateSecurityProfileRequest): Promise<SecurityProfileInfo>;
840
+ /** Update a security profile. */
841
+ updateProfile(profileId: string, request: CreateSecurityProfileRequest): Promise<SecurityProfileInfo>;
842
+ /** Delete a security profile. */
843
+ deleteProfile(profileId: string): Promise<DeleteResponse>;
844
+ /** Force-delete a security profile (removes from referencing policies). */
845
+ forceDeleteProfile(profileId: string, updatedBy: string): Promise<DeleteResponse>;
846
+ listApiKeys(opts?: PaginationOptions): Promise<ApiKeyListResult>;
847
+ createApiKey(request: Record<string, unknown>): Promise<ApiKeyInfo>;
848
+ regenerateApiKey(apiKeyId: string, request: Record<string, unknown>): Promise<ApiKeyInfo>;
849
+ deleteApiKey(apiKeyName: string, updatedBy: string): Promise<DeleteResponse>;
850
+ listCustomerApps(opts?: PaginationOptions): Promise<CustomerAppListResult>;
851
+ getCustomerApp(appName: string): Promise<CustomerAppInfo>;
852
+ updateCustomerApp(appId: string, request: Record<string, unknown>): Promise<CustomerAppInfo>;
853
+ deleteCustomerApp(appName: string, updatedBy: string): Promise<CustomerAppInfo>;
854
+ /** Get per-app token consumption + violation breakdown from the SCM dashboard endpoints. */
855
+ getCustomerAppConsumption(appName: string, opts?: ConsumptionQueryOptions): Promise<CustomerAppConsumption>;
856
+ /**
857
+ * List dashboard application buckets - the canonical apps source for consumption reporting.
858
+ *
859
+ * Drawn from `dashboard.applicationsOverview`. One entry per dashboard bucket, which is one
860
+ * per distinct scan-payload `metadata.app_name` per registered customer-app. Distinct from
861
+ * {@link ManagementService.listCustomerApps}, which enumerates registered customer-apps
862
+ * (different granularity).
863
+ */
864
+ listConsumptionApps(opts?: {
865
+ limit?: number;
866
+ offset?: number;
867
+ }): Promise<ConsumptionAppListEntry[]>;
868
+ listDeploymentProfiles(opts?: {
869
+ unactivated?: boolean;
870
+ }): Promise<DeploymentProfileInfo[]>;
871
+ queryScanLogs(opts: ScanLogQueryOptions): Promise<ScanLogQueryResult>;
872
+ }
873
+
874
+ /**
875
+ * Wraps the SDK's ManagementClient to implement our ManagementService interface.
876
+ * OAuth2 token management, caching, and retry are handled by the SDK.
877
+ */
878
+ declare class SdkManagementService implements ManagementService {
879
+ private client;
880
+ constructor(opts?: ManagementClientOptions);
881
+ createTopic(request: CreateCustomTopicRequest): Promise<CustomTopic$1>;
882
+ updateTopic(topicId: string, request: CreateCustomTopicRequest): Promise<CustomTopic$1>;
883
+ deleteTopic(topicId: string): Promise<void>;
884
+ forceDeleteTopic(topicId: string, updatedBy?: string): Promise<DeleteResponse>;
885
+ listTopics(): Promise<CustomTopic$1[]>;
886
+ getTopic(topicId: string): Promise<CustomTopic$1>;
887
+ getTopicByName(topicName: string): Promise<CustomTopic$1>;
888
+ /**
889
+ * Sets a single custom topic on a profile's topic-guardrails config.
890
+ * Delegates to {@link assignTopicsToProfile} for backward compatibility.
891
+ */
892
+ assignTopicToProfile(profileName: string, topicId: string, topicName: string, action: 'allow' | 'block'): Promise<void>;
893
+ /**
894
+ * Sets one or more custom topics on a profile's topic-guardrails config.
895
+ * Replaces any existing topics — previous runs' stale topics are cleared.
896
+ * Groups topics by action; skips empty action groups (AIRS rejects them).
897
+ *
898
+ * CRITICAL: Each topic entry MUST include the current `revision` number.
899
+ * AIRS pins topic content to the revision specified in the profile — omitting
900
+ * it defaults to revision 0 (original content), not the latest.
901
+ */
902
+ assignTopicsToProfile(profileName: string, topics: Array<{
903
+ topicId: string;
904
+ topicName: string;
905
+ action: 'allow' | 'block';
906
+ }>, guardrailAction?: 'allow' | 'block'): Promise<void>;
907
+ getProfileTopics(profileName: string): Promise<ProfileTopic[]>;
908
+ private normalizeProfile;
909
+ getProfile(profileId: string): Promise<SecurityProfileInfo>;
910
+ getProfileByName(profileName: string): Promise<SecurityProfileInfo>;
911
+ listProfiles(opts?: PaginationOptions): Promise<SecurityProfileListResult>;
912
+ createProfile(request: CreateSecurityProfileRequest): Promise<SecurityProfileInfo>;
913
+ updateProfile(profileId: string, request: CreateSecurityProfileRequest): Promise<SecurityProfileInfo>;
914
+ deleteProfile(profileId: string): Promise<DeleteResponse>;
915
+ forceDeleteProfile(profileId: string, updatedBy: string): Promise<DeleteResponse>;
916
+ private normalizeApiKey;
917
+ listApiKeys(opts?: PaginationOptions): Promise<ApiKeyListResult>;
918
+ createApiKey(request: Record<string, unknown>): Promise<ApiKeyInfo>;
919
+ regenerateApiKey(apiKeyId: string, request: Record<string, unknown>): Promise<ApiKeyInfo>;
920
+ deleteApiKey(apiKeyName: string, updatedBy: string): Promise<DeleteResponse>;
921
+ private normalizeCustomerApp;
922
+ listCustomerApps(opts?: PaginationOptions): Promise<CustomerAppListResult>;
923
+ getCustomerApp(appName: string): Promise<CustomerAppInfo>;
924
+ updateCustomerApp(appId: string, request: Record<string, unknown>): Promise<CustomerAppInfo>;
925
+ deleteCustomerApp(appName: string, updatedBy: string): Promise<CustomerAppInfo>;
926
+ listConsumptionApps(opts?: {
927
+ limit?: number;
928
+ offset?: number;
929
+ }): Promise<ConsumptionAppListEntry[]>;
930
+ getCustomerAppConsumption(appName: string, opts?: ConsumptionQueryOptions): Promise<CustomerAppConsumption>;
931
+ listDeploymentProfiles(opts?: {
932
+ unactivated?: boolean;
933
+ }): Promise<DeploymentProfileInfo[]>;
934
+ queryScanLogs(opts: ScanLogQueryOptions): Promise<ScanLogQueryResult>;
935
+ }
936
+
937
+ /**
938
+ * Wraps the SDK's ModelSecurityClient to implement ModelSecurityService.
939
+ * Provides security group CRUD, rule browsing, scan operations, and label management.
940
+ */
941
+ declare class SdkModelSecurityService implements ModelSecurityService {
942
+ private client;
943
+ constructor(opts?: ModelSecurityClientOptions);
944
+ listGroups(opts?: ModelSecurityGroupListOptions): Promise<{
945
+ totalItems: number;
946
+ groups: ModelSecurityGroup[];
947
+ }>;
948
+ getGroup(uuid: string): Promise<ModelSecurityGroup>;
949
+ createGroup(request: ModelSecurityGroupCreateRequest): Promise<ModelSecurityGroup>;
950
+ updateGroup(uuid: string, request: ModelSecurityGroupUpdateRequest): Promise<ModelSecurityGroup>;
951
+ deleteGroup(uuid: string): Promise<void>;
952
+ /**
953
+ * Delete a group, then verify whether it is actually gone. The API soft/async-deletes
954
+ * security groups — a successful DELETE does not immediately remove the resource, so a
955
+ * follow-up `get` may still return it as ACTIVE (see prisma-airs-cli#239). The SDK delete
956
+ * returns void, so re-reading is the only way to report the real outcome rather than
957
+ * claiming an unconditional success. Returns `{ confirmed: true }` when the group no longer
958
+ * resolves, or `{ confirmed: false, state }` when it still does.
959
+ */
960
+ deleteGroupAndVerify(uuid: string): Promise<{
961
+ confirmed: boolean;
962
+ state?: string;
963
+ }>;
964
+ listRuleInstances(groupUuid: string, opts?: ModelSecurityRuleInstanceListOptions): Promise<{
965
+ totalItems: number;
966
+ ruleInstances: ModelSecurityRuleInstance[];
967
+ }>;
968
+ getRuleInstance(groupUuid: string, instanceUuid: string): Promise<ModelSecurityRuleInstance>;
969
+ updateRuleInstance(groupUuid: string, instanceUuid: string, request: ModelSecurityRuleInstanceUpdateRequest): Promise<ModelSecurityRuleInstance>;
970
+ listRules(opts?: ModelSecurityRuleListOptions): Promise<{
971
+ totalItems: number;
972
+ rules: ModelSecurityRule[];
973
+ }>;
974
+ getRule(uuid: string): Promise<ModelSecurityRule>;
975
+ createScan(request: Record<string, unknown>): Promise<ModelSecurityScan>;
976
+ listScans(opts?: ModelSecurityScanListOptions): Promise<{
977
+ totalItems: number;
978
+ scans: ModelSecurityScan[];
979
+ }>;
980
+ getScan(uuid: string): Promise<ModelSecurityScan>;
981
+ getEvaluations(scanUuid: string, opts?: {
982
+ skip?: number;
983
+ limit?: number;
984
+ }): Promise<{
985
+ totalItems: number;
986
+ evaluations: ModelSecurityEvaluation[];
987
+ }>;
988
+ getEvaluation(uuid: string): Promise<ModelSecurityEvaluation>;
989
+ getViolations(scanUuid: string, opts?: {
990
+ skip?: number;
991
+ limit?: number;
992
+ }): Promise<{
993
+ totalItems: number;
994
+ violations: ModelSecurityViolation[];
995
+ }>;
996
+ getViolation(uuid: string): Promise<ModelSecurityViolation>;
997
+ getFiles(scanUuid: string, opts?: ModelSecurityFileListOptions): Promise<{
998
+ totalItems: number;
999
+ files: ModelSecurityFile[];
1000
+ }>;
1001
+ addLabels(scanUuid: string, labels: ModelSecurityLabel[]): Promise<void>;
1002
+ setLabels(scanUuid: string, labels: ModelSecurityLabel[]): Promise<void>;
1003
+ deleteLabels(scanUuid: string, keys: string[]): Promise<void>;
1004
+ getLabelKeys(opts?: {
1005
+ skip?: number;
1006
+ limit?: number;
1007
+ }): Promise<{
1008
+ totalItems: number;
1009
+ keys: string[];
1010
+ }>;
1011
+ getLabelValues(key: string, opts?: {
1012
+ skip?: number;
1013
+ limit?: number;
1014
+ }): Promise<{
1015
+ totalItems: number;
1016
+ values: string[];
1017
+ }>;
1018
+ getPyPIAuth(): Promise<ModelSecurityPyPIAuth>;
1019
+ }
1020
+
1021
+ /**
1022
+ * Wraps the SDK's RedTeamClient.customAttacks to implement PromptSetService.
1023
+ * Creates and populates custom prompt sets for AI Red Team.
1024
+ */
1025
+ declare class SdkPromptSetService implements PromptSetService {
1026
+ private client;
1027
+ constructor(opts?: RedTeamClientOptions);
1028
+ createPromptSet(name: string, description?: string): Promise<{
1029
+ uuid: string;
1030
+ name: string;
1031
+ }>;
1032
+ addPrompt(promptSetId: string, prompt: string, goal?: string): Promise<{
1033
+ uuid: string;
1034
+ prompt: string;
1035
+ }>;
1036
+ listPromptSets(): Promise<Array<{
1037
+ uuid: string;
1038
+ name: string;
1039
+ active: boolean;
1040
+ }>>;
1041
+ getPromptSet(uuid: string): Promise<PromptSetDetail>;
1042
+ updatePromptSet(uuid: string, request: {
1043
+ name?: string;
1044
+ description?: string;
1045
+ }): Promise<PromptSetDetail>;
1046
+ archivePromptSet(uuid: string, archive: boolean): Promise<void>;
1047
+ getPromptSetVersionInfo(uuid: string): Promise<PromptSetVersionInfo>;
1048
+ /**
1049
+ * Fetch a prompt set and its version info in one call, degrading gracefully when the
1050
+ * version-info endpoint is unavailable. The upstream `/version-info` route currently
1051
+ * returns 500 for every prompt set (see prisma-airs-cli#117); without this, a 500 there
1052
+ * would abort the whole `prompt-sets get` command even though the set itself fetched fine.
1053
+ * The set is always returned; `versionInfo` is `undefined` when that lookup fails.
1054
+ */
1055
+ getPromptSetWithVersionInfo(uuid: string): Promise<{
1056
+ set: PromptSetDetail;
1057
+ versionInfo?: PromptSetVersionInfo;
1058
+ }>;
1059
+ downloadTemplate(uuid: string): Promise<string>;
1060
+ uploadPromptsCsv(uuid: string, file: Blob): Promise<{
1061
+ message: string;
1062
+ status: number;
1063
+ }>;
1064
+ listPrompts(setUuid: string, opts?: {
1065
+ limit?: number;
1066
+ skip?: number;
1067
+ }): Promise<PromptDetail[]>;
1068
+ getPrompt(setUuid: string, promptUuid: string): Promise<PromptDetail>;
1069
+ updatePrompt(setUuid: string, promptUuid: string, request: {
1070
+ prompt?: string;
1071
+ goal?: string;
1072
+ }): Promise<PromptDetail>;
1073
+ deletePrompt(setUuid: string, promptUuid: string): Promise<void>;
1074
+ getPropertyNames(): Promise<string[]>;
1075
+ createPropertyName(name: string): Promise<MutationResponse>;
1076
+ getPropertyValues(name: string): Promise<PropertyValueList>;
1077
+ createPropertyValue(name: string, value: string): Promise<MutationResponse>;
1078
+ }
1079
+
1080
+ /**
1081
+ * Wraps the SDK's RedTeamClient to implement RedTeamService.
1082
+ * Provides scan creation, status polling, report retrieval, and target/category listing.
1083
+ */
1084
+ declare class SdkRedTeamService implements RedTeamService {
1085
+ private client;
1086
+ constructor(opts?: RedTeamClientOptions);
1087
+ getEulaContent(): Promise<EulaContent>;
1088
+ getEulaStatus(): Promise<EulaStatus>;
1089
+ acceptEula(eulaContent: string): Promise<EulaStatus>;
1090
+ createInstance(request: InstanceRequest): Promise<InstanceResponse>;
1091
+ getInstance(tenantId: string): Promise<InstanceDetail>;
1092
+ updateInstance(tenantId: string, request: InstanceRequest): Promise<InstanceResponse>;
1093
+ deleteInstance(tenantId: string): Promise<InstanceResponse>;
1094
+ createDevices(tenantId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
1095
+ updateDevices(tenantId: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
1096
+ deleteDevices(tenantId: string, serialNumbers: string): Promise<Record<string, unknown>>;
1097
+ getRegistryCredentials(): Promise<RegistryCredentials>;
1098
+ validateTargetAuth(request: TargetAuthValidationRequest): Promise<TargetAuthValidationResult>;
1099
+ getTargetMetadata(): Promise<Record<string, unknown>>;
1100
+ getTargetTemplates(): Promise<Record<string, unknown>>;
1101
+ listTargets(): Promise<RedTeamTarget[]>;
1102
+ getTarget(uuid: string): Promise<RedTeamTargetDetail>;
1103
+ createTarget(request: RedTeamTargetCreateRequest, opts?: TargetOperationOptions): Promise<RedTeamTargetDetail>;
1104
+ updateTarget(uuid: string, request: RedTeamTargetUpdateRequest, opts?: TargetOperationOptions): Promise<RedTeamTargetDetail>;
1105
+ deleteTarget(uuid: string): Promise<void>;
1106
+ probeTarget(request: Record<string, unknown>): Promise<Record<string, unknown>>;
1107
+ getTargetProfile(uuid: string): Promise<Record<string, unknown>>;
1108
+ updateTargetProfile(uuid: string, request: Record<string, unknown>): Promise<Record<string, unknown>>;
1109
+ createScan(request: {
1110
+ name: string;
1111
+ targetUuid: string;
1112
+ jobType: string;
1113
+ categories?: Record<string, unknown>;
1114
+ customPromptSets?: string[];
1115
+ attackGoals?: string[];
1116
+ streamDepth?: number;
1117
+ streamBreadth?: number;
1118
+ }): Promise<RedTeamJob>;
1119
+ getScan(jobId: string): Promise<RedTeamJob>;
1120
+ listScans(opts?: {
1121
+ status?: string;
1122
+ jobType?: string;
1123
+ targetId?: string;
1124
+ limit?: number;
1125
+ }): Promise<RedTeamJob[]>;
1126
+ abortScan(jobId: string): Promise<void>;
1127
+ getStaticReport(jobId: string): Promise<RedTeamStaticReport>;
1128
+ getDynamicReport(jobId: string): Promise<RedTeamDynamicReport>;
1129
+ getCustomReport(jobId: string): Promise<RedTeamCustomReport>;
1130
+ listAttacks(jobId: string, opts?: {
1131
+ severity?: string;
1132
+ limit?: number;
1133
+ }): Promise<{
1134
+ attacks: RedTeamAttack[];
1135
+ totalItems?: number;
1136
+ }>;
1137
+ listCustomAttacks(jobId: string, opts?: {
1138
+ limit?: number;
1139
+ }): Promise<RedTeamCustomAttack[]>;
1140
+ getCategories(): Promise<RedTeamCategory[]>;
1141
+ waitForCompletion(jobId: string, onProgress?: (job: RedTeamJob) => void, intervalMs?: number): Promise<RedTeamJob>;
1142
+ }
1143
+
1144
+ interface PollRetryOptions {
1145
+ /** Max retries per rate-limit error before giving up. Default: 5. */
1146
+ maxRetries?: number;
1147
+ /** Base delay in ms for exponential backoff. Default: 10000. */
1148
+ baseDelayMs?: number;
1149
+ /** Called on each retry with (attempt, delayMs). */
1150
+ onRetry?: (attempt: number, delayMs: number) => void;
1151
+ }
1152
+ declare class SdkRuntimeService implements RuntimeService {
1153
+ private scanner;
1154
+ constructor(opts: InitOptions);
1155
+ scanPrompt(profileName: string, prompt: string, response?: string): Promise<RuntimeScanResult>;
1156
+ submitBulkScan(profileName: string, prompts: string[], sessionId?: string): Promise<string[]>;
1157
+ /**
1158
+ * Poll async scan results until all complete or fail.
1159
+ *
1160
+ * Note: The async query API (`queryByScanIds`) does not return `prompt`,
1161
+ * `response`, `triggered`, or `detections` fields. These are set to
1162
+ * defaults (`''`, `undefined`, `false`, `{}`) in the returned results.
1163
+ * Use `scanPrompt()` (sync API) when these fields are needed.
1164
+ */
1165
+ pollResults(scanIds: string[], intervalMs?: number, retryOpts?: PollRetryOptions): Promise<RuntimeScanResult[]>;
1166
+ private processQueryResults;
1167
+ static formatResultsCsv(results: RuntimeScanResult[]): string;
1168
+ }
1169
+
1170
+ /** Scans prompts against AIRS security profiles via the Prisma AIRS SDK. */
1171
+ declare class AirsScanService implements ScanService {
1172
+ private scanner;
1173
+ constructor(opts: InitOptions);
1174
+ /** Scan a single prompt synchronously and return the normalized result. */
1175
+ scan(profileName: string, prompt: string, sessionId?: string): Promise<ScanResult>;
1176
+ /** Scan multiple prompts concurrently (default 5) and return results in order. */
1177
+ scanBatch(profileName: string, prompts: string[], concurrency?: number, sessionId?: string): Promise<ScanResult[]>;
1178
+ }
1179
+
1180
+ /** Supported backup serialization formats. */
1181
+ type BackupFormat = 'json' | 'yaml';
1182
+ /** Discriminator for multi-resource backup directories. */
1183
+ type ResourceType = 'redteam-target';
1184
+ /** Envelope wrapping any backed-up resource. */
1185
+ interface BackupEnvelope<T> {
1186
+ version: string;
1187
+ resourceType: ResourceType;
1188
+ exportedAt: string;
1189
+ data: T;
1190
+ }
1191
+ /** Per-target result reported after a backup run. */
1192
+ interface BackupResult {
1193
+ name: string;
1194
+ filename: string;
1195
+ status: 'ok' | 'failed';
1196
+ error?: string;
1197
+ }
1198
+ /** Per-target result reported after a restore run. */
1199
+ interface RestoreResult {
1200
+ name: string;
1201
+ action: 'created' | 'updated' | 'skipped' | 'failed';
1202
+ error?: string;
1203
+ }
1204
+
1205
+ /**
1206
+ * Sanitize a resource name into a filesystem-safe filename (no extension).
1207
+ * Lowercases, replaces non-alphanumeric with hyphens, collapses runs, trims.
1208
+ */
1209
+ declare function sanitizeFilename(name: string): string;
1210
+ /** Resolve output directory — user-specified or default `./airs-backup/<subdir>/`. */
1211
+ declare function resolveOutputDir(userDir: string | undefined, defaultSubdir: string): string;
1212
+ /** Serialize envelope and write to `dir/filename.{json|yaml}`. Creates dir if needed. */
1213
+ declare function writeBackupFile<T>(dir: string, filename: string, envelope: BackupEnvelope<T>, format: BackupFormat): void;
1214
+ /** Read and parse a single backup file. Detects format from extension. */
1215
+ declare function readBackupFile<T>(filePath: string): BackupEnvelope<T>;
1216
+ /** Read all backup files from a directory, filtering by resourceType. */
1217
+ declare function readBackupDir<T>(dirPath: string, resourceType: ResourceType): BackupEnvelope<T>[];
1218
+
1219
+ declare const ConfigSchema: z.ZodObject<{
1220
+ airsApiKey: z.ZodOptional<z.ZodString>;
1221
+ airsApiToken: z.ZodOptional<z.ZodString>;
1222
+ airsApiEndpoint: z.ZodOptional<z.ZodString>;
1223
+ airsNumRetries: z.ZodOptional<z.ZodNumber>;
1224
+ mgmtClientId: z.ZodOptional<z.ZodString>;
1225
+ mgmtClientSecret: z.ZodOptional<z.ZodString>;
1226
+ mgmtTsgId: z.ZodOptional<z.ZodString>;
1227
+ mgmtEndpoint: z.ZodOptional<z.ZodString>;
1228
+ mgmtTokenEndpoint: z.ZodOptional<z.ZodString>;
1229
+ dlpEndpoint: z.ZodOptional<z.ZodString>;
1230
+ redTeamDataEndpoint: z.ZodOptional<z.ZodString>;
1231
+ redTeamMgmtEndpoint: z.ZodOptional<z.ZodString>;
1232
+ redTeamTokenEndpoint: z.ZodOptional<z.ZodString>;
1233
+ modelSecDataEndpoint: z.ZodOptional<z.ZodString>;
1234
+ modelSecMgmtEndpoint: z.ZodOptional<z.ZodString>;
1235
+ modelSecTokenEndpoint: z.ZodOptional<z.ZodString>;
1236
+ scanConcurrency: z.ZodDefault<z.ZodNumber>;
1237
+ dataDir: z.ZodDefault<z.ZodString>;
1238
+ }, "strip", z.ZodTypeAny, {
1239
+ scanConcurrency: number;
1240
+ dataDir: string;
1241
+ airsApiKey?: string | undefined;
1242
+ airsApiToken?: string | undefined;
1243
+ airsApiEndpoint?: string | undefined;
1244
+ airsNumRetries?: number | undefined;
1245
+ mgmtClientId?: string | undefined;
1246
+ mgmtClientSecret?: string | undefined;
1247
+ mgmtTsgId?: string | undefined;
1248
+ mgmtEndpoint?: string | undefined;
1249
+ mgmtTokenEndpoint?: string | undefined;
1250
+ dlpEndpoint?: string | undefined;
1251
+ redTeamDataEndpoint?: string | undefined;
1252
+ redTeamMgmtEndpoint?: string | undefined;
1253
+ redTeamTokenEndpoint?: string | undefined;
1254
+ modelSecDataEndpoint?: string | undefined;
1255
+ modelSecMgmtEndpoint?: string | undefined;
1256
+ modelSecTokenEndpoint?: string | undefined;
1257
+ }, {
1258
+ airsApiKey?: string | undefined;
1259
+ airsApiToken?: string | undefined;
1260
+ airsApiEndpoint?: string | undefined;
1261
+ airsNumRetries?: number | undefined;
1262
+ mgmtClientId?: string | undefined;
1263
+ mgmtClientSecret?: string | undefined;
1264
+ mgmtTsgId?: string | undefined;
1265
+ mgmtEndpoint?: string | undefined;
1266
+ mgmtTokenEndpoint?: string | undefined;
1267
+ dlpEndpoint?: string | undefined;
1268
+ redTeamDataEndpoint?: string | undefined;
1269
+ redTeamMgmtEndpoint?: string | undefined;
1270
+ redTeamTokenEndpoint?: string | undefined;
1271
+ modelSecDataEndpoint?: string | undefined;
1272
+ modelSecMgmtEndpoint?: string | undefined;
1273
+ modelSecTokenEndpoint?: string | undefined;
1274
+ scanConcurrency?: number | undefined;
1275
+ dataDir?: string | undefined;
1276
+ }>;
1277
+ type Config = z.infer<typeof ConfigSchema>;
1278
+
1279
+ declare function loadConfig(cliOverrides?: Record<string, unknown>, configFilePath?: string): Promise<Config>;
1280
+
1281
+ /**
1282
+ * Core domain types — shared across all Prisma AIRS CLI modules.
1283
+ */
1284
+ interface CustomTopic {
1285
+ name: string;
1286
+ description: string;
1287
+ examples: string[];
1288
+ }
1289
+ interface UserInput {
1290
+ topicDescription: string;
1291
+ intent: 'allow' | 'block';
1292
+ seedExamples?: string[];
1293
+ profileName: string;
1294
+ maxIterations?: number;
1295
+ targetCoverage?: number;
1296
+ maxRegressions?: number;
1297
+ plateauWindow?: number;
1298
+ plateauBand?: number;
1299
+ accumulateTests?: boolean;
1300
+ maxAccumulatedTests?: number;
1301
+ createPromptSet?: boolean;
1302
+ promptSetName?: string;
1303
+ /** Max AIRS scan API calls per second. Undefined = unlimited. */
1304
+ scanRate?: number;
1305
+ }
1306
+ interface TestCase {
1307
+ prompt: string;
1308
+ expectedTriggered: boolean;
1309
+ category: string;
1310
+ /** How this test entered the suite. Default: 'generated'. */
1311
+ source?: 'generated' | 'carried-fp' | 'carried-fn' | 'regression';
1312
+ /** Which topic this test targets (used by audit). */
1313
+ targetTopic?: string;
1314
+ }
1315
+ /** Per-category error breakdown from a previous iteration's results. */
1316
+ interface CategoryBreakdown {
1317
+ category: string;
1318
+ total: number;
1319
+ fp: number;
1320
+ fn: number;
1321
+ errorRate: number;
1322
+ }
1323
+ interface TestResult {
1324
+ testCase: TestCase;
1325
+ actualTriggered: boolean;
1326
+ scanAction: 'allow' | 'block';
1327
+ scanId: string;
1328
+ reportId: string;
1329
+ correct: boolean;
1330
+ }
1331
+ interface EfficacyMetrics {
1332
+ truePositives: number;
1333
+ trueNegatives: number;
1334
+ falsePositives: number;
1335
+ falseNegatives: number;
1336
+ truePositiveRate: number;
1337
+ trueNegativeRate: number;
1338
+ accuracy: number;
1339
+ coverage: number;
1340
+ f1Score: number;
1341
+ /** Count of regression-tier tests that failed (previously correct, now wrong). */
1342
+ regressionCount: number;
1343
+ }
1344
+ interface AnalysisReport {
1345
+ summary: string;
1346
+ falsePositivePatterns: string[];
1347
+ falseNegativePatterns: string[];
1348
+ suggestions: string[];
1349
+ }
1350
+ interface IterationResult {
1351
+ iteration: number;
1352
+ timestamp: string;
1353
+ topic: CustomTopic;
1354
+ testCases: TestCase[];
1355
+ testResults: TestResult[];
1356
+ metrics: EfficacyMetrics;
1357
+ analysis: AnalysisReport;
1358
+ durationMs: number;
1359
+ }
1360
+ interface RunState {
1361
+ id: string;
1362
+ createdAt: string;
1363
+ updatedAt: string;
1364
+ userInput: UserInput;
1365
+ iterations: IterationResult[];
1366
+ currentIteration: number;
1367
+ bestIteration: number;
1368
+ bestCoverage: number;
1369
+ consecutiveRegressions: number;
1370
+ hasRevertedToBest: boolean;
1371
+ hasTriedSimplification: boolean;
1372
+ /** Companion allow topic created for block-intent two-phase generation. */
1373
+ companionTopic?: CustomTopic;
1374
+ status: 'running' | 'paused' | 'completed' | 'failed';
1375
+ }
1376
+
1377
+ interface ValidationError {
1378
+ field: string;
1379
+ message: string;
1380
+ }
1381
+ declare function validateName(name: string): ValidationError[];
1382
+ declare function validateDescription(description: string): ValidationError[];
1383
+ declare function validateExamples(examples: string[]): ValidationError[];
1384
+ declare function validateTopic(topic: CustomTopic): ValidationError[];
1385
+
1386
+ /**
1387
+ * Classify test results into TP/TN/FP/FN and compute efficacy metrics.
3
1388
  *
4
- * Automated generation, testing, and iterative refinement of
5
- * Palo Alto Prisma AIRS custom topic guardrails.
6
- */
7
- export { SdkManagementService } from './airs/management.js';
8
- export { SdkModelSecurityService } from './airs/modelsecurity.js';
9
- export { SdkPromptSetService } from './airs/promptsets.js';
10
- export { SdkRedTeamService } from './airs/redteam.js';
11
- export { SdkRuntimeService } from './airs/runtime.js';
12
- export { AirsScanService } from './airs/scanner.js';
13
- export type { ModelSecurityEvaluation, ModelSecurityFile, ModelSecurityFileListOptions, ModelSecurityGroup, ModelSecurityGroupCreateRequest, ModelSecurityGroupListOptions, ModelSecurityGroupUpdateRequest, ModelSecurityLabel, ModelSecurityPyPIAuth, ModelSecurityRule, ModelSecurityRuleEditableField, ModelSecurityRuleInstance, ModelSecurityRuleInstanceListOptions, ModelSecurityRuleInstanceUpdateRequest, ModelSecurityRuleListOptions, ModelSecurityScan, ModelSecurityScanListOptions, ModelSecurityService, ModelSecurityViolation, PromptDetail, PromptSetDetail, PromptSetService, PromptSetVersionInfo, PropertyName, PropertyValue, RedTeamAttack, RedTeamCategory, RedTeamCustomAttack, RedTeamCustomReport, RedTeamJob, RedTeamService, RedTeamStaticReport, RedTeamTarget, RedTeamTargetCreateRequest, RedTeamTargetDetail, RedTeamTargetUpdateRequest, RuntimeScanResult, RuntimeService, TargetOperationOptions, } from './airs/types.js';
14
- export { computeCompositeMetrics, computeTopicAuditResults, detectConflicts, } from './audit/evaluator.js';
15
- export { buildAuditReportHtml, buildAuditReportJson } from './audit/report.js';
16
- export { runAudit } from './audit/runner.js';
17
- export type { AuditEvent, AuditResult, ConflictPair, ProfileTopic, TopicAuditResult, } from './audit/types.js';
18
- export { readBackupDir, readBackupFile, resolveOutputDir, sanitizeFilename, writeBackupFile, } from './backup/io.js';
19
- export type { BackupEnvelope, BackupFormat, BackupResult, ResourceType, RestoreResult, } from './backup/types.js';
20
- export { loadConfig } from './config/loader.js';
21
- export type { ValidationError } from './core/constraints.js';
22
- export { validateDescription, validateExamples, validateName, validateTopic, } from './core/constraints.js';
23
- export { computeCategoryBreakdown, computeMetrics } from './core/metrics.js';
24
- export type { AnalysisReport, CategoryBreakdown, CustomTopic, EfficacyMetrics, IterationResult, RunState, TestCase, TestResult, UserInput, } from './core/types.js';
25
- export { buildReportHtml } from './report/html.js';
26
- export { buildReportJson } from './report/json.js';
27
- export type { IterationSummary, MetricsDelta, ReportOutput, RunDiff, RunSummary, TestDetail, } from './report/types.js';
28
- //# sourceMappingURL=index.d.ts.map
1389
+ * @param results - Scan results paired with their expected outcomes.
1390
+ * @returns Confusion matrix counts, rates (TPR, TNR, accuracy, coverage, F1),
1391
+ * and regression failure count. Division-by-zero yields 0.
1392
+ * Coverage = min(TPR, TNR) — the loop's stop condition target.
1393
+ */
1394
+ declare function computeMetrics(results: TestResult[]): EfficacyMetrics;
1395
+ /** Compute per-category error breakdown from test results. Sorted by error rate descending. */
1396
+ declare function computeCategoryBreakdown(results: TestResult[]): CategoryBreakdown[];
1397
+
1398
+ export { AirsScanService, type AnalysisReport, type BackupEnvelope, type BackupFormat, type BackupResult, type CategoryBreakdown, type CustomTopic, type EfficacyMetrics, type IterationResult, type ModelSecurityEvaluation, type ModelSecurityFile, type ModelSecurityFileListOptions, type ModelSecurityGroup, type ModelSecurityGroupCreateRequest, type ModelSecurityGroupListOptions, type ModelSecurityGroupUpdateRequest, type ModelSecurityLabel, type ModelSecurityPyPIAuth, type ModelSecurityRule, type ModelSecurityRuleEditableField, type ModelSecurityRuleInstance, type ModelSecurityRuleInstanceListOptions, type ModelSecurityRuleInstanceUpdateRequest, type ModelSecurityRuleListOptions, type ModelSecurityScan, type ModelSecurityScanListOptions, type ModelSecurityService, type ModelSecurityViolation, type MutationResponse, type ProfileTopic, type PromptDetail, type PromptSetDetail, type PromptSetService, type PromptSetVersionInfo, type PropertyValueList, type RedTeamAttack, type RedTeamCategory, type RedTeamCustomAttack, type RedTeamCustomReport, type RedTeamJob, type RedTeamService, type RedTeamStaticReport, type RedTeamTarget, type RedTeamTargetCreateRequest, type RedTeamTargetDetail, type RedTeamTargetUpdateRequest, type ResourceType, type RestoreResult, type RunState, type RuntimeScanResult, type RuntimeService, SdkManagementService, SdkModelSecurityService, SdkPromptSetService, SdkRedTeamService, SdkRuntimeService, type TargetOperationOptions, type TestCase, type TestResult, type UserInput, type ValidationError, computeCategoryBreakdown, computeMetrics, loadConfig, readBackupDir, readBackupFile, resolveOutputDir, sanitizeFilename, validateDescription, validateExamples, validateName, validateTopic, writeBackupFile };