@zivis/mcp 0.1.8 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +19 -0
- package/dist/api-client.d.ts +2 -24
- package/dist/api-client.js +32 -52
- package/dist/auth/index.d.ts +1 -22
- package/dist/auth/index.js +17 -38
- package/dist/auth/jwt.d.ts +0 -16
- package/dist/auth/jwt.js +0 -13
- package/dist/auth/keychain.d.ts +6 -32
- package/dist/auth/keychain.js +83 -114
- package/dist/auth/oauth.d.ts +3 -32
- package/dist/auth/oauth.js +67 -61
- package/dist/auth/sessions.d.ts +5 -25
- package/dist/auth/sessions.js +20 -39
- package/dist/auth/token-refresh.d.ts +2 -22
- package/dist/auth/token-refresh.js +33 -36
- package/dist/cli.d.ts +1 -18
- package/dist/cli.js +30 -908
- package/dist/index.d.ts +0 -6
- package/dist/index.js +0 -7
- package/dist/lib/inspect-cache.d.ts +10 -0
- package/dist/lib/inspect-cache.js +75 -0
- package/dist/lib/next-steps.d.ts +27 -0
- package/dist/lib/next-steps.js +21 -0
- package/dist/matcher/ast-eval.d.ts +8 -0
- package/dist/matcher/ast-eval.js +95 -0
- package/dist/matcher/finding.d.ts +55 -0
- package/dist/matcher/finding.js +1 -0
- package/dist/matcher/index.d.ts +8 -0
- package/dist/matcher/index.js +202 -0
- package/dist/matcher/inference-candidates.d.ts +26 -0
- package/dist/matcher/inference-candidates.js +81 -0
- package/dist/matcher/walker.d.ts +7 -0
- package/dist/matcher/walker.js +71 -0
- package/dist/pattern-pack/index.d.ts +125 -0
- package/dist/pattern-pack/index.js +189 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/agents/privilege-separation.yaml +224 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/prompting/self-consistency-no-isolation.yaml +237 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/retrieval/context-injection-no-validator.yaml +348 -0
- package/dist/pattern-packs/zivis-public-0.2.0/capsules/security/late-org-filter.yaml +266 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/external_validator_on_facts.yaml +37 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/fact_validator_present.yaml +68 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/human_approval_gate.yaml +44 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/langgraph_state_machine_with_per_node_tools.yaml +35 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/per_sample_retrieval_diversification.yaml +38 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/prisma_extension_or_middleware_attaching_org_filter.yaml +31 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/row_level_security_policy.yaml +37 -0
- package/dist/pattern-packs/zivis-public-0.2.0/controls/source_attribution_present.yaml +58 -0
- package/dist/pattern-packs/zivis-public-0.2.0/manifest.json +167 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/agents/privilege-separation/identify.md +54 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/prompting/self-consistency-no-isolation/identify.md +60 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/retrieval/context-injection-no-validator/identify.md +109 -0
- package/dist/pattern-packs/zivis-public-0.2.0/prompts/security/late-org-filter/identify.md +78 -0
- package/dist/project-binding.d.ts +2 -19
- package/dist/project-binding.js +38 -21
- package/dist/prompts/audit-dependencies.d.ts +2 -0
- package/dist/prompts/audit-dependencies.js +47 -0
- package/dist/prompts/getting-started.d.ts +2 -0
- package/dist/prompts/getting-started.js +37 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.js +6 -0
- package/dist/resolve-application-id.d.ts +0 -4
- package/dist/resolve-application-id.js +0 -5
- package/dist/sanitize.d.ts +1 -21
- package/dist/sanitize.js +7 -41
- package/dist/server.d.ts +1 -13
- package/dist/server.js +142 -265
- package/dist/tools/artifacts.d.ts +76 -0
- package/dist/tools/artifacts.js +178 -0
- package/dist/tools/check-project.d.ts +5 -18
- package/dist/tools/check-project.js +122 -110
- package/dist/tools/check-repo-trust.d.ts +4 -19
- package/dist/tools/check-repo-trust.js +56 -47
- package/dist/tools/create-diagram.d.ts +0 -5
- package/dist/tools/create-diagram.js +0 -10
- package/dist/tools/create-document.d.ts +0 -5
- package/dist/tools/create-document.js +3 -9
- package/dist/tools/create-finding.d.ts +85 -0
- package/dist/tools/create-finding.js +136 -0
- package/dist/tools/delete-finding.d.ts +19 -0
- package/dist/tools/delete-finding.js +36 -0
- package/dist/tools/devx-run.d.ts +88 -0
- package/dist/tools/devx-run.js +175 -0
- package/dist/tools/discover-local-infra.d.ts +0 -10
- package/dist/tools/discover-local-infra.js +3 -73
- package/dist/tools/enterprise/get-org-zat.d.ts +0 -5
- package/dist/tools/enterprise/get-org-zat.js +0 -6
- package/dist/tools/explain-signal-for-diff.d.ts +34 -0
- package/dist/tools/explain-signal-for-diff.js +75 -0
- package/dist/tools/generate-diagram.d.ts +0 -6
- package/dist/tools/generate-diagram.js +21 -13
- package/dist/tools/get-application-overview.d.ts +0 -5
- package/dist/tools/get-application-overview.js +0 -6
- package/dist/tools/get-application.d.ts +0 -5
- package/dist/tools/get-application.js +0 -6
- package/dist/tools/get-diagram.d.ts +0 -5
- package/dist/tools/get-diagram.js +1 -11
- package/dist/tools/get-document.d.ts +0 -5
- package/dist/tools/get-document.js +0 -6
- package/dist/tools/get-oss-zat.d.ts +0 -5
- package/dist/tools/get-oss-zat.js +0 -7
- package/dist/tools/get-signal.d.ts +24 -0
- package/dist/tools/get-signal.js +75 -0
- package/dist/tools/get-started.d.ts +18 -0
- package/dist/tools/get-started.js +470 -0
- package/dist/tools/get-trust-keys.d.ts +0 -5
- package/dist/tools/get-trust-keys.js +0 -6
- package/dist/tools/import-openapi-endpoints.d.ts +0 -5
- package/dist/tools/import-openapi-endpoints.js +0 -6
- package/dist/tools/inspect-zat.d.ts +0 -5
- package/dist/tools/inspect-zat.js +0 -19
- package/dist/tools/inspect.d.ts +21 -0
- package/dist/tools/inspect.js +222 -0
- package/dist/tools/list-applications.d.ts +1 -6
- package/dist/tools/list-applications.js +0 -6
- package/dist/tools/list-diagrams.d.ts +0 -5
- package/dist/tools/list-diagrams.js +0 -6
- package/dist/tools/list-documents.d.ts +0 -5
- package/dist/tools/list-documents.js +0 -6
- package/dist/tools/list-endpoints.d.ts +1 -6
- package/dist/tools/list-endpoints.js +0 -6
- package/dist/tools/list-signals.d.ts +37 -0
- package/dist/tools/list-signals.js +83 -0
- package/dist/tools/manage-application.d.ts +64 -0
- package/dist/tools/manage-application.js +129 -0
- package/dist/tools/manage-diagram.d.ts +0 -5
- package/dist/tools/manage-diagram.js +0 -16
- package/dist/tools/manage-endpoint-lifecycle.d.ts +80 -0
- package/dist/tools/manage-endpoint-lifecycle.js +180 -0
- package/dist/tools/open-in-ide.d.ts +2 -14
- package/dist/tools/open-in-ide.js +0 -13
- package/dist/tools/review-change.d.ts +34 -0
- package/dist/tools/review-change.js +93 -0
- package/dist/tools/security-memory.d.ts +76 -0
- package/dist/tools/security-memory.js +202 -0
- package/dist/tools/security-review.d.ts +1 -21
- package/dist/tools/security-review.js +8 -108
- package/dist/tools/threat-get-capsule.d.ts +15 -0
- package/dist/tools/threat-get-capsule.js +53 -0
- package/dist/tools/threat-get-inference-prompt.d.ts +15 -0
- package/dist/tools/threat-get-inference-prompt.js +73 -0
- package/dist/tools/threat-list-relevant-capsules.d.ts +17 -0
- package/dist/tools/threat-list-relevant-capsules.js +158 -0
- package/dist/tools/threat-run-matcher.d.ts +17 -0
- package/dist/tools/threat-run-matcher.js +145 -0
- package/dist/tools/update-document.d.ts +0 -5
- package/dist/tools/update-document.js +3 -9
- package/dist/tools/update-endpoint.d.ts +1 -6
- package/dist/tools/update-endpoint.js +0 -7
- package/dist/tools/update-finding.d.ts +61 -0
- package/dist/tools/update-finding.js +80 -0
- package/dist/tools/update-mermaid-source.d.ts +0 -13
- package/dist/tools/update-mermaid-source.js +0 -14
- package/dist/tools/verify-trust-mark.d.ts +0 -5
- package/dist/tools/verify-trust-mark.js +0 -6
- package/dist/types.d.ts +14 -14
- package/dist/types.js +22 -28
- package/package.json +38 -15
- package/dist/api-client.js.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/jwt.js.map +0 -1
- package/dist/auth/keychain.js.map +0 -1
- package/dist/auth/oauth.js.map +0 -1
- package/dist/auth/sessions.js.map +0 -1
- package/dist/auth/token-refresh.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/project-binding.js.map +0 -1
- package/dist/resolve-application-id.js.map +0 -1
- package/dist/sanitize.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/tools/check-project.js.map +0 -1
- package/dist/tools/check-repo-trust.js.map +0 -1
- package/dist/tools/create-diagram.js.map +0 -1
- package/dist/tools/create-document.js.map +0 -1
- package/dist/tools/discover-local-infra.js.map +0 -1
- package/dist/tools/enterprise/capture-evidence.d.ts +0 -54
- package/dist/tools/enterprise/capture-evidence.js +0 -72
- package/dist/tools/enterprise/capture-evidence.js.map +0 -1
- package/dist/tools/enterprise/create-report-ticket.d.ts +0 -34
- package/dist/tools/enterprise/create-report-ticket.js +0 -44
- package/dist/tools/enterprise/create-report-ticket.js.map +0 -1
- package/dist/tools/enterprise/end-pentest-session.d.ts +0 -33
- package/dist/tools/enterprise/end-pentest-session.js +0 -42
- package/dist/tools/enterprise/end-pentest-session.js.map +0 -1
- package/dist/tools/enterprise/generate-report.d.ts +0 -55
- package/dist/tools/enterprise/generate-report.js +0 -111
- package/dist/tools/enterprise/generate-report.js.map +0 -1
- package/dist/tools/enterprise/get-org-zat.js.map +0 -1
- package/dist/tools/enterprise/get-report-status.d.ts +0 -27
- package/dist/tools/enterprise/get-report-status.js +0 -38
- package/dist/tools/enterprise/get-report-status.js.map +0 -1
- package/dist/tools/enterprise/get-threat-model.d.ts +0 -29
- package/dist/tools/enterprise/get-threat-model.js +0 -83
- package/dist/tools/enterprise/get-threat-model.js.map +0 -1
- package/dist/tools/enterprise/list-agents.d.ts +0 -42
- package/dist/tools/enterprise/list-agents.js +0 -95
- package/dist/tools/enterprise/list-agents.js.map +0 -1
- package/dist/tools/enterprise/list-report-issues.d.ts +0 -36
- package/dist/tools/enterprise/list-report-issues.js +0 -50
- package/dist/tools/enterprise/list-report-issues.js.map +0 -1
- package/dist/tools/enterprise/list-threat-models.d.ts +0 -36
- package/dist/tools/enterprise/list-threat-models.js +0 -82
- package/dist/tools/enterprise/list-threat-models.js.map +0 -1
- package/dist/tools/enterprise/manage-actor.d.ts +0 -58
- package/dist/tools/enterprise/manage-actor.js +0 -99
- package/dist/tools/enterprise/manage-actor.js.map +0 -1
- package/dist/tools/enterprise/manage-attack-scenario.d.ts +0 -70
- package/dist/tools/enterprise/manage-attack-scenario.js +0 -89
- package/dist/tools/enterprise/manage-attack-scenario.js.map +0 -1
- package/dist/tools/enterprise/manage-component.d.ts +0 -58
- package/dist/tools/enterprise/manage-component.js +0 -90
- package/dist/tools/enterprise/manage-component.js.map +0 -1
- package/dist/tools/enterprise/manage-data-asset.d.ts +0 -53
- package/dist/tools/enterprise/manage-data-asset.js +0 -90
- package/dist/tools/enterprise/manage-data-asset.js.map +0 -1
- package/dist/tools/enterprise/manage-data-flow.d.ts +0 -57
- package/dist/tools/enterprise/manage-data-flow.js +0 -98
- package/dist/tools/enterprise/manage-data-flow.js.map +0 -1
- package/dist/tools/enterprise/manage-finding.d.ts +0 -69
- package/dist/tools/enterprise/manage-finding.js +0 -106
- package/dist/tools/enterprise/manage-finding.js.map +0 -1
- package/dist/tools/enterprise/manage-security-control.d.ts +0 -59
- package/dist/tools/enterprise/manage-security-control.js +0 -96
- package/dist/tools/enterprise/manage-security-control.js.map +0 -1
- package/dist/tools/enterprise/manage-test-case.d.ts +0 -88
- package/dist/tools/enterprise/manage-test-case.js +0 -119
- package/dist/tools/enterprise/manage-test-case.js.map +0 -1
- package/dist/tools/enterprise/promote-finding-to-issue.d.ts +0 -36
- package/dist/tools/enterprise/promote-finding-to-issue.js +0 -65
- package/dist/tools/enterprise/promote-finding-to-issue.js.map +0 -1
- package/dist/tools/enterprise/publish-report-version.d.ts +0 -34
- package/dist/tools/enterprise/publish-report-version.js +0 -75
- package/dist/tools/enterprise/publish-report-version.js.map +0 -1
- package/dist/tools/enterprise/publish-test-to-library.d.ts +0 -31
- package/dist/tools/enterprise/publish-test-to-library.js +0 -40
- package/dist/tools/enterprise/publish-test-to-library.js.map +0 -1
- package/dist/tools/enterprise/record-test-result.d.ts +0 -67
- package/dist/tools/enterprise/record-test-result.js +0 -75
- package/dist/tools/enterprise/record-test-result.js.map +0 -1
- package/dist/tools/enterprise/start-pentest-session.d.ts +0 -35
- package/dist/tools/enterprise/start-pentest-session.js +0 -50
- package/dist/tools/enterprise/start-pentest-session.js.map +0 -1
- package/dist/tools/enterprise/sync-report-section.d.ts +0 -41
- package/dist/tools/enterprise/sync-report-section.js +0 -79
- package/dist/tools/enterprise/sync-report-section.js.map +0 -1
- package/dist/tools/enterprise/update-report-issue.d.ts +0 -55
- package/dist/tools/enterprise/update-report-issue.js +0 -69
- package/dist/tools/enterprise/update-report-issue.js.map +0 -1
- package/dist/tools/generate-diagram.js.map +0 -1
- package/dist/tools/get-agent-test-results.d.ts +0 -41
- package/dist/tools/get-agent-test-results.js +0 -86
- package/dist/tools/get-agent-test-results.js.map +0 -1
- package/dist/tools/get-application-overview.js.map +0 -1
- package/dist/tools/get-application.js.map +0 -1
- package/dist/tools/get-artifact-content.d.ts +0 -29
- package/dist/tools/get-artifact-content.js +0 -86
- package/dist/tools/get-artifact-content.js.map +0 -1
- package/dist/tools/get-diagram.js.map +0 -1
- package/dist/tools/get-document.js.map +0 -1
- package/dist/tools/get-finding-details.d.ts +0 -28
- package/dist/tools/get-finding-details.js +0 -43
- package/dist/tools/get-finding-details.js.map +0 -1
- package/dist/tools/get-findings.d.ts +0 -57
- package/dist/tools/get-findings.js +0 -103
- package/dist/tools/get-findings.js.map +0 -1
- package/dist/tools/get-oss-zat.js.map +0 -1
- package/dist/tools/get-recon-scan.d.ts +0 -27
- package/dist/tools/get-recon-scan.js +0 -46
- package/dist/tools/get-recon-scan.js.map +0 -1
- package/dist/tools/get-scan-output.d.ts +0 -27
- package/dist/tools/get-scan-output.js +0 -64
- package/dist/tools/get-scan-output.js.map +0 -1
- package/dist/tools/get-scenario-details.d.ts +0 -27
- package/dist/tools/get-scenario-details.js +0 -46
- package/dist/tools/get-scenario-details.js.map +0 -1
- package/dist/tools/get-test-case-results.d.ts +0 -37
- package/dist/tools/get-test-case-results.js +0 -66
- package/dist/tools/get-test-case-results.js.map +0 -1
- package/dist/tools/get-test-details.d.ts +0 -29
- package/dist/tools/get-test-details.js +0 -49
- package/dist/tools/get-test-details.js.map +0 -1
- package/dist/tools/get-trust-keys.js.map +0 -1
- package/dist/tools/import-openapi-endpoints.js.map +0 -1
- package/dist/tools/inspect-zat.js.map +0 -1
- package/dist/tools/list-agent-test-cases.d.ts +0 -41
- package/dist/tools/list-agent-test-cases.js +0 -73
- package/dist/tools/list-agent-test-cases.js.map +0 -1
- package/dist/tools/list-applications.js.map +0 -1
- package/dist/tools/list-diagrams.js.map +0 -1
- package/dist/tools/list-documents.js.map +0 -1
- package/dist/tools/list-endpoints.js.map +0 -1
- package/dist/tools/list-recon-scans.d.ts +0 -36
- package/dist/tools/list-recon-scans.js +0 -74
- package/dist/tools/list-recon-scans.js.map +0 -1
- package/dist/tools/list-scan-artifacts.d.ts +0 -41
- package/dist/tools/list-scan-artifacts.js +0 -63
- package/dist/tools/list-scan-artifacts.js.map +0 -1
- package/dist/tools/list-scans.d.ts +0 -44
- package/dist/tools/list-scans.js +0 -91
- package/dist/tools/list-scans.js.map +0 -1
- package/dist/tools/list-test-library.d.ts +0 -44
- package/dist/tools/list-test-library.js +0 -83
- package/dist/tools/list-test-library.js.map +0 -1
- package/dist/tools/list-test-scenarios.d.ts +0 -31
- package/dist/tools/list-test-scenarios.js +0 -66
- package/dist/tools/list-test-scenarios.js.map +0 -1
- package/dist/tools/local-scan.d.ts +0 -40
- package/dist/tools/local-scan.js +0 -261
- package/dist/tools/local-scan.js.map +0 -1
- package/dist/tools/manage-diagram.js.map +0 -1
- package/dist/tools/open-in-ide.js.map +0 -1
- package/dist/tools/run-test-scenario.d.ts +0 -37
- package/dist/tools/run-test-scenario.js +0 -70
- package/dist/tools/run-test-scenario.js.map +0 -1
- package/dist/tools/scan-pr.d.ts +0 -27
- package/dist/tools/scan-pr.js +0 -51
- package/dist/tools/scan-pr.js.map +0 -1
- package/dist/tools/security-review.js.map +0 -1
- package/dist/tools/setup-red-team-target.d.ts +0 -79
- package/dist/tools/setup-red-team-target.js +0 -430
- package/dist/tools/setup-red-team-target.js.map +0 -1
- package/dist/tools/triage-finding.d.ts +0 -47
- package/dist/tools/triage-finding.js +0 -116
- package/dist/tools/triage-finding.js.map +0 -1
- package/dist/tools/update-document.js.map +0 -1
- package/dist/tools/update-endpoint.js.map +0 -1
- package/dist/tools/update-mermaid-source.js.map +0 -1
- package/dist/tools/verify-trust-mark.js.map +0 -1
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema_version": "1.0.0",
|
|
3
|
+
"pack_id": "zivis-public",
|
|
4
|
+
"pack_name": "ZIVIS Public Pattern Pack",
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"built_at": "2026-08-31T00:01:43.737Z",
|
|
7
|
+
"tier": "customer_safe",
|
|
8
|
+
"description": "ZIVIS-curated public pattern pack — capsules + inference prompts evaluated locally on the user's machine.",
|
|
9
|
+
"capsules": [
|
|
10
|
+
{
|
|
11
|
+
"id": "agents.privilege-separation",
|
|
12
|
+
"version": "0.1.0",
|
|
13
|
+
"path": "capsules/agents/privilege-separation.yaml",
|
|
14
|
+
"sha256": "716f9c766add6f51eac2568eefc328a030901520cf0d3098ed577651c98773ea",
|
|
15
|
+
"category": "agents",
|
|
16
|
+
"lifecycle": "draft",
|
|
17
|
+
"applicable_languages": [
|
|
18
|
+
"typescript",
|
|
19
|
+
"javascript",
|
|
20
|
+
"python"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "prompting.self-consistency-no-isolation",
|
|
25
|
+
"version": "0.1.0",
|
|
26
|
+
"path": "capsules/prompting/self-consistency-no-isolation.yaml",
|
|
27
|
+
"sha256": "e1b11e02f7d13cfaeb8ed7f8ae7cae05062bcf8e6fbb226eed75e8bf7fa6e8d1",
|
|
28
|
+
"category": "prompting",
|
|
29
|
+
"lifecycle": "draft",
|
|
30
|
+
"applicable_languages": [
|
|
31
|
+
"typescript",
|
|
32
|
+
"javascript",
|
|
33
|
+
"python"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "retrieval.context-injection-no-validator",
|
|
38
|
+
"version": "0.1.0",
|
|
39
|
+
"path": "capsules/retrieval/context-injection-no-validator.yaml",
|
|
40
|
+
"sha256": "cb7ea3851894a946e34ab62ca42d1cce0a6f43c893f38cfd593b8daf32462fd8",
|
|
41
|
+
"category": "retrieval",
|
|
42
|
+
"lifecycle": "draft",
|
|
43
|
+
"applicable_languages": [
|
|
44
|
+
"typescript",
|
|
45
|
+
"javascript",
|
|
46
|
+
"python"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "security.late-org-filter",
|
|
51
|
+
"version": "0.1.0",
|
|
52
|
+
"path": "capsules/security/late-org-filter.yaml",
|
|
53
|
+
"sha256": "aeb9b327be936770ea6d208f6e687ae095a79976770e47b27ce5c97df3e43a3b",
|
|
54
|
+
"category": "security",
|
|
55
|
+
"lifecycle": "draft",
|
|
56
|
+
"applicable_languages": [
|
|
57
|
+
"typescript",
|
|
58
|
+
"javascript",
|
|
59
|
+
"python",
|
|
60
|
+
"go"
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"prompts": [
|
|
65
|
+
{
|
|
66
|
+
"path": "prompts/agents/privilege-separation/identify.md",
|
|
67
|
+
"sha256": "eda7d288f9d1c6f7dfc18d2856300df76e8c4fdb5f18f3490f39ddf7117853e4",
|
|
68
|
+
"capsule_id": "agents.privilege-separation"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"path": "prompts/prompting/self-consistency-no-isolation/identify.md",
|
|
72
|
+
"sha256": "e05ffb777550a2a79b3c5b8e75d3e3c7fb2da2cd43ab0fcf202a9eda0f29c10f",
|
|
73
|
+
"capsule_id": "prompting.self-consistency-no-isolation"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"path": "prompts/retrieval/context-injection-no-validator/identify.md",
|
|
77
|
+
"sha256": "31c0d67ffddc75e2d024eead7977c0b47342b4804663598f170aaabf24a5ed39",
|
|
78
|
+
"capsule_id": "retrieval.context-injection-no-validator"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"path": "prompts/security/late-org-filter/identify.md",
|
|
82
|
+
"sha256": "8e602179572ace5d457f8582b67e9d6ab29c675e82964481848c95e5ccb83e1e",
|
|
83
|
+
"capsule_id": "security.late-org-filter"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"controls": [
|
|
87
|
+
{
|
|
88
|
+
"id": "external_validator_on_facts",
|
|
89
|
+
"path": "controls/external_validator_on_facts.yaml",
|
|
90
|
+
"sha256": "17ec428bf4cfc55b9f464d5c34e7a1ccc854a6c5822e1a4f6848db53ab3bccce",
|
|
91
|
+
"applicable_languages": [
|
|
92
|
+
"typescript",
|
|
93
|
+
"javascript",
|
|
94
|
+
"python"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "fact_validator_present",
|
|
99
|
+
"path": "controls/fact_validator_present.yaml",
|
|
100
|
+
"sha256": "4f7be51328f9a73be7846601a2aa2991364ed88bc2ae43a29ee0f0b4bc69da5f",
|
|
101
|
+
"applicable_languages": [
|
|
102
|
+
"typescript",
|
|
103
|
+
"javascript",
|
|
104
|
+
"python"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "human_approval_gate",
|
|
109
|
+
"path": "controls/human_approval_gate.yaml",
|
|
110
|
+
"sha256": "ccafcb0bbf0fc68bb02fd018f87a870471fa4653363459293a24f0a65dc53b99",
|
|
111
|
+
"applicable_languages": [
|
|
112
|
+
"typescript",
|
|
113
|
+
"javascript",
|
|
114
|
+
"python"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"id": "langgraph_state_machine_with_per_node_tools",
|
|
119
|
+
"path": "controls/langgraph_state_machine_with_per_node_tools.yaml",
|
|
120
|
+
"sha256": "29b46ad213173c52b5d96f744d74179193e61a6dc9c43e6b0b94b013ec94a32c",
|
|
121
|
+
"applicable_languages": [
|
|
122
|
+
"typescript",
|
|
123
|
+
"javascript",
|
|
124
|
+
"python"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "per_sample_retrieval_diversification",
|
|
129
|
+
"path": "controls/per_sample_retrieval_diversification.yaml",
|
|
130
|
+
"sha256": "9b4db7c6d620f46e93887f793a3e77bdabe280521b5ce0320d84d0c6b31ae653",
|
|
131
|
+
"applicable_languages": [
|
|
132
|
+
"typescript",
|
|
133
|
+
"javascript",
|
|
134
|
+
"python"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "prisma_extension_or_middleware_attaching_org_filter",
|
|
139
|
+
"path": "controls/prisma_extension_or_middleware_attaching_org_filter.yaml",
|
|
140
|
+
"sha256": "196676bebd107c4345a5f9227380982e5e2da0f2a8ad87e48517b5bd924abc31",
|
|
141
|
+
"applicable_languages": [
|
|
142
|
+
"typescript",
|
|
143
|
+
"javascript"
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"id": "row_level_security_policy",
|
|
148
|
+
"path": "controls/row_level_security_policy.yaml",
|
|
149
|
+
"sha256": "42d2a6f561a89b6dae80f04e25c65081fb22b660a59920e1f5c0ed438f394c68",
|
|
150
|
+
"applicable_languages": [
|
|
151
|
+
"typescript",
|
|
152
|
+
"javascript",
|
|
153
|
+
"python"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "source_attribution_present",
|
|
158
|
+
"path": "controls/source_attribution_present.yaml",
|
|
159
|
+
"sha256": "302c74045965b5452f5088b18cb86bf77a89f2de3a78015bf57d2845180b9465",
|
|
160
|
+
"applicable_languages": [
|
|
161
|
+
"typescript",
|
|
162
|
+
"javascript",
|
|
163
|
+
"python"
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
]
|
|
167
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Inference prompt: agents.privilege-separation — identify
|
|
2
|
+
|
|
3
|
+
You are assisting with secure agentic-AI architecture review. The user is
|
|
4
|
+
working on a codebase that has been flagged by deterministic detectors as
|
|
5
|
+
*possibly* lacking privilege separation between agents. Your job is to
|
|
6
|
+
look at the attached code context and produce a structured verdict.
|
|
7
|
+
|
|
8
|
+
## Pattern definition
|
|
9
|
+
|
|
10
|
+
**Privilege separation** means each agent in a multi-agent system is bound
|
|
11
|
+
only to the minimum tools required for its role. The anti-pattern is a
|
|
12
|
+
single shared tool registry that every agent inherits.
|
|
13
|
+
|
|
14
|
+
## What you are evaluating
|
|
15
|
+
|
|
16
|
+
1. Does the code construct two or more agents (or two or more entry points
|
|
17
|
+
that invoke the same agent factory) with a **shared** tool array?
|
|
18
|
+
2. Is there a per-agent capability filter, authorization layer, or
|
|
19
|
+
capability-token check between an agent and its tool dispatch? If so,
|
|
20
|
+
the pattern does *not* fire even when tools appear shared.
|
|
21
|
+
3. If LangGraph is used: are tools bound per node (good), or is one tool
|
|
22
|
+
list passed to a top-level `create_react_agent` covering every node
|
|
23
|
+
(anti-pattern)?
|
|
24
|
+
|
|
25
|
+
## What does NOT count as privilege separation
|
|
26
|
+
|
|
27
|
+
- Comments mentioning least privilege without code enforcing it.
|
|
28
|
+
- A shared tool list with one agent renamed at runtime.
|
|
29
|
+
- Defensive prompt instructions ("don't use the database tool unless…")
|
|
30
|
+
— prompts are not authorization.
|
|
31
|
+
|
|
32
|
+
## Output
|
|
33
|
+
|
|
34
|
+
Return JSON only, matching the capsule's `expected_output_schema`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"verdict": "absent | present | unclear",
|
|
39
|
+
"confidence": 0.0,
|
|
40
|
+
"rationale": "one paragraph",
|
|
41
|
+
"evidence_spans": [
|
|
42
|
+
{ "file": "src/agent.ts", "start_line": 10, "end_line": 40, "note": "..." }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
- `verdict: absent` — the anti-pattern fires (shared registry, no scoping).
|
|
48
|
+
- `verdict: present` — privilege separation is correctly implemented.
|
|
49
|
+
- `verdict: unclear` — the available context is ambiguous; do not guess.
|
|
50
|
+
|
|
51
|
+
Cite line numbers from the snippet only. Do not invent files. Do not
|
|
52
|
+
fabricate evidence. If a concept (e.g. "authorization layer") is mentioned
|
|
53
|
+
but you cannot identify the line that implements it, mark `unclear` and
|
|
54
|
+
explain.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Inference prompt: prompting.self-consistency-no-isolation — identify
|
|
2
|
+
|
|
3
|
+
You are reviewing code that has been flagged as *possibly* aggregating multiple
|
|
4
|
+
LLM samples without context isolation. Your job is to determine whether each
|
|
5
|
+
sample actually sees independent context, or whether they all share the same
|
|
6
|
+
input — making the aggregation a confidence-amplifier rather than a
|
|
7
|
+
confidence-filter.
|
|
8
|
+
|
|
9
|
+
## What you are evaluating
|
|
10
|
+
|
|
11
|
+
1. How many LLM completion calls happen for one user request? Identify the
|
|
12
|
+
loop, `Promise.all`, list comprehension, or fan-out construct.
|
|
13
|
+
2. Does each sample receive the **same** `messages` / prompt argument verbatim,
|
|
14
|
+
or is there per-sample variation (different retrieval query, different
|
|
15
|
+
temperature, different seed, different context window)?
|
|
16
|
+
3. How is the result aggregated? Voting, ranking, similarity-based merging,
|
|
17
|
+
first-passing-validator, or simple averaging?
|
|
18
|
+
4. Is there an external check on the aggregated output — e.g. a fact validator,
|
|
19
|
+
tool-output validation, human approval gate?
|
|
20
|
+
5. Does the user-facing surface advertise the vote count as a "confidence"
|
|
21
|
+
number? That's the strongest tell that independence is being assumed.
|
|
22
|
+
|
|
23
|
+
## What does NOT count as context isolation
|
|
24
|
+
|
|
25
|
+
- Different agent *names* with the same prompt and same retrieval.
|
|
26
|
+
- Comments saying "ensemble" without per-sample variation in the call.
|
|
27
|
+
- Setting `n=N` on a single OpenAI completion call (the model produces N
|
|
28
|
+
samples but they share the entire prompt and context — same problem).
|
|
29
|
+
- Different temperatures on every sample WITH the same retrieval — partial
|
|
30
|
+
mitigation but not full isolation; mark `unclear` and explain.
|
|
31
|
+
|
|
32
|
+
## Output
|
|
33
|
+
|
|
34
|
+
Return JSON only, matching the capsule's `expected_output_schema`:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"independence_assessment": "shared_context | isolated_context | unclear",
|
|
39
|
+
"confidence_claim_risk": "high | medium | low",
|
|
40
|
+
"rationale": "one paragraph",
|
|
41
|
+
"recommended_controls": [
|
|
42
|
+
"per_sample_retrieval_diversification",
|
|
43
|
+
"external_validator",
|
|
44
|
+
"human_approval"
|
|
45
|
+
],
|
|
46
|
+
"evidence_spans": [
|
|
47
|
+
{ "file": "src/agent.ts", "start_line": 10, "end_line": 40, "note": "..." }
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- `shared_context` — every sample sees identical input. The vote is
|
|
53
|
+
amplifying rather than filtering. `confidence_claim_risk` should be `high`
|
|
54
|
+
if any user-facing label calls the vote count a confidence.
|
|
55
|
+
- `isolated_context` — per-sample retrieval, temperature, or seed variation
|
|
56
|
+
IS present. The aggregation is doing real work.
|
|
57
|
+
- `unclear` — context plumbing is too complex to determine from the snippet,
|
|
58
|
+
or the code uses a custom aggregator. Don't guess; ask in the rationale.
|
|
59
|
+
|
|
60
|
+
Cite line numbers from the snippet only. Do not fabricate evidence.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Inference prompt: retrieval.context-injection-no-validator — identify
|
|
2
|
+
|
|
3
|
+
You are reviewing code that appears to implement retrieval-augmented
|
|
4
|
+
generation (RAG): a retriever returns documents and an LLM call consumes
|
|
5
|
+
them. The pattern flagged by ZIVIS suggests there is no validator,
|
|
6
|
+
sanitizer, or source-attribution check between the retriever and the
|
|
7
|
+
model. Your job is to confirm or refute that — strictly based on the
|
|
8
|
+
actual source spans provided. Do not speculate about code you cannot see.
|
|
9
|
+
|
|
10
|
+
## What you are evaluating
|
|
11
|
+
|
|
12
|
+
1. **The retrieval call.** Where does it run? What does it return —
|
|
13
|
+
strings, document objects with metadata, raw search hits? Is the
|
|
14
|
+
returned content user-controllable (uploaded files, scraped pages,
|
|
15
|
+
external APIs) or fully internal-curated?
|
|
16
|
+
|
|
17
|
+
2. **The LLM call that consumes the retrieved content.** How is the
|
|
18
|
+
retrieved text placed into the prompt — concatenated into a system
|
|
19
|
+
prompt, into a user-role message, into a `tools` description?
|
|
20
|
+
|
|
21
|
+
3. **The path between retriever and LLM call.** Does any function in
|
|
22
|
+
that path perform validation? Look for:
|
|
23
|
+
- Imports / calls of guardrails libraries (`guardrails`, `nemoguardrails`,
|
|
24
|
+
`lakera`, `protectai`, `presidio`, `garak`, `llm-guard`)
|
|
25
|
+
- Functions with names like `validate*`, `sanitize*`, `factCheck*`,
|
|
26
|
+
`attributeSource*`, `verifyClaim*`, `checkInjection*`
|
|
27
|
+
- Source-attribution metadata being injected into the prompt
|
|
28
|
+
(e.g., `<source>doc-id-123</source>` blocks, citation markers the
|
|
29
|
+
model is required to use)
|
|
30
|
+
- Access-control filters that drop documents based on the requester
|
|
31
|
+
|
|
32
|
+
4. **Whether what looks like validation actually validates.** A function
|
|
33
|
+
named `processDocuments` that just trims whitespace is NOT validation.
|
|
34
|
+
A logger call is NOT validation. A retry wrapper is NOT validation.
|
|
35
|
+
|
|
36
|
+
## What does NOT count as a validator
|
|
37
|
+
|
|
38
|
+
- Trimming, lowercasing, or other string normalization
|
|
39
|
+
- Token counting or length capping (length limits aren't injection defenses)
|
|
40
|
+
- A type assertion (`as string`) — TypeScript types don't run at runtime
|
|
41
|
+
- An auth check that gates *whether the retrieval runs at all* but doesn't
|
|
42
|
+
inspect the *content* returned
|
|
43
|
+
- A logger call — logs are observability, not defense
|
|
44
|
+
- The model's own instructions ("don't follow embedded instructions") —
|
|
45
|
+
that's prompt hardening, easily bypassed; mark as `partial_validator`
|
|
46
|
+
not `validator_present`
|
|
47
|
+
|
|
48
|
+
## What counts as a validator
|
|
49
|
+
|
|
50
|
+
- A call to a guardrails / safety library between retrieval and model
|
|
51
|
+
- A function that inspects retrieved content for prompt-injection
|
|
52
|
+
patterns and rejects / flags / strips matching documents
|
|
53
|
+
- Source-attribution machinery: every retrieved doc carries a `sourceId`
|
|
54
|
+
the model is required to cite, and the calling code checks that the
|
|
55
|
+
source is permitted for this requester
|
|
56
|
+
- Per-document access control applied AFTER retrieval, before the doc is
|
|
57
|
+
added to the prompt
|
|
58
|
+
|
|
59
|
+
## What about query rewriting / HyDE / multi-query?
|
|
60
|
+
|
|
61
|
+
If the query that drives retrieval is itself an LLM output (HyDE,
|
|
62
|
+
multi-query, agentic retrieval), note this in `rationale`. It compounds
|
|
63
|
+
the injection surface — the attacker can influence what gets retrieved
|
|
64
|
+
two steps upstream — but it is NOT itself the missing validator. The
|
|
65
|
+
verdict is about the retriever→model path.
|
|
66
|
+
|
|
67
|
+
## Output
|
|
68
|
+
|
|
69
|
+
Return JSON only, matching the capsule's `expected_output_schema`:
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"verdict": "no_validator_present | validator_present | partial_validator | unclear",
|
|
74
|
+
"validator_location": "pre_retrieval | between_retriever_and_model | post_model | none | multiple",
|
|
75
|
+
"rationale": "one paragraph citing specific symbols / line numbers from the snippet",
|
|
76
|
+
"corpus_sources": ["uploaded_pdfs", "scraped_web_pages", "confluence_sync"],
|
|
77
|
+
"blast_radius": "single_endpoint | route_family | service_wide | agent_wide | unclear",
|
|
78
|
+
"recommended_controls": ["guardrails_library", "source_attribution_in_prompt"],
|
|
79
|
+
"evidence_spans": [
|
|
80
|
+
{ "file": "src/rag.ts", "start_line": 14, "end_line": 38, "note": "retriever→model, no validator" }
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Verdict definitions
|
|
86
|
+
|
|
87
|
+
- `no_validator_present` — retrieval feeds the model directly; nothing
|
|
88
|
+
between them inspects content.
|
|
89
|
+
- `validator_present` — a real validator (per the "what counts" list)
|
|
90
|
+
sits between retriever and model.
|
|
91
|
+
- `partial_validator` — something inspects content but with known gaps:
|
|
92
|
+
e.g., regex-only injection filter, or only one document type is
|
|
93
|
+
validated, or validation only runs in some branches. Use this when
|
|
94
|
+
there is *some* defense but it doesn't cover the full path.
|
|
95
|
+
- `unclear` — the snippet doesn't show enough of the path to determine.
|
|
96
|
+
Don't guess. Surface what you'd need to see to decide.
|
|
97
|
+
|
|
98
|
+
### Blast-radius guidance
|
|
99
|
+
|
|
100
|
+
- `single_endpoint` — one route handler.
|
|
101
|
+
- `route_family` — a helper / chain reused across a router.
|
|
102
|
+
- `service_wide` — the retrieval helper is the shared way the service
|
|
103
|
+
answers questions.
|
|
104
|
+
- `agent_wide` — an agent's tool-use path itself runs through this
|
|
105
|
+
retriever (more dangerous: agent can iterate on injections).
|
|
106
|
+
|
|
107
|
+
Cite line numbers and symbol names from the snippet only. Do not invent
|
|
108
|
+
files. If a control is named in code but you can't see its
|
|
109
|
+
implementation, mark `unclear` and note which file you'd need.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Inference prompt: security.late-org-filter — identify
|
|
2
|
+
|
|
3
|
+
You are reviewing a multi-tenant route handler, stream, or async iterator
|
|
4
|
+
that has been flagged as *possibly* applying tenant scoping at the
|
|
5
|
+
presentation layer rather than inside the data query. The pattern is one of
|
|
6
|
+
the most common causes of cross-tenant data leaks in SaaS systems. Your job
|
|
7
|
+
is to determine where in the stack the org/tenant filter actually lives.
|
|
8
|
+
|
|
9
|
+
## What you are evaluating
|
|
10
|
+
|
|
11
|
+
1. Where does the query that returns rows execute? Identify the call (raw
|
|
12
|
+
SQL, ORM method, repository call, fetch, etc.). Does its `WHERE` /
|
|
13
|
+
`where:` / equivalent clause include an org / tenant predicate?
|
|
14
|
+
2. Where does the filter referencing `request.orgId` (or a session-scoped
|
|
15
|
+
tenant id) fire? In the query, in a middleware, in the response loop,
|
|
16
|
+
in the stream emit?
|
|
17
|
+
3. Is there a row-level security policy, ORM middleware, or repository
|
|
18
|
+
pattern that *implicitly* scopes every query — even queries that don't
|
|
19
|
+
themselves mention tenant?
|
|
20
|
+
4. For SSE / stream / async iterator responses: does the filter run per
|
|
21
|
+
emit, before any logging, tracing, or buffering hook?
|
|
22
|
+
5. Does any logging or observability hook capture the row set BEFORE the
|
|
23
|
+
filter applies?
|
|
24
|
+
|
|
25
|
+
## What does NOT count as data-layer scoping
|
|
26
|
+
|
|
27
|
+
- A presentation-layer filter that "looks like" it's inside the query just
|
|
28
|
+
because it sits in the same function body. Trace where the SQL actually
|
|
29
|
+
runs.
|
|
30
|
+
- A comment claiming the ORM is org-scoped without code enforcing it.
|
|
31
|
+
- A type system that makes "OrgScopedQuery<T>" but is never actually
|
|
32
|
+
required at the call site.
|
|
33
|
+
- An auth middleware that *checks* the user can access the org but does
|
|
34
|
+
not constrain what rows the subsequent query returns.
|
|
35
|
+
|
|
36
|
+
## What counts as data-layer scoping
|
|
37
|
+
|
|
38
|
+
- A `WHERE org_id = $1` (or equivalent) inside the query itself.
|
|
39
|
+
- Postgres row-level security with a session GUC the connection sets.
|
|
40
|
+
- Prisma extension / SQLAlchemy event listener / ORM middleware that
|
|
41
|
+
appends the predicate.
|
|
42
|
+
- Repository pattern where the `findByX(ctx)` method takes the org from
|
|
43
|
+
`ctx` and mandates the predicate.
|
|
44
|
+
|
|
45
|
+
## Output
|
|
46
|
+
|
|
47
|
+
Return JSON only, matching the capsule's `expected_output_schema`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"verdict": "late_filter_present | scoped_at_query | partial_scope | unclear",
|
|
52
|
+
"scope_location": "data_layer | query_layer | presentation_layer | multiple | none",
|
|
53
|
+
"rationale": "one paragraph",
|
|
54
|
+
"blast_radius": "single_endpoint | route_family | service_wide | unclear",
|
|
55
|
+
"recommended_controls": ["row_level_security", "query_helper"],
|
|
56
|
+
"evidence_spans": [
|
|
57
|
+
{ "file": "routes/queue.ts", "start_line": 18, "end_line": 60, "note": "..." }
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- `late_filter_present` — the query returns cross-tenant rows; the only
|
|
63
|
+
enforcement is at the response/emit layer.
|
|
64
|
+
- `scoped_at_query` — the query itself filters by org/tenant; presentation
|
|
65
|
+
filter (if any) is defense in depth.
|
|
66
|
+
- `partial_scope` — *some* queries are scoped at the data layer but at
|
|
67
|
+
least one in the path is not.
|
|
68
|
+
- `unclear` — query plumbing crosses too many layers to determine from the
|
|
69
|
+
snippet. Don't guess.
|
|
70
|
+
|
|
71
|
+
For `blast_radius`: estimate based on whether the unscoped query helper is
|
|
72
|
+
used elsewhere. `service_wide` if the helper / repository method is shared
|
|
73
|
+
across many routes; `route_family` if reused inside the same router;
|
|
74
|
+
`single_endpoint` if isolated.
|
|
75
|
+
|
|
76
|
+
Cite line numbers from the snippet only. Do not invent files. If a control
|
|
77
|
+
(e.g. "RLS") is mentioned but you can't see the policy text, mark
|
|
78
|
+
`unclear` and explain.
|
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project Binding
|
|
3
|
-
*
|
|
4
|
-
* Detects and validates `.zivis/project.json` files that bind a project
|
|
5
|
-
* directory to a specific ZIVIS session/org. This prevents accidentally
|
|
6
|
-
* using the wrong org's MCP connection in a project.
|
|
7
|
-
*
|
|
8
|
-
* The binding file is optional — if absent, the server starts normally.
|
|
9
|
-
* If present, the configured ZIVIS_SESSION must match the binding's
|
|
10
|
-
* session field or the server refuses to start.
|
|
11
|
-
*/
|
|
12
1
|
import type { ProjectBinding, ZivisConfig } from "./types.js";
|
|
13
|
-
/**
|
|
14
|
-
* Walk up from `cwd` looking for `.zivis/project.json`.
|
|
15
|
-
* Returns the parsed binding or null if not found.
|
|
16
|
-
*/
|
|
17
2
|
export declare function detectProjectBinding(cwd: string): {
|
|
18
3
|
binding: ProjectBinding;
|
|
19
4
|
filePath: string;
|
|
20
5
|
} | null;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
* Exits with code 1 on mismatch.
|
|
24
|
-
*/
|
|
6
|
+
export declare function resolveConfigFromBinding(cwd?: string): ZivisConfig;
|
|
7
|
+
export declare function resolveMcpSessionForWorkspace(incoming: ZivisConfig, workspacePath: string, detected: ReturnType<typeof detectProjectBinding>, fromBinding: ZivisConfig): string;
|
|
25
8
|
export declare function validateProjectBinding(binding: ProjectBinding, filePath: string, config: ZivisConfig): void;
|
package/dist/project-binding.js
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project Binding
|
|
3
|
-
*
|
|
4
|
-
* Detects and validates `.zivis/project.json` files that bind a project
|
|
5
|
-
* directory to a specific ZIVIS session/org. This prevents accidentally
|
|
6
|
-
* using the wrong org's MCP connection in a project.
|
|
7
|
-
*
|
|
8
|
-
* The binding file is optional — if absent, the server starts normally.
|
|
9
|
-
* If present, the configured ZIVIS_SESSION must match the binding's
|
|
10
|
-
* session field or the server refuses to start.
|
|
11
|
-
*/
|
|
12
1
|
import * as fs from "node:fs";
|
|
13
2
|
import * as path from "node:path";
|
|
3
|
+
import { DEFAULT_CONFIG } from "./types.js";
|
|
14
4
|
const BINDING_DIR = ".zivis";
|
|
15
5
|
const BINDING_FILE = "project.json";
|
|
16
|
-
/**
|
|
17
|
-
* Walk up from `cwd` looking for `.zivis/project.json`.
|
|
18
|
-
* Returns the parsed binding or null if not found.
|
|
19
|
-
*/
|
|
20
6
|
export function detectProjectBinding(cwd) {
|
|
21
7
|
let dir = path.resolve(cwd);
|
|
22
8
|
const root = path.parse(dir).root;
|
|
@@ -41,12 +27,44 @@ export function detectProjectBinding(cwd) {
|
|
|
41
27
|
}
|
|
42
28
|
return null;
|
|
43
29
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
30
|
+
export function resolveConfigFromBinding(cwd) {
|
|
31
|
+
const detected = detectProjectBinding(cwd ?? process.cwd());
|
|
32
|
+
if (!detected)
|
|
33
|
+
return DEFAULT_CONFIG;
|
|
34
|
+
const { binding } = detected;
|
|
35
|
+
return {
|
|
36
|
+
...DEFAULT_CONFIG,
|
|
37
|
+
...(binding.session ? { session: binding.session } : {}),
|
|
38
|
+
...(binding.apiBaseUrl ? { apiBaseUrl: binding.apiBaseUrl } : {}),
|
|
39
|
+
...(binding.oauthApiUrl ? { oauthApiUrl: binding.oauthApiUrl } : {}),
|
|
40
|
+
...(binding.oauthClientId ? { oauthClientId: binding.oauthClientId } : {}),
|
|
41
|
+
...(binding.keychainPrefix ? { keychainPrefix: binding.keychainPrefix } : {}),
|
|
42
|
+
...(binding.configDir ? { configDir: binding.configDir } : {}),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function resolveMcpSessionForWorkspace(incoming, workspacePath, detected, fromBinding) {
|
|
46
|
+
const envSession = process.env.ZIVIS_SESSION?.trim();
|
|
47
|
+
if (envSession !== undefined && envSession !== "") {
|
|
48
|
+
if (envSession === "default" &&
|
|
49
|
+
detected?.binding.session &&
|
|
50
|
+
detected.binding.session !== "default") {
|
|
51
|
+
return detected.binding.session;
|
|
52
|
+
}
|
|
53
|
+
return envSession;
|
|
54
|
+
}
|
|
55
|
+
if (detected?.binding.session) {
|
|
56
|
+
return detected.binding.session;
|
|
57
|
+
}
|
|
58
|
+
if (incoming.session !== undefined && incoming.session !== "") {
|
|
59
|
+
return incoming.session;
|
|
60
|
+
}
|
|
61
|
+
if (fromBinding.session) {
|
|
62
|
+
return fromBinding.session;
|
|
63
|
+
}
|
|
64
|
+
return "default";
|
|
65
|
+
}
|
|
48
66
|
export function validateProjectBinding(binding, filePath, config) {
|
|
49
|
-
const currentSession = config.session
|
|
67
|
+
const currentSession = config.session ?? "default";
|
|
50
68
|
const expectedSession = binding.session;
|
|
51
69
|
if (currentSession !== expectedSession) {
|
|
52
70
|
const orgLabel = binding.orgName
|
|
@@ -64,4 +82,3 @@ export function validateProjectBinding(binding, filePath, config) {
|
|
|
64
82
|
const orgLabel = binding.orgName ? ` (${binding.orgName})` : "";
|
|
65
83
|
console.error(`[zivis] Project binding verified: session "${expectedSession}"${orgLabel}`);
|
|
66
84
|
}
|
|
67
|
-
//# sourceMappingURL=project-binding.js.map
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function registerAuditDependenciesPrompt(server) {
|
|
2
|
+
server.registerPrompt("audit-dependencies", {
|
|
3
|
+
description: "Check the open source libraries this project depends on for security risks. No account setup needed.",
|
|
4
|
+
argsSchema: {},
|
|
5
|
+
}, async () => ({
|
|
6
|
+
messages: [
|
|
7
|
+
{
|
|
8
|
+
role: "user",
|
|
9
|
+
content: {
|
|
10
|
+
type: "text",
|
|
11
|
+
text: `I want to check whether the open source libraries I'm using are safe.
|
|
12
|
+
|
|
13
|
+
Please do the following:
|
|
14
|
+
|
|
15
|
+
1. Look at the dependency files in this project. In priority order, check:
|
|
16
|
+
- package.json (look for the "dependencies" and "devDependencies" keys)
|
|
17
|
+
- requirements.txt or pyproject.toml
|
|
18
|
+
- go.mod
|
|
19
|
+
- Any other manifest files you can see
|
|
20
|
+
|
|
21
|
+
2. From those files, find all external dependencies that have a GitHub repository.
|
|
22
|
+
- Skip internal packages (those starting with "@my-company/" or similar private namespaces).
|
|
23
|
+
- Skip built-in packages (e.g. node built-ins like "fs", "path").
|
|
24
|
+
|
|
25
|
+
3. For each external dependency that has a public GitHub repo, call \`zivis_check_repo_trust\`
|
|
26
|
+
with the owner/repo string (e.g. "openai/openai-node").
|
|
27
|
+
|
|
28
|
+
4. After checking each one, give me a summary table with columns:
|
|
29
|
+
- Package name
|
|
30
|
+
- Trust grade (A+ through F)
|
|
31
|
+
- Risk level (Safe / Low risk / Moderate / High / Critical)
|
|
32
|
+
- Any critical or high findings (one line each)
|
|
33
|
+
|
|
34
|
+
5. Flag any package with grade C or below and explain in plain English why it's risky.
|
|
35
|
+
|
|
36
|
+
6. At the end, suggest the two highest-priority actions to take based on the results.
|
|
37
|
+
|
|
38
|
+
Ground rules:
|
|
39
|
+
- Process dependencies one at a time so I can follow along.
|
|
40
|
+
- If a package doesn't have a GitHub repo, skip it and say "(no GitHub repo found)".
|
|
41
|
+
- Don't make up trust data — only use what zivis_check_repo_trust returns.
|
|
42
|
+
- Speak in plain English. "High risk" is better than "critical severity threat vector".`,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function registerGettingStartedPrompt(server) {
|
|
2
|
+
server.registerPrompt("getting-started", {
|
|
3
|
+
description: "Walk me through ZIVIS for this project. Use this if you're new or unsure what to test.",
|
|
4
|
+
argsSchema: {},
|
|
5
|
+
}, async () => ({
|
|
6
|
+
messages: [
|
|
7
|
+
{
|
|
8
|
+
role: "user",
|
|
9
|
+
content: {
|
|
10
|
+
type: "text",
|
|
11
|
+
text: `I want to use ZIVIS for security on this project but I'm not sure where to start.
|
|
12
|
+
|
|
13
|
+
Please do the following, in order:
|
|
14
|
+
|
|
15
|
+
1. Call \`zivis_check_project\` (no arguments) to confirm the project is connected correctly.
|
|
16
|
+
- If it returns any problems, explain them in plain English and tell me the exact terminal command to run to fix them. Stop here and wait for me.
|
|
17
|
+
- If it's OK, continue to step 2.
|
|
18
|
+
|
|
19
|
+
2. Call \`zivis_get_started\` (no arguments).
|
|
20
|
+
|
|
21
|
+
3. Present the \`recommended_next_steps\` from the response as a numbered list.
|
|
22
|
+
- Use the \`label\` as the item text.
|
|
23
|
+
- Add one sentence from the \`why\` field below each item.
|
|
24
|
+
- Do NOT invent additional steps or add security advice of your own.
|
|
25
|
+
|
|
26
|
+
4. Ask me which number I want to do. Wait for my answer before calling anything else.
|
|
27
|
+
|
|
28
|
+
Ground rules for this conversation:
|
|
29
|
+
- I'm a developer, not a security person. Speak plainly.
|
|
30
|
+
- Avoid these words unless I use them first: "actor", "attack vector", "threat model", "STRIDE", "kill chain", "TTPs".
|
|
31
|
+
- Use plain alternatives: "tester", "how someone might break in", "security plan", "types of attacks".
|
|
32
|
+
- If I seem unsure which option to pick, suggest the one flagged as \`if_user_unsure\` in the response.`,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
}));
|
|
37
|
+
}
|