@zivis/mcp 0.1.0-alpha.9 → 0.1.6

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 (328) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +19 -0
  3. package/dist/api-client.d.ts +1 -31
  4. package/dist/api-client.js +26 -66
  5. package/dist/auth/index.d.ts +1 -22
  6. package/dist/auth/index.js +15 -46
  7. package/dist/auth/jwt.d.ts +0 -16
  8. package/dist/auth/jwt.js +0 -13
  9. package/dist/auth/keychain.d.ts +6 -32
  10. package/dist/auth/keychain.js +83 -114
  11. package/dist/auth/oauth.d.ts +1 -42
  12. package/dist/auth/oauth.js +22 -64
  13. package/dist/auth/sessions.d.ts +5 -25
  14. package/dist/auth/sessions.js +20 -39
  15. package/dist/auth/token-refresh.d.ts +2 -22
  16. package/dist/auth/token-refresh.js +12 -47
  17. package/dist/cli.d.ts +1 -18
  18. package/dist/cli.js +30 -908
  19. package/dist/index.d.ts +0 -6
  20. package/dist/index.js +0 -7
  21. package/dist/lib/inspect-cache.d.ts +10 -0
  22. package/dist/lib/inspect-cache.js +75 -0
  23. package/dist/lib/next-steps.d.ts +27 -0
  24. package/dist/lib/next-steps.js +21 -0
  25. package/dist/matcher/ast-eval.d.ts +8 -0
  26. package/dist/matcher/ast-eval.js +95 -0
  27. package/dist/matcher/finding.d.ts +55 -0
  28. package/dist/matcher/finding.js +1 -0
  29. package/dist/matcher/index.d.ts +8 -0
  30. package/dist/matcher/index.js +202 -0
  31. package/dist/matcher/inference-candidates.d.ts +26 -0
  32. package/dist/matcher/inference-candidates.js +81 -0
  33. package/dist/matcher/walker.d.ts +7 -0
  34. package/dist/matcher/walker.js +71 -0
  35. package/dist/pattern-pack/index.d.ts +125 -0
  36. package/dist/pattern-pack/index.js +189 -0
  37. package/dist/pattern-packs/zivis-public-0.2.0/capsules/agents/privilege-separation.yaml +224 -0
  38. package/dist/pattern-packs/zivis-public-0.2.0/capsules/prompting/self-consistency-no-isolation.yaml +237 -0
  39. package/dist/pattern-packs/zivis-public-0.2.0/capsules/retrieval/context-injection-no-validator.yaml +348 -0
  40. package/dist/pattern-packs/zivis-public-0.2.0/capsules/security/late-org-filter.yaml +266 -0
  41. package/dist/pattern-packs/zivis-public-0.2.0/controls/external_validator_on_facts.yaml +37 -0
  42. package/dist/pattern-packs/zivis-public-0.2.0/controls/fact_validator_present.yaml +68 -0
  43. package/dist/pattern-packs/zivis-public-0.2.0/controls/human_approval_gate.yaml +44 -0
  44. package/dist/pattern-packs/zivis-public-0.2.0/controls/langgraph_state_machine_with_per_node_tools.yaml +35 -0
  45. package/dist/pattern-packs/zivis-public-0.2.0/controls/per_sample_retrieval_diversification.yaml +38 -0
  46. package/dist/pattern-packs/zivis-public-0.2.0/controls/prisma_extension_or_middleware_attaching_org_filter.yaml +31 -0
  47. package/dist/pattern-packs/zivis-public-0.2.0/controls/row_level_security_policy.yaml +37 -0
  48. package/dist/pattern-packs/zivis-public-0.2.0/controls/source_attribution_present.yaml +58 -0
  49. package/dist/pattern-packs/zivis-public-0.2.0/manifest.json +167 -0
  50. package/dist/pattern-packs/zivis-public-0.2.0/prompts/agents/privilege-separation/identify.md +54 -0
  51. package/dist/pattern-packs/zivis-public-0.2.0/prompts/prompting/self-consistency-no-isolation/identify.md +60 -0
  52. package/dist/pattern-packs/zivis-public-0.2.0/prompts/retrieval/context-injection-no-validator/identify.md +109 -0
  53. package/dist/pattern-packs/zivis-public-0.2.0/prompts/security/late-org-filter/identify.md +78 -0
  54. package/dist/project-binding.d.ts +2 -19
  55. package/dist/project-binding.js +38 -21
  56. package/dist/prompts/audit-dependencies.d.ts +2 -0
  57. package/dist/prompts/audit-dependencies.js +47 -0
  58. package/dist/prompts/getting-started.d.ts +2 -0
  59. package/dist/prompts/getting-started.js +37 -0
  60. package/dist/prompts/index.d.ts +2 -0
  61. package/dist/prompts/index.js +6 -0
  62. package/dist/resolve-application-id.d.ts +0 -4
  63. package/dist/resolve-application-id.js +0 -5
  64. package/dist/sanitize.d.ts +1 -21
  65. package/dist/sanitize.js +7 -41
  66. package/dist/server.d.ts +1 -13
  67. package/dist/server.js +134 -253
  68. package/dist/tools/artifacts.d.ts +76 -0
  69. package/dist/tools/artifacts.js +178 -0
  70. package/dist/tools/check-project.d.ts +5 -18
  71. package/dist/tools/check-project.js +120 -111
  72. package/dist/tools/check-repo-trust.d.ts +4 -19
  73. package/dist/tools/check-repo-trust.js +56 -47
  74. package/dist/tools/create-diagram.d.ts +0 -5
  75. package/dist/tools/create-diagram.js +0 -10
  76. package/dist/tools/create-document.d.ts +0 -5
  77. package/dist/tools/create-document.js +3 -9
  78. package/dist/tools/create-finding.d.ts +85 -0
  79. package/dist/tools/create-finding.js +136 -0
  80. package/dist/tools/delete-finding.d.ts +19 -0
  81. package/dist/tools/delete-finding.js +36 -0
  82. package/dist/tools/discover-local-infra.d.ts +0 -10
  83. package/dist/tools/discover-local-infra.js +3 -73
  84. package/dist/tools/enterprise/get-org-zat.d.ts +0 -5
  85. package/dist/tools/enterprise/get-org-zat.js +0 -6
  86. package/dist/tools/enterprise/get-threat-model.d.ts +1 -8
  87. package/dist/tools/enterprise/get-threat-model.js +9 -31
  88. package/dist/tools/enterprise/list-attack-scenarios.d.ts +24 -0
  89. package/dist/tools/enterprise/list-attack-scenarios.js +63 -0
  90. package/dist/tools/enterprise/list-threat-models.d.ts +1 -6
  91. package/dist/tools/enterprise/list-threat-models.js +1 -9
  92. package/dist/tools/enterprise/manage-actor.d.ts +2 -7
  93. package/dist/tools/enterprise/manage-actor.js +13 -7
  94. package/dist/tools/enterprise/manage-attack-scenario.d.ts +1 -6
  95. package/dist/tools/enterprise/manage-attack-scenario.js +12 -7
  96. package/dist/tools/enterprise/manage-data-asset.d.ts +2 -7
  97. package/dist/tools/enterprise/manage-data-asset.js +16 -7
  98. package/dist/tools/enterprise/manage-security-control.d.ts +1 -6
  99. package/dist/tools/enterprise/manage-security-control.js +17 -7
  100. package/dist/tools/explain-signal-for-diff.d.ts +34 -0
  101. package/dist/tools/explain-signal-for-diff.js +75 -0
  102. package/dist/tools/generate-diagram.d.ts +0 -6
  103. package/dist/tools/generate-diagram.js +21 -13
  104. package/dist/tools/get-application-overview.d.ts +0 -5
  105. package/dist/tools/get-application-overview.js +0 -6
  106. package/dist/tools/get-application.d.ts +0 -5
  107. package/dist/tools/get-application.js +0 -6
  108. package/dist/tools/get-diagram.d.ts +0 -5
  109. package/dist/tools/get-diagram.js +1 -11
  110. package/dist/tools/get-document.d.ts +0 -5
  111. package/dist/tools/get-document.js +0 -6
  112. package/dist/tools/get-oss-zat.d.ts +0 -5
  113. package/dist/tools/get-oss-zat.js +0 -7
  114. package/dist/tools/get-signal.d.ts +24 -0
  115. package/dist/tools/get-signal.js +75 -0
  116. package/dist/tools/get-started.d.ts +18 -0
  117. package/dist/tools/get-started.js +470 -0
  118. package/dist/tools/get-trust-keys.d.ts +0 -5
  119. package/dist/tools/get-trust-keys.js +0 -6
  120. package/dist/tools/import-openapi-endpoints.d.ts +0 -5
  121. package/dist/tools/import-openapi-endpoints.js +0 -6
  122. package/dist/tools/inspect-zat.d.ts +0 -5
  123. package/dist/tools/inspect-zat.js +0 -19
  124. package/dist/tools/inspect.d.ts +21 -0
  125. package/dist/tools/inspect.js +222 -0
  126. package/dist/tools/list-applications.d.ts +1 -6
  127. package/dist/tools/list-applications.js +0 -6
  128. package/dist/tools/list-diagrams.d.ts +0 -5
  129. package/dist/tools/list-diagrams.js +0 -6
  130. package/dist/tools/list-documents.d.ts +0 -5
  131. package/dist/tools/list-documents.js +0 -6
  132. package/dist/tools/list-endpoints.d.ts +1 -6
  133. package/dist/tools/list-endpoints.js +0 -6
  134. package/dist/tools/list-signals.d.ts +37 -0
  135. package/dist/tools/list-signals.js +83 -0
  136. package/dist/tools/manage-application.d.ts +64 -0
  137. package/dist/tools/manage-application.js +129 -0
  138. package/dist/tools/manage-diagram.d.ts +0 -5
  139. package/dist/tools/manage-diagram.js +0 -16
  140. package/dist/tools/manage-endpoint-lifecycle.d.ts +80 -0
  141. package/dist/tools/manage-endpoint-lifecycle.js +180 -0
  142. package/dist/tools/open-in-ide.d.ts +2 -14
  143. package/dist/tools/open-in-ide.js +0 -13
  144. package/dist/tools/review-change.d.ts +34 -0
  145. package/dist/tools/review-change.js +93 -0
  146. package/dist/tools/security-review.d.ts +0 -16
  147. package/dist/tools/security-review.js +63 -77
  148. package/dist/tools/threat-get-capsule.d.ts +15 -0
  149. package/dist/tools/threat-get-capsule.js +53 -0
  150. package/dist/tools/threat-get-inference-prompt.d.ts +15 -0
  151. package/dist/tools/threat-get-inference-prompt.js +73 -0
  152. package/dist/tools/threat-list-relevant-capsules.d.ts +17 -0
  153. package/dist/tools/threat-list-relevant-capsules.js +158 -0
  154. package/dist/tools/threat-run-matcher.d.ts +17 -0
  155. package/dist/tools/threat-run-matcher.js +145 -0
  156. package/dist/tools/update-document.d.ts +0 -5
  157. package/dist/tools/update-document.js +3 -9
  158. package/dist/tools/update-endpoint.d.ts +1 -6
  159. package/dist/tools/update-endpoint.js +0 -7
  160. package/dist/tools/update-finding.d.ts +61 -0
  161. package/dist/tools/update-finding.js +80 -0
  162. package/dist/tools/update-mermaid-source.d.ts +0 -13
  163. package/dist/tools/update-mermaid-source.js +0 -14
  164. package/dist/tools/verify-trust-mark.d.ts +0 -5
  165. package/dist/tools/verify-trust-mark.js +0 -6
  166. package/dist/types.d.ts +13 -13
  167. package/dist/types.js +22 -28
  168. package/package.json +28 -5
  169. package/dist/api-client.js.map +0 -1
  170. package/dist/auth/index.js.map +0 -1
  171. package/dist/auth/jwt.js.map +0 -1
  172. package/dist/auth/keychain.js.map +0 -1
  173. package/dist/auth/oauth.js.map +0 -1
  174. package/dist/auth/sessions.js.map +0 -1
  175. package/dist/auth/token-refresh.js.map +0 -1
  176. package/dist/cli.js.map +0 -1
  177. package/dist/index.js.map +0 -1
  178. package/dist/project-binding.js.map +0 -1
  179. package/dist/resolve-application-id.js.map +0 -1
  180. package/dist/sanitize.js.map +0 -1
  181. package/dist/server.js.map +0 -1
  182. package/dist/tools/check-project.js.map +0 -1
  183. package/dist/tools/check-repo-trust.js.map +0 -1
  184. package/dist/tools/create-diagram.js.map +0 -1
  185. package/dist/tools/create-document.js.map +0 -1
  186. package/dist/tools/discover-local-infra.js.map +0 -1
  187. package/dist/tools/enterprise/capture-evidence.d.ts +0 -54
  188. package/dist/tools/enterprise/capture-evidence.js +0 -72
  189. package/dist/tools/enterprise/capture-evidence.js.map +0 -1
  190. package/dist/tools/enterprise/create-report-ticket.d.ts +0 -34
  191. package/dist/tools/enterprise/create-report-ticket.js +0 -44
  192. package/dist/tools/enterprise/create-report-ticket.js.map +0 -1
  193. package/dist/tools/enterprise/end-pentest-session.d.ts +0 -33
  194. package/dist/tools/enterprise/end-pentest-session.js +0 -42
  195. package/dist/tools/enterprise/end-pentest-session.js.map +0 -1
  196. package/dist/tools/enterprise/generate-report.d.ts +0 -55
  197. package/dist/tools/enterprise/generate-report.js +0 -111
  198. package/dist/tools/enterprise/generate-report.js.map +0 -1
  199. package/dist/tools/enterprise/get-org-zat.js.map +0 -1
  200. package/dist/tools/enterprise/get-report-status.d.ts +0 -27
  201. package/dist/tools/enterprise/get-report-status.js +0 -38
  202. package/dist/tools/enterprise/get-report-status.js.map +0 -1
  203. package/dist/tools/enterprise/get-threat-model.js.map +0 -1
  204. package/dist/tools/enterprise/list-agents.d.ts +0 -42
  205. package/dist/tools/enterprise/list-agents.js +0 -95
  206. package/dist/tools/enterprise/list-agents.js.map +0 -1
  207. package/dist/tools/enterprise/list-report-issues.d.ts +0 -36
  208. package/dist/tools/enterprise/list-report-issues.js +0 -50
  209. package/dist/tools/enterprise/list-report-issues.js.map +0 -1
  210. package/dist/tools/enterprise/list-threat-models.js.map +0 -1
  211. package/dist/tools/enterprise/manage-actor.js.map +0 -1
  212. package/dist/tools/enterprise/manage-attack-scenario.js.map +0 -1
  213. package/dist/tools/enterprise/manage-component.d.ts +0 -58
  214. package/dist/tools/enterprise/manage-component.js +0 -90
  215. package/dist/tools/enterprise/manage-component.js.map +0 -1
  216. package/dist/tools/enterprise/manage-data-asset.js.map +0 -1
  217. package/dist/tools/enterprise/manage-data-flow.d.ts +0 -57
  218. package/dist/tools/enterprise/manage-data-flow.js +0 -98
  219. package/dist/tools/enterprise/manage-data-flow.js.map +0 -1
  220. package/dist/tools/enterprise/manage-finding.d.ts +0 -69
  221. package/dist/tools/enterprise/manage-finding.js +0 -106
  222. package/dist/tools/enterprise/manage-finding.js.map +0 -1
  223. package/dist/tools/enterprise/manage-security-control.js.map +0 -1
  224. package/dist/tools/enterprise/manage-test-case.d.ts +0 -88
  225. package/dist/tools/enterprise/manage-test-case.js +0 -119
  226. package/dist/tools/enterprise/manage-test-case.js.map +0 -1
  227. package/dist/tools/enterprise/promote-finding-to-issue.d.ts +0 -36
  228. package/dist/tools/enterprise/promote-finding-to-issue.js +0 -65
  229. package/dist/tools/enterprise/promote-finding-to-issue.js.map +0 -1
  230. package/dist/tools/enterprise/publish-report-version.d.ts +0 -34
  231. package/dist/tools/enterprise/publish-report-version.js +0 -75
  232. package/dist/tools/enterprise/publish-report-version.js.map +0 -1
  233. package/dist/tools/enterprise/publish-test-to-library.d.ts +0 -31
  234. package/dist/tools/enterprise/publish-test-to-library.js +0 -40
  235. package/dist/tools/enterprise/publish-test-to-library.js.map +0 -1
  236. package/dist/tools/enterprise/record-test-result.d.ts +0 -67
  237. package/dist/tools/enterprise/record-test-result.js +0 -75
  238. package/dist/tools/enterprise/record-test-result.js.map +0 -1
  239. package/dist/tools/enterprise/start-pentest-session.d.ts +0 -35
  240. package/dist/tools/enterprise/start-pentest-session.js +0 -50
  241. package/dist/tools/enterprise/start-pentest-session.js.map +0 -1
  242. package/dist/tools/enterprise/sync-report-section.d.ts +0 -41
  243. package/dist/tools/enterprise/sync-report-section.js +0 -79
  244. package/dist/tools/enterprise/sync-report-section.js.map +0 -1
  245. package/dist/tools/enterprise/update-report-issue.d.ts +0 -55
  246. package/dist/tools/enterprise/update-report-issue.js +0 -69
  247. package/dist/tools/enterprise/update-report-issue.js.map +0 -1
  248. package/dist/tools/generate-diagram.js.map +0 -1
  249. package/dist/tools/get-agent-test-results.d.ts +0 -41
  250. package/dist/tools/get-agent-test-results.js +0 -86
  251. package/dist/tools/get-agent-test-results.js.map +0 -1
  252. package/dist/tools/get-application-overview.js.map +0 -1
  253. package/dist/tools/get-application.js.map +0 -1
  254. package/dist/tools/get-artifact-content.d.ts +0 -29
  255. package/dist/tools/get-artifact-content.js +0 -86
  256. package/dist/tools/get-artifact-content.js.map +0 -1
  257. package/dist/tools/get-diagram.js.map +0 -1
  258. package/dist/tools/get-document.js.map +0 -1
  259. package/dist/tools/get-finding-details.d.ts +0 -28
  260. package/dist/tools/get-finding-details.js +0 -43
  261. package/dist/tools/get-finding-details.js.map +0 -1
  262. package/dist/tools/get-findings.d.ts +0 -57
  263. package/dist/tools/get-findings.js +0 -103
  264. package/dist/tools/get-findings.js.map +0 -1
  265. package/dist/tools/get-oss-zat.js.map +0 -1
  266. package/dist/tools/get-recon-scan.d.ts +0 -27
  267. package/dist/tools/get-recon-scan.js +0 -46
  268. package/dist/tools/get-recon-scan.js.map +0 -1
  269. package/dist/tools/get-scan-output.d.ts +0 -27
  270. package/dist/tools/get-scan-output.js +0 -64
  271. package/dist/tools/get-scan-output.js.map +0 -1
  272. package/dist/tools/get-scenario-details.d.ts +0 -27
  273. package/dist/tools/get-scenario-details.js +0 -46
  274. package/dist/tools/get-scenario-details.js.map +0 -1
  275. package/dist/tools/get-test-case-results.d.ts +0 -37
  276. package/dist/tools/get-test-case-results.js +0 -66
  277. package/dist/tools/get-test-case-results.js.map +0 -1
  278. package/dist/tools/get-test-details.d.ts +0 -29
  279. package/dist/tools/get-test-details.js +0 -49
  280. package/dist/tools/get-test-details.js.map +0 -1
  281. package/dist/tools/get-trust-keys.js.map +0 -1
  282. package/dist/tools/import-openapi-endpoints.js.map +0 -1
  283. package/dist/tools/inspect-zat.js.map +0 -1
  284. package/dist/tools/list-agent-test-cases.d.ts +0 -41
  285. package/dist/tools/list-agent-test-cases.js +0 -73
  286. package/dist/tools/list-agent-test-cases.js.map +0 -1
  287. package/dist/tools/list-applications.js.map +0 -1
  288. package/dist/tools/list-diagrams.js.map +0 -1
  289. package/dist/tools/list-documents.js.map +0 -1
  290. package/dist/tools/list-endpoints.js.map +0 -1
  291. package/dist/tools/list-recon-scans.d.ts +0 -36
  292. package/dist/tools/list-recon-scans.js +0 -74
  293. package/dist/tools/list-recon-scans.js.map +0 -1
  294. package/dist/tools/list-scan-artifacts.d.ts +0 -41
  295. package/dist/tools/list-scan-artifacts.js +0 -63
  296. package/dist/tools/list-scan-artifacts.js.map +0 -1
  297. package/dist/tools/list-scans.d.ts +0 -44
  298. package/dist/tools/list-scans.js +0 -91
  299. package/dist/tools/list-scans.js.map +0 -1
  300. package/dist/tools/list-test-library.d.ts +0 -44
  301. package/dist/tools/list-test-library.js +0 -83
  302. package/dist/tools/list-test-library.js.map +0 -1
  303. package/dist/tools/list-test-scenarios.d.ts +0 -31
  304. package/dist/tools/list-test-scenarios.js +0 -66
  305. package/dist/tools/list-test-scenarios.js.map +0 -1
  306. package/dist/tools/local-scan.d.ts +0 -40
  307. package/dist/tools/local-scan.js +0 -261
  308. package/dist/tools/local-scan.js.map +0 -1
  309. package/dist/tools/manage-diagram.js.map +0 -1
  310. package/dist/tools/open-in-ide.js.map +0 -1
  311. package/dist/tools/run-test-scenario.d.ts +0 -37
  312. package/dist/tools/run-test-scenario.js +0 -70
  313. package/dist/tools/run-test-scenario.js.map +0 -1
  314. package/dist/tools/scan-pr.d.ts +0 -27
  315. package/dist/tools/scan-pr.js +0 -51
  316. package/dist/tools/scan-pr.js.map +0 -1
  317. package/dist/tools/security-review.js.map +0 -1
  318. package/dist/tools/setup-red-team-target.d.ts +0 -79
  319. package/dist/tools/setup-red-team-target.js +0 -430
  320. package/dist/tools/setup-red-team-target.js.map +0 -1
  321. package/dist/tools/triage-finding.d.ts +0 -47
  322. package/dist/tools/triage-finding.js +0 -116
  323. package/dist/tools/triage-finding.js.map +0 -1
  324. package/dist/tools/update-document.js.map +0 -1
  325. package/dist/tools/update-endpoint.js.map +0 -1
  326. package/dist/tools/update-mermaid-source.js.map +0 -1
  327. package/dist/tools/verify-trust-mark.js.map +0 -1
  328. package/dist/types.js.map +0 -1
@@ -0,0 +1,75 @@
1
+ import { z } from "zod";
2
+ import { requireApplicationId } from "../resolve-application-id.js";
3
+ import { sanitizeResponse } from "../sanitize.js";
4
+ export const GET_SIGNAL_NAME = "zivis_get_signal";
5
+ export const GET_SIGNAL_DESCRIPTION = `Get full detail on a single Signal by its id.
6
+
7
+ Returns the qualified narrative — description, mitigation, attack-chain context, taxonomy (STRIDE / ATPS layer / MITRE / OWASP / compliance mappings), detected safeguards and what breaks them, and the polymorphic source-artifact reference for drilling into the native subsystem.
8
+
9
+ Pass \`signal_id\` from a \`zivis_list_signals\` response.
10
+
11
+ SECURITY: Display-shaped output only. No raw graph data.`;
12
+ export const GET_SIGNAL_SCHEMA = {
13
+ application_id: z
14
+ .string()
15
+ .optional()
16
+ .describe("Application UUID. If omitted, uses applicationId from .zivis/project.json."),
17
+ signal_id: z
18
+ .string()
19
+ .describe("Opaque signal id (from zivis_list_signals)."),
20
+ };
21
+ export function createGetSignalHandler(apiClient) {
22
+ return async (params) => {
23
+ const req = requireApplicationId(params.application_id);
24
+ if (!req.ok) {
25
+ return {
26
+ content: [{ type: "text", text: `Error: ${req.message}` }],
27
+ isError: true,
28
+ };
29
+ }
30
+ if (!params.signal_id) {
31
+ return {
32
+ content: [{ type: "text", text: "Error: signal_id is required" }],
33
+ isError: true,
34
+ };
35
+ }
36
+ const path = `/api/apps/${req.id}/signals/${encodeURIComponent(params.signal_id)}`;
37
+ try {
38
+ const s = await apiClient.get(path);
39
+ const result = {
40
+ id: s.id,
41
+ source: s.source,
42
+ severity: s.severity,
43
+ status: s.status,
44
+ confidence: s.confidence,
45
+ title: s.title,
46
+ description: s.description,
47
+ category: s.category,
48
+ attack_chain: s.attackChain
49
+ ? {
50
+ name: s.attackChain.chainName,
51
+ step: `${s.attackChain.stepIndex}/${s.attackChain.totalSteps}`,
52
+ }
53
+ : null,
54
+ taxonomy: s.taxonomy ?? null,
55
+ components: s.components?.map((c) => c.name) ?? [],
56
+ refs: s.refs,
57
+ recommended_action: s.recommendedAction,
58
+ safeguards: s.safeguards ?? null,
59
+ fingerprint: s.fingerprint,
60
+ };
61
+ return {
62
+ content: [
63
+ { type: "text", text: JSON.stringify(sanitizeResponse(result), null, 2) },
64
+ ],
65
+ };
66
+ }
67
+ catch (err) {
68
+ const message = err instanceof Error ? err.message : "Failed to load signal";
69
+ return {
70
+ content: [{ type: "text", text: `Error: ${message}` }],
71
+ isError: true,
72
+ };
73
+ }
74
+ };
75
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from "zod";
2
+ import type { ApiClient } from "../api-client.js";
3
+ import type { ZivisConfig } from "../types.js";
4
+ export declare const GET_STARTED_NAME = "zivis_get_started";
5
+ export declare const GET_STARTED_DESCRIPTION = "Call this FIRST on any turn where the user asks about security, vulnerabilities, code review, deployment readiness, threat modeling, dependencies, or \"what should I do next.\" Idempotent and safe to call repeatedly \u2014 detects prior inspect runs and never re-inspects unnecessarily. Prefer this over calling zivis_inspect directly.\n\nUse this when the user says any of:\n- \"what should I do for security on this app\"\n- \"uhh, where do I start\"\n- \"is my app safe\" / \"is my chatbot safe\"\n- \"I need to do security stuff before launch\"\n- \"I have an audit / pen test / customer asking about security\"\n- \"check my dependencies / libraries / repos\"\n- \"how do I use ZIVIS\"\n- \"what can ZIVIS do for me\"\n\nThis tool inspects the current project state \u2014 binding, application, scans, findings \u2014\nAND if a recent 'zivis inspect' artifact exists for this repo, evaluates the local\nthreat library against it to surface architectural patterns ZIVIS thinks may apply\n(self-consistency without context isolation, late org filter, privilege separation, etc.).\nThe 'relevant_threats' field in the response is what makes this tool different from a\ngeneric security menu: ZIVIS is reading the user's actual codebase via the graph\nartifact and naming threats by their architectural shape.\n\nAlways speak to the user in threat-model language: components, flows, trust boundaries,\nattack scenarios. Even when they don't yet know those terms \u2014 that's how they learn.\n\nOutput is a structured JSON object. Present recommended_next_steps as a numbered list\nto the user, in order, and ask them to pick one. If relevant_threats is non-empty, lead\nwith that \u2014 it's the most concrete thing ZIVIS knows about their repo. Use the label\nand why fields verbatim; do not invent new steps. If the user is unsure which to pick,\nrecommend the item flagged in if_user_unsure.";
6
+ export declare const GET_STARTED_SCHEMA: {
7
+ concern: z.ZodOptional<z.ZodString>;
8
+ cwd: z.ZodOptional<z.ZodString>;
9
+ };
10
+ export declare function createGetStartedHandler(apiClient: ApiClient, _config: ZivisConfig): (params: {
11
+ concern?: string;
12
+ cwd?: string;
13
+ }) => Promise<{
14
+ content: {
15
+ type: "text";
16
+ text: string;
17
+ }[];
18
+ }>;
@@ -0,0 +1,470 @@
1
+ import * as fs from "node:fs/promises";
2
+ import { z } from "zod";
3
+ import { detectProjectBinding } from "../project-binding.js";
4
+ import { loadActivePack, findRelevantCapsules, } from "../pattern-pack/index.js";
5
+ import { locateLatestArtifact } from "../lib/inspect-cache.js";
6
+ export const GET_STARTED_NAME = "zivis_get_started";
7
+ export const GET_STARTED_DESCRIPTION = `Call this FIRST on any turn where the user asks about security, vulnerabilities, code review, deployment readiness, threat modeling, dependencies, or "what should I do next." Idempotent and safe to call repeatedly — detects prior inspect runs and never re-inspects unnecessarily. Prefer this over calling zivis_inspect directly.
8
+
9
+ Use this when the user says any of:
10
+ - "what should I do for security on this app"
11
+ - "uhh, where do I start"
12
+ - "is my app safe" / "is my chatbot safe"
13
+ - "I need to do security stuff before launch"
14
+ - "I have an audit / pen test / customer asking about security"
15
+ - "check my dependencies / libraries / repos"
16
+ - "how do I use ZIVIS"
17
+ - "what can ZIVIS do for me"
18
+
19
+ This tool inspects the current project state — binding, application, scans, findings —
20
+ AND if a recent 'zivis inspect' artifact exists for this repo, evaluates the local
21
+ threat library against it to surface architectural patterns ZIVIS thinks may apply
22
+ (self-consistency without context isolation, late org filter, privilege separation, etc.).
23
+ The 'relevant_threats' field in the response is what makes this tool different from a
24
+ generic security menu: ZIVIS is reading the user's actual codebase via the graph
25
+ artifact and naming threats by their architectural shape.
26
+
27
+ Always speak to the user in threat-model language: components, flows, trust boundaries,
28
+ attack scenarios. Even when they don't yet know those terms — that's how they learn.
29
+
30
+ Output is a structured JSON object. Present recommended_next_steps as a numbered list
31
+ to the user, in order, and ask them to pick one. If relevant_threats is non-empty, lead
32
+ with that — it's the most concrete thing ZIVIS knows about their repo. Use the label
33
+ and why fields verbatim; do not invent new steps. If the user is unsure which to pick,
34
+ recommend the item flagged in if_user_unsure.`;
35
+ export const GET_STARTED_SCHEMA = {
36
+ concern: z
37
+ .string()
38
+ .optional()
39
+ .describe("Free-form sentence describing what the user wants. " +
40
+ "Examples: 'is my chatbot safe', 'check the libraries we use', " +
41
+ "'audit coming up next month', 'just deployed a new API'. " +
42
+ "If omitted, returns a generic getting-started menu based on project state."),
43
+ cwd: z
44
+ .string()
45
+ .optional()
46
+ .describe("Working directory to inspect (defaults to server working directory)."),
47
+ };
48
+ const INTENT_MAP = [
49
+ {
50
+ patterns: /chatbot|llm|ai chat|assistant|agent|prompt injection|jailbreak|openai|anthropic|langchain|llamaindex|cohere|together/i,
51
+ intent: "ai_red_team",
52
+ },
53
+ {
54
+ patterns: /librar|dependenc|package|npm|pip|repo|crate|gem|module|import|third.?party/i,
55
+ intent: "dep_audit",
56
+ },
57
+ {
58
+ patterns: /audit|compliance|soc\s*2|iso\s*27001|fedramp|vendor questionnaire|customer ask|certif/i,
59
+ intent: "pre_audit",
60
+ },
61
+ {
62
+ patterns: /launch|deploy|release|production|go\s*live|prod|ship/i,
63
+ intent: "pre_launch",
64
+ },
65
+ {
66
+ patterns: /finding|issue|vulnerabilit|vuln|bug|report|result|scan result/i,
67
+ intent: "view_findings",
68
+ },
69
+ ];
70
+ function detectIntent(concern) {
71
+ if (!concern)
72
+ return "generic";
73
+ for (const { patterns, intent } of INTENT_MAP) {
74
+ if (patterns.test(concern))
75
+ return intent;
76
+ }
77
+ return "generic";
78
+ }
79
+ function stepCheckDeps() {
80
+ return {
81
+ id: "check_dependencies",
82
+ label: "Check the open source libraries you depend on",
83
+ tool: "zivis_check_repo_trust",
84
+ why: "Free, no setup. Catches risky AI SDKs and known-bad dependencies before they cause problems.",
85
+ estimated_time: "1 minute per repo",
86
+ requires_auth: false,
87
+ };
88
+ }
89
+ function stepSetupAiTarget(hint) {
90
+ return {
91
+ id: "setup_ai_target",
92
+ label: "Tell ZIVIS about your chatbot or AI system so it can test it",
93
+ tool: "zivis_setup_red_team_target",
94
+ args_hint: { target_type: "ai_chat", ...hint },
95
+ why: "ZIVIS needs to know your endpoint to run prompt-injection, jailbreak, and PII-leakage tests.",
96
+ estimated_time: "2 minutes",
97
+ requires_auth: true,
98
+ };
99
+ }
100
+ function stepSetupWebTarget(hint) {
101
+ return {
102
+ id: "setup_web_target",
103
+ label: "Register your web app or API with ZIVIS for testing",
104
+ tool: "zivis_setup_red_team_target",
105
+ args_hint: { target_type: "web_app", ...hint },
106
+ why: "ZIVIS needs to know your app URL to run security tests against it.",
107
+ estimated_time: "2 minutes",
108
+ requires_auth: true,
109
+ };
110
+ }
111
+ function stepBrowseTests() {
112
+ return {
113
+ id: "browse_test_library",
114
+ label: "Browse what ZIVIS can test for",
115
+ tool: "zivis_list_test_scenarios",
116
+ why: "See the menu of attack categories (prompt injection, auth bypass, data leakage, etc.) before committing to a scan.",
117
+ estimated_time: "30 seconds",
118
+ requires_auth: true,
119
+ };
120
+ }
121
+ function stepViewFindings(count) {
122
+ return {
123
+ id: "view_open_findings",
124
+ label: count
125
+ ? `Review the ${count} open security issue${count === 1 ? "" : "s"} ZIVIS found`
126
+ : "Review open security issues ZIVIS found",
127
+ tool: "zivis_get_findings",
128
+ args_hint: { status: "open" },
129
+ why: "Look at what's been found already before starting new scans — no point duplicating work.",
130
+ estimated_time: "5 minutes",
131
+ requires_auth: true,
132
+ };
133
+ }
134
+ function stepRunSecurityReview() {
135
+ return {
136
+ id: "run_security_review",
137
+ label: "Get a security readiness summary before launch or audit",
138
+ tool: "zivis_security_review",
139
+ why: "Pulls together all open findings, past fixes, and known attack scenarios into one pre-launch checklist.",
140
+ estimated_time: "3 minutes",
141
+ requires_auth: true,
142
+ };
143
+ }
144
+ function stepSetupProject() {
145
+ return {
146
+ id: "setup_project",
147
+ label: "Connect this project to your ZIVIS org",
148
+ tool: "zivis_check_project",
149
+ why: "ZIVIS needs to know which org this project belongs to before it can run tests or store results.",
150
+ estimated_time: "2 minutes (run 'zivis auth init' in your terminal)",
151
+ requires_auth: false,
152
+ };
153
+ }
154
+ function stepInstallGitHubApp(installUrl) {
155
+ return {
156
+ id: "install_github_app",
157
+ label: "Install the ZIVIS GitHub App to enable continuous monitoring",
158
+ tool: "external_link",
159
+ args_hint: { url: installUrl },
160
+ why: "Linking a repo unlocks deeper analysis on every push — threat model updates automatically as architecture changes. Today this org has no GitHub App installation.",
161
+ estimated_time: "2 minutes",
162
+ requires_auth: false,
163
+ };
164
+ }
165
+ async function fetchState(apiClient, cwd) {
166
+ const detected = detectProjectBinding(cwd);
167
+ if (!detected) {
168
+ return {
169
+ bound: false,
170
+ has_application: false,
171
+ has_scans: false,
172
+ has_findings: false,
173
+ open_findings_count: 0,
174
+ };
175
+ }
176
+ const state = {
177
+ bound: true,
178
+ org_name: detected.binding.orgName,
179
+ has_application: false,
180
+ has_scans: false,
181
+ has_findings: false,
182
+ open_findings_count: 0,
183
+ };
184
+ try {
185
+ const appsResp = await apiClient.get("/api/rt/applications?limit=1");
186
+ if ((appsResp.applications?.length ?? 0) > 0 || (appsResp.total ?? 0) > 0) {
187
+ state.has_application = true;
188
+ }
189
+ }
190
+ catch {
191
+ }
192
+ try {
193
+ const scansResp = await apiClient.get("/api/rt/scans?limit=1");
194
+ if ((scansResp.scans?.length ?? 0) > 0) {
195
+ state.has_scans = true;
196
+ }
197
+ }
198
+ catch {
199
+ }
200
+ try {
201
+ const findingsResp = await apiClient.get("/api/findings/unified?status=open&limit=1");
202
+ const total = findingsResp.summary?.total ?? findingsResp.findings?.length ?? 0;
203
+ if (total > 0) {
204
+ state.has_findings = true;
205
+ state.open_findings_count = total;
206
+ }
207
+ }
208
+ catch {
209
+ }
210
+ try {
211
+ const gh = await apiClient.get("/api/github-app/status");
212
+ state.github_app_installed = gh.installed;
213
+ state.github_app_install_url = gh.installUrl;
214
+ }
215
+ catch {
216
+ state.github_app_installed = null;
217
+ }
218
+ return state;
219
+ }
220
+ function buildMenu(intent, state, concern) {
221
+ if (!state.bound) {
222
+ return {
223
+ headline: "Welcome to ZIVIS! First, let's connect this project to your organization so results are stored and tracked.",
224
+ recommended_next_steps: [
225
+ stepSetupProject(),
226
+ stepCheckDeps(),
227
+ stepBrowseTests(),
228
+ ],
229
+ guidance_for_assistant: "Present these as a numbered list. The user should run 'zivis auth init' in their terminal to complete step 1. " +
230
+ "Step 2 (check_dependencies) requires no auth and can be done immediately. " +
231
+ "If they ask 'why' something matters, expand on the 'why' field — do not make new claims.",
232
+ if_user_unsure: "Recommend option 2 (check_dependencies) — it requires no setup and gives immediate results.",
233
+ };
234
+ }
235
+ if (state.has_findings && intent !== "dep_audit") {
236
+ const steps = [
237
+ stepViewFindings(state.open_findings_count),
238
+ stepCheckDeps(),
239
+ ];
240
+ if (!state.has_application) {
241
+ steps.push(stepSetupWebTarget());
242
+ }
243
+ else {
244
+ steps.push(stepBrowseTests());
245
+ }
246
+ return {
247
+ headline: `ZIVIS sees your project (${state.org_name ?? "connected"}) and has found ${state.open_findings_count} open security issue${state.open_findings_count === 1 ? "" : "s"}.`,
248
+ recommended_next_steps: steps,
249
+ guidance_for_assistant: "Present these as a numbered list. Prioritize reviewing existing findings before starting new scans. " +
250
+ "If they ask 'why' something matters, expand on the 'why' field — do not make new claims.",
251
+ if_user_unsure: "Recommend option 1 (view_open_findings) — reviewing what's already known is the best first step.",
252
+ };
253
+ }
254
+ if (intent === "ai_red_team") {
255
+ const steps = [
256
+ stepSetupAiTarget(),
257
+ stepCheckDeps(),
258
+ stepBrowseTests(),
259
+ ];
260
+ return {
261
+ headline: state.has_application
262
+ ? `ZIVIS sees your project (${state.org_name ?? "connected"}) and has a target configured. Ready to test your AI system.`
263
+ : `ZIVIS sees your project (${state.org_name ?? "connected"}) but no security testing has run yet.`,
264
+ recommended_next_steps: steps,
265
+ guidance_for_assistant: "The user wants to test an AI/chatbot system. Present these as a numbered list. " +
266
+ "If they already have a target URL, include it in args_hint. " +
267
+ "If they ask 'why' something matters, expand on the 'why' field — do not make new claims.",
268
+ if_user_unsure: "Recommend option 1 (setup_ai_target) — setting up the chatbot as a test target is the fastest path to finding real issues.",
269
+ };
270
+ }
271
+ if (intent === "dep_audit") {
272
+ return {
273
+ headline: "Checking your dependencies is a great place to start — it's free, needs no setup, and often finds the most impactful issues.",
274
+ recommended_next_steps: [
275
+ stepCheckDeps(),
276
+ stepSetupWebTarget(),
277
+ stepBrowseTests(),
278
+ ],
279
+ guidance_for_assistant: "Present these as a numbered list. For step 1, ask the user to share which packages they want to check " +
280
+ "(the GitHub org/repo of the dependency, e.g. openai/openai-python). " +
281
+ "If they ask 'why' something matters, expand on the 'why' field — do not make new claims.",
282
+ if_user_unsure: "Recommend option 1 (check_dependencies) — it works right now with no setup.",
283
+ };
284
+ }
285
+ if (intent === "pre_audit" || intent === "pre_launch") {
286
+ const steps = [
287
+ stepRunSecurityReview(),
288
+ stepCheckDeps(),
289
+ ];
290
+ if (!state.has_application) {
291
+ steps.push(stepSetupWebTarget());
292
+ }
293
+ else {
294
+ steps.push(stepBrowseTests());
295
+ }
296
+ const headline = intent === "pre_audit"
297
+ ? `ZIVIS can help you prepare for an audit. Let's get a security readiness picture first.`
298
+ : `ZIVIS can help you check security before you go live.`;
299
+ return {
300
+ headline,
301
+ recommended_next_steps: steps,
302
+ guidance_for_assistant: "The user has a deadline (audit or launch). Start with a security review to understand the current state, " +
303
+ "then address the highest-severity issues first. " +
304
+ "If they ask 'why' something matters, expand on the 'why' field — do not make new claims.",
305
+ if_user_unsure: "Recommend option 1 (run_security_review) — it gives the fastest complete picture and shows what needs to be fixed before the deadline.",
306
+ };
307
+ }
308
+ if (intent === "view_findings") {
309
+ return {
310
+ headline: state.has_findings
311
+ ? `ZIVIS has ${state.open_findings_count} open finding${state.open_findings_count === 1 ? "" : "s"} for this project.`
312
+ : `No open findings found yet — ZIVIS may not have run a scan, or all issues are resolved.`,
313
+ recommended_next_steps: [
314
+ stepViewFindings(state.open_findings_count > 0 ? state.open_findings_count : undefined),
315
+ state.has_application ? stepBrowseTests() : stepSetupWebTarget(),
316
+ stepCheckDeps(),
317
+ ],
318
+ guidance_for_assistant: "Present these as a numbered list. If the user wants to see findings, call zivis_get_findings directly. " +
319
+ "If they ask 'why' something matters, expand on the 'why' field — do not make new claims.",
320
+ if_user_unsure: "Recommend option 1 (view_open_findings) — let's see what ZIVIS already knows.",
321
+ };
322
+ }
323
+ const steps = [];
324
+ if (!state.has_application) {
325
+ steps.push(stepSetupWebTarget());
326
+ }
327
+ steps.push(stepCheckDeps());
328
+ if (state.has_findings) {
329
+ steps.push(stepViewFindings(state.open_findings_count));
330
+ }
331
+ else {
332
+ steps.push(stepBrowseTests());
333
+ }
334
+ if (steps.length < 3)
335
+ steps.push(stepBrowseTests());
336
+ return {
337
+ headline: state.has_application
338
+ ? `ZIVIS is connected to your project (${state.org_name ?? "org"}). Here are the most useful things to do next.`
339
+ : `ZIVIS is connected to your project (${state.org_name ?? "org"}) but no app has been registered for testing yet.`,
340
+ recommended_next_steps: steps.slice(0, 4),
341
+ guidance_for_assistant: "Present these as a numbered list. Ask the user to pick one before taking any action. " +
342
+ "If they ask 'why' something matters, expand on the 'why' field — do not make new claims.",
343
+ if_user_unsure: "Recommend option 2 (check_dependencies) — it's free, fast, and shows value without setup.",
344
+ };
345
+ }
346
+ async function findRelevantThreats(cwd) {
347
+ const located = await locateLatestArtifact(cwd);
348
+ if (!located) {
349
+ return {
350
+ threats: [],
351
+ reason: "No 'zivis inspect' artifact found in user cache. Run 'zivis inspect' from the repo to populate the threat library against this codebase.",
352
+ };
353
+ }
354
+ const artifactPath = located.path;
355
+ let artifact;
356
+ try {
357
+ const raw = await fs.readFile(artifactPath, "utf8");
358
+ artifact = JSON.parse(raw);
359
+ }
360
+ catch {
361
+ return { threats: [], reason: `Failed to read artifact at ${artifactPath}.` };
362
+ }
363
+ let handle;
364
+ try {
365
+ handle = await loadActivePack();
366
+ }
367
+ catch {
368
+ return {
369
+ threats: [],
370
+ artifact_path: artifactPath,
371
+ reason: "Pattern pack not available — run 'pnpm build' to bundle the public pack.",
372
+ };
373
+ }
374
+ const relevant = await findRelevantCapsules(handle, artifact);
375
+ return {
376
+ threats: relevant.map((cap) => summarizeCapsule(cap, artifact)),
377
+ artifact_path: artifactPath,
378
+ };
379
+ }
380
+ function summarizeCapsule(cap, artifact) {
381
+ const matched = [];
382
+ const pkgs = new Set();
383
+ for (const node of artifact.nodes) {
384
+ if (node.type === "external_dependency" && node.attributes?.package) {
385
+ pkgs.add(node.attributes.package);
386
+ }
387
+ }
388
+ const langs = new Set(artifact.scope.languages ?? []);
389
+ const f = cap.relevance_filter;
390
+ if (f) {
391
+ for (const term of [...(f.any_of ?? []), ...(f.all_of ?? [])]) {
392
+ if (term.dependency && pkgs.has(term.dependency))
393
+ matched.push(`dep:${term.dependency}`);
394
+ if (term.language && langs.has(term.language))
395
+ matched.push(`language:${term.language}`);
396
+ }
397
+ }
398
+ if (matched.length === 0)
399
+ matched.push("language match only");
400
+ return {
401
+ pattern_id: cap.id,
402
+ title: cap.title,
403
+ category: cap.category,
404
+ safe_summary: cap.safe_summary,
405
+ matched_on: matched,
406
+ next_action_tool: "zivis_threat_run_matcher",
407
+ };
408
+ }
409
+ export function createGetStartedHandler(apiClient, _config) {
410
+ return async (params) => {
411
+ const cwd = params.cwd ?? process.cwd();
412
+ const intent = detectIntent(params.concern);
413
+ const state = await fetchState(apiClient, cwd);
414
+ const menu = buildMenu(intent, state, params.concern);
415
+ let threatHit = { threats: [] };
416
+ try {
417
+ threatHit = await findRelevantThreats(cwd);
418
+ }
419
+ catch (err) {
420
+ threatHit = {
421
+ threats: [],
422
+ reason: `threat-library lookup failed: ${err.message}`,
423
+ };
424
+ }
425
+ if (threatHit.threats.length > 0) {
426
+ menu.recommended_next_steps = [
427
+ {
428
+ id: "review_relevant_threats",
429
+ label: `Review the ${threatHit.threats.length} architectural pattern${threatHit.threats.length === 1 ? "" : "s"} ZIVIS sees in this repo`,
430
+ tool: "zivis_threat_run_matcher",
431
+ why: "ZIVIS read your codebase via the inspect artifact and identified threat-model patterns that match your architecture. Run the matcher to see exactly which lines fire each pattern.",
432
+ estimated_time: "30 seconds",
433
+ requires_auth: false,
434
+ },
435
+ ...menu.recommended_next_steps,
436
+ ];
437
+ menu.headline =
438
+ `ZIVIS read this repo's threat library and sees ${threatHit.threats.length} architectural pattern${threatHit.threats.length === 1 ? "" : "s"} that may apply. ` +
439
+ menu.headline;
440
+ menu.if_user_unsure = `Recommend option 1 (review_relevant_threats) — that's the most repo-specific thing ZIVIS knows.`;
441
+ }
442
+ if (state.bound &&
443
+ state.github_app_installed === false &&
444
+ state.github_app_install_url) {
445
+ menu.recommended_next_steps = [
446
+ ...menu.recommended_next_steps,
447
+ stepInstallGitHubApp(state.github_app_install_url),
448
+ ];
449
+ }
450
+ const payload = {
451
+ current_state: state,
452
+ intent_detected: intent,
453
+ concern_received: params.concern ?? null,
454
+ ...menu,
455
+ relevant_threats: threatHit.threats,
456
+ threat_library: {
457
+ artifact_used: threatHit.artifact_path ?? null,
458
+ reason_no_threats: threatHit.threats.length === 0 ? threatHit.reason ?? null : null,
459
+ },
460
+ };
461
+ return {
462
+ content: [
463
+ {
464
+ type: "text",
465
+ text: JSON.stringify(payload, null, 2),
466
+ },
467
+ ],
468
+ };
469
+ };
470
+ }
@@ -1,8 +1,3 @@
1
- /**
2
- * zivis_get_trust_keys — Retrieve JWKS public keys for signature verification
3
- *
4
- * Maps to: GET /.well-known/jwks.json (public, no auth required)
5
- */
6
1
  import type { ZivisConfig } from "../types.js";
7
2
  export declare const GET_TRUST_KEYS_NAME = "zivis_get_trust_keys";
8
3
  export declare const GET_TRUST_KEYS_DESCRIPTION = "Retrieve the ZIVIS public signing keys (JWKS) for independent cryptographic verification of trust marks and ZATs.\n\nReturns a JWKS (JSON Web Key Set) containing two keys:\n\n1. **ML-DSA-65 key** (post-quantum, FIPS-204):\n - Algorithm: CRYSTALS-Dilithium Level 3\n - NIST Security Category 3 (128-bit quantum security)\n - Used to verify the full digital signature on ZATs and trust marks\n - Key type: \"PQ-LWE\" (proposed post-quantum JWK key type)\n - The \"x\" field is the base64url-encoded public key bytes\n\n2. **Ed25519 key** (RFC 8032):\n - Used to verify compact trust tokens (shorter, URL-safe format)\n - Standard JWK format (kty: \"OKP\", crv: \"Ed25519\")\n\nThese keys enable third-party, offline verification without trusting ZIVIS infrastructure.\nThis is critical for ATNP (Agent Trust Negotiation Protocol) where agents must independently verify trust marks.\n\nVerification workflow:\n1. Get a ZAT (from zivis_get_oss_zat or zivis_get_org_zat)\n2. Get the public keys (this tool)\n3. Verify the signature using ML-DSA-65 or Ed25519 library of your choice\n4. Check expiration and claims\n\nNo parameters required. No authentication required.";
@@ -1,8 +1,3 @@
1
- /**
2
- * zivis_get_trust_keys — Retrieve JWKS public keys for signature verification
3
- *
4
- * Maps to: GET /.well-known/jwks.json (public, no auth required)
5
- */
6
1
  export const GET_TRUST_KEYS_NAME = "zivis_get_trust_keys";
7
2
  export const GET_TRUST_KEYS_DESCRIPTION = `Retrieve the ZIVIS public signing keys (JWKS) for independent cryptographic verification of trust marks and ZATs.
8
3
 
@@ -64,4 +59,3 @@ export function createGetTrustKeysHandler(config) {
64
59
  }
65
60
  };
66
61
  }
67
- //# sourceMappingURL=get-trust-keys.js.map
@@ -1,8 +1,3 @@
1
- /**
2
- * zivis_import_openapi_endpoints — Import endpoints from an OpenAPI/Swagger spec
3
- *
4
- * Maps to: POST /api/rt/applications/:id/endpoints/import-openapi
5
- */
6
1
  import { z } from "zod";
7
2
  import type { ApiClient } from "../api-client.js";
8
3
  export declare const IMPORT_OPENAPI_ENDPOINTS_NAME = "zivis_import_openapi_endpoints";
@@ -1,8 +1,3 @@
1
- /**
2
- * zivis_import_openapi_endpoints — Import endpoints from an OpenAPI/Swagger spec
3
- *
4
- * Maps to: POST /api/rt/applications/:id/endpoints/import-openapi
5
- */
6
1
  import { z } from "zod";
7
2
  import { requireApplicationId } from "../resolve-application-id.js";
8
3
  import { sanitizeResponse } from "../sanitize.js";
@@ -90,4 +85,3 @@ export function createImportOpenApiEndpointsHandler(apiClient) {
90
85
  }
91
86
  };
92
87
  }
93
- //# sourceMappingURL=import-openapi-endpoints.js.map
@@ -1,8 +1,3 @@
1
- /**
2
- * zivis_inspect_zat — Parse and explain a ZAT token
3
- *
4
- * No API call — client-side parsing and human-readable interpretation.
5
- */
6
1
  import { z } from "zod";
7
2
  export declare const INSPECT_ZAT_NAME = "zivis_inspect_zat";
8
3
  export declare const INSPECT_ZAT_DESCRIPTION = "Parse a ZIVIS Attestation Token (ZAT) JSON and produce a human-readable explanation of all fields.\n\nThis tool does NOT make any API calls \u2014 it parses the ZAT locally and explains what each field means.\n\nUse this after retrieving a ZAT from zivis_get_oss_zat or zivis_get_org_zat to understand:\n- What the claims mean (Z-Score, trust tiers, coverage, findings)\n- Whether signatures are present and which algorithms were used\n- Token validity and expiration\n- Evidence manifest integrity\n- Framework and methodology details\n- Lens-level scores (for OSS ZATs)\n\nAccepts either:\n- A JSON string (the raw ZAT output)\n- A JSON object with a \"zat\" field (the wrapper returned by the API)\n\nZAT Field Reference:\n- **iss**: Issuer (always \"zivis.ai\")\n- **sub**: Subject \u2014 \"org:<slug>\" for enterprise, \"github:<owner>/<repo>\" for OSS\n- **mark_id**: Unique identifier (ztm_...) \u2014 references the trust mark\n- **issued_at / expires_at**: ISO 8601 timestamps \u2014 ZATs are short-lived (48h)\n- **frameworks[]**: Which security frameworks were assessed (NIST IR 8596, ISO 42001, OWASP LLM Top 10, etc.)\n - basis: \"tested\" | \"mapped\" | \"self-attested\" | \"third-party\" \u2014 how the assessment was performed\n - csf_version: Present if framework is NIST CSF 2.0 derived (enables cross-framework comparison)\n- **claims**: The actual trust posture\n - For enterprise: z_score_raw (0-1), z_score_display (0-1000), tier (0-3), tier_label, coverage_pct, mapped_outcomes\n - For OSS: score (0-100), grade (A+ to F), check_types, findings by severity, commit SHA\n - Tier meanings: 0=Commitment, 1=Foundational Trust (600+), 2=Operational Trust (700+), 3=Systemic Trust (800+)\n- **evidence_manifest**: SHA-256 hash of the evidence bundle \u2014 proves the assessment data hasn't been tampered with\n- **methodology**: How the assessment was performed (model version, scoring algorithm, evaluator type)\n- **sig**: Cryptographic signatures\n - alg: \"ML-DSA-65\" (FIPS-204, post-quantum CRYSTALS-Dilithium Level 3)\n - compact: Ed25519 (RFC 8032) compact token for lightweight verification\n- **ver**: ZAT spec version (e.g., \"0.3.0\")";