@zivis/mcp 0.1.8 → 0.1.11
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/http-probe/capture.d.ts +51 -0
- package/dist/http-probe/capture.js +96 -0
- package/dist/http-probe/compare.d.ts +43 -0
- package/dist/http-probe/compare.js +117 -0
- package/dist/http-probe/index.d.ts +2 -0
- package/dist/http-probe/index.js +2 -0
- 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/redact.d.ts +30 -0
- package/dist/redact.js +164 -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/scanners/index.d.ts +3 -0
- package/dist/scanners/index.js +2 -0
- package/dist/scanners/normalize.d.ts +6 -0
- package/dist/scanners/normalize.js +181 -0
- package/dist/scanners/run.d.ts +27 -0
- package/dist/scanners/run.js +142 -0
- package/dist/scanners/types.d.ts +40 -0
- package/dist/scanners/types.js +1 -0
- 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 +41 -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,68 @@
|
|
|
1
|
+
# Control: fact_validator_present
|
|
2
|
+
# Referenced by:
|
|
3
|
+
# - retrieval.context-injection-no-validator (META: none_of_controls)
|
|
4
|
+
#
|
|
5
|
+
# A validator that inspects retrieved or LLM-generated content for
|
|
6
|
+
# prompt-injection patterns, factual inconsistency, or policy violations
|
|
7
|
+
# before the content reaches the model (or the user). Presence of any of
|
|
8
|
+
# the well-known guardrails libraries OR a custom validator with a
|
|
9
|
+
# recognizable name counts.
|
|
10
|
+
|
|
11
|
+
id: fact_validator_present
|
|
12
|
+
description: >
|
|
13
|
+
A validator step that inspects content for injection / hallucination /
|
|
14
|
+
policy violations between the data source (retriever, tool, user input)
|
|
15
|
+
and the model — or between the model and the user. Either a recognizable
|
|
16
|
+
third-party guardrails library or a custom validator with a clear name.
|
|
17
|
+
|
|
18
|
+
applicable_languages:
|
|
19
|
+
- typescript
|
|
20
|
+
- javascript
|
|
21
|
+
- python
|
|
22
|
+
|
|
23
|
+
detection:
|
|
24
|
+
- language: typescript
|
|
25
|
+
rule:
|
|
26
|
+
any:
|
|
27
|
+
# Third-party guardrails libraries (presence of the import or call)
|
|
28
|
+
- pattern: from "guardrails"
|
|
29
|
+
- pattern: from "@guardrails-ai/core"
|
|
30
|
+
- pattern: from "nemoguardrails"
|
|
31
|
+
- pattern: from "@nvidia/nemo-guardrails"
|
|
32
|
+
- pattern: from "lakera-guard"
|
|
33
|
+
- pattern: from "@lakera/guard"
|
|
34
|
+
- pattern: from "llm-guard"
|
|
35
|
+
- pattern: from "@protectai/llm-guard"
|
|
36
|
+
- pattern: from "presidio-analyzer"
|
|
37
|
+
# Conventional function names — broad on purpose so customer
|
|
38
|
+
# codebases register when they roll their own
|
|
39
|
+
- pattern: validateRetrievedContent($$$)
|
|
40
|
+
- pattern: validateContent($$$)
|
|
41
|
+
- pattern: factCheck($$$)
|
|
42
|
+
- pattern: checkForInjection($$$)
|
|
43
|
+
- pattern: sanitizeRetrieved($$$)
|
|
44
|
+
- pattern: detectPromptInjection($$$)
|
|
45
|
+
- pattern: $_.validate($DOCS)
|
|
46
|
+
- pattern: $_.guard($$$)
|
|
47
|
+
- language: python
|
|
48
|
+
rule:
|
|
49
|
+
any:
|
|
50
|
+
- pattern: import guardrails
|
|
51
|
+
- pattern: from guardrails import $$$
|
|
52
|
+
- pattern: import nemoguardrails
|
|
53
|
+
- pattern: from nemoguardrails import $$$
|
|
54
|
+
- pattern: import lakera_guard
|
|
55
|
+
- pattern: from lakera_guard import $$$
|
|
56
|
+
- pattern: import llm_guard
|
|
57
|
+
- pattern: from llm_guard import $$$
|
|
58
|
+
- pattern: from presidio_analyzer import $$$
|
|
59
|
+
# Conventional function names
|
|
60
|
+
- pattern: validate_retrieved_content($$$)
|
|
61
|
+
- pattern: validate_content($$$)
|
|
62
|
+
- pattern: fact_check($$$)
|
|
63
|
+
- pattern: check_for_injection($$$)
|
|
64
|
+
- pattern: sanitize_retrieved($$$)
|
|
65
|
+
- pattern: detect_prompt_injection($$$)
|
|
66
|
+
|
|
67
|
+
owner: platform-threat-modeling
|
|
68
|
+
lifecycle: draft
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Control: human_approval_gate
|
|
2
|
+
# Referenced by:
|
|
3
|
+
# - prompting.self-consistency-no-isolation (META: none_of_controls)
|
|
4
|
+
# - agents.privilege-separation (potential — high-impact tool dispatch)
|
|
5
|
+
#
|
|
6
|
+
# Defines what "the codebase has a human-in-the-loop approval before
|
|
7
|
+
# committing a high-impact action" looks like. Detection is intentionally
|
|
8
|
+
# fuzzy — we'd rather over-detect approval gates (and miss firing META)
|
|
9
|
+
# than under-detect (and fire false-positive findings).
|
|
10
|
+
|
|
11
|
+
id: human_approval_gate
|
|
12
|
+
description: >
|
|
13
|
+
Detects code that pauses execution to wait for human approval before
|
|
14
|
+
committing a high-impact action. Common shapes: humanInTheLoop helpers,
|
|
15
|
+
LangGraph interrupts, await-on-approval queue reads, request-confirmation
|
|
16
|
+
prompts.
|
|
17
|
+
|
|
18
|
+
applicable_languages:
|
|
19
|
+
- typescript
|
|
20
|
+
- javascript
|
|
21
|
+
- python
|
|
22
|
+
|
|
23
|
+
detection:
|
|
24
|
+
- language: typescript
|
|
25
|
+
rule:
|
|
26
|
+
any:
|
|
27
|
+
- pattern: humanInTheLoop($$$)
|
|
28
|
+
- pattern: humanApproval($$$)
|
|
29
|
+
- pattern: requireApproval($$$)
|
|
30
|
+
- pattern: await $_.waitForApproval($$$)
|
|
31
|
+
- pattern: await $_.awaitApproval($$$)
|
|
32
|
+
- pattern: $_.interrupt($$$)
|
|
33
|
+
- language: python
|
|
34
|
+
rule:
|
|
35
|
+
any:
|
|
36
|
+
- pattern: human_in_the_loop($$$)
|
|
37
|
+
- pattern: human_approval($$$)
|
|
38
|
+
- pattern: require_approval($$$)
|
|
39
|
+
- pattern: wait_for_user($$$)
|
|
40
|
+
- pattern: await_approval($$$)
|
|
41
|
+
- pattern: $_.interrupt($$$)
|
|
42
|
+
|
|
43
|
+
owner: platform-threat-modeling
|
|
44
|
+
lifecycle: draft
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Control: langgraph_state_machine_with_per_node_tools
|
|
2
|
+
# Referenced by:
|
|
3
|
+
# - agents.privilege-separation (META: none_of_controls)
|
|
4
|
+
#
|
|
5
|
+
# LangGraph's idiom for privilege separation: a StateGraph with multiple
|
|
6
|
+
# nodes, each binding a different (smaller) tool set. When present, the
|
|
7
|
+
# capsule's anti-pattern (one shared tool list) is mitigated.
|
|
8
|
+
|
|
9
|
+
id: langgraph_state_machine_with_per_node_tools
|
|
10
|
+
description: >
|
|
11
|
+
LangGraph StateGraph with multiple add_node calls — each node typically
|
|
12
|
+
binds its own tools. Even imperfect detection of LangGraph node-graph
|
|
13
|
+
construction is enough to suppress the capsule's META rule, since the
|
|
14
|
+
customer is clearly using the right idiom.
|
|
15
|
+
|
|
16
|
+
applicable_languages:
|
|
17
|
+
- typescript
|
|
18
|
+
- javascript
|
|
19
|
+
- python
|
|
20
|
+
|
|
21
|
+
detection:
|
|
22
|
+
- language: python
|
|
23
|
+
rule:
|
|
24
|
+
any:
|
|
25
|
+
- pattern: $_.add_node($$$)
|
|
26
|
+
- pattern: StateGraph($$$)
|
|
27
|
+
- pattern: builder.add_node($$$)
|
|
28
|
+
- language: typescript
|
|
29
|
+
rule:
|
|
30
|
+
any:
|
|
31
|
+
- pattern: $_.addNode($$$)
|
|
32
|
+
- pattern: new StateGraph($$$)
|
|
33
|
+
|
|
34
|
+
owner: platform-threat-modeling
|
|
35
|
+
lifecycle: draft
|
package/dist/pattern-packs/zivis-public-0.2.0/controls/per_sample_retrieval_diversification.yaml
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Control: per_sample_retrieval_diversification
|
|
2
|
+
# Referenced by:
|
|
3
|
+
# - prompting.self-consistency-no-isolation (META: none_of_controls)
|
|
4
|
+
#
|
|
5
|
+
# Different samples in a self-consistency loop pull from different
|
|
6
|
+
# retrieval queries / different stores / different rerank seeds, instead
|
|
7
|
+
# of all sharing the same RAG context.
|
|
8
|
+
|
|
9
|
+
id: per_sample_retrieval_diversification
|
|
10
|
+
description: >
|
|
11
|
+
When a self-consistency aggregator pulls retrieval per-sample from
|
|
12
|
+
varied queries (i.e. retrieval is INSIDE the per-sample lambda, not
|
|
13
|
+
hoisted above the loop). The shape is a .map over generation function
|
|
14
|
+
that itself contains a similaritySearch / vectorStore call.
|
|
15
|
+
|
|
16
|
+
applicable_languages:
|
|
17
|
+
- typescript
|
|
18
|
+
- javascript
|
|
19
|
+
- python
|
|
20
|
+
|
|
21
|
+
detection:
|
|
22
|
+
- language: typescript
|
|
23
|
+
rule:
|
|
24
|
+
pattern: $_.similaritySearch($$$)
|
|
25
|
+
inside:
|
|
26
|
+
stopBy: end
|
|
27
|
+
any:
|
|
28
|
+
- pattern: $_.map($$$)
|
|
29
|
+
- kind: for_statement
|
|
30
|
+
- language: python
|
|
31
|
+
rule:
|
|
32
|
+
pattern: $_.similarity_search($$$)
|
|
33
|
+
inside:
|
|
34
|
+
stopBy: end
|
|
35
|
+
kind: for_statement
|
|
36
|
+
|
|
37
|
+
owner: platform-threat-modeling
|
|
38
|
+
lifecycle: draft
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Control: prisma_extension_or_middleware_attaching_org_filter
|
|
2
|
+
# Referenced by:
|
|
3
|
+
# - security.late-org-filter (META: none_of_controls)
|
|
4
|
+
#
|
|
5
|
+
# A Prisma extension (or legacy $use middleware) that automatically appends
|
|
6
|
+
# a where-clause scoping every query by org/tenant. When present, the
|
|
7
|
+
# late-filter pattern is defense in depth, not the primary control.
|
|
8
|
+
|
|
9
|
+
id: prisma_extension_or_middleware_attaching_org_filter
|
|
10
|
+
description: >
|
|
11
|
+
Prisma client extension (post-5.x) or legacy $use middleware that injects
|
|
12
|
+
org/tenant scoping into every query. Detected by the call shape that
|
|
13
|
+
registers the extension/middleware referencing org_id, orgId, or tenant_id.
|
|
14
|
+
|
|
15
|
+
applicable_languages:
|
|
16
|
+
- typescript
|
|
17
|
+
- javascript
|
|
18
|
+
|
|
19
|
+
detection:
|
|
20
|
+
- language: typescript
|
|
21
|
+
rule:
|
|
22
|
+
any:
|
|
23
|
+
# Modern Prisma client extension intercepting query operations
|
|
24
|
+
- pattern: "$_.$$extends({ query: $$$ })"
|
|
25
|
+
- pattern: "prisma.$$extends($$$)"
|
|
26
|
+
# Legacy Prisma middleware
|
|
27
|
+
- pattern: "$_.$$use($$$)"
|
|
28
|
+
- pattern: "prisma.$$use($$$)"
|
|
29
|
+
|
|
30
|
+
owner: platform-threat-modeling
|
|
31
|
+
lifecycle: draft
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Control: row_level_security_policy
|
|
2
|
+
# Referenced by:
|
|
3
|
+
# - security.late-org-filter (META: none_of_controls)
|
|
4
|
+
#
|
|
5
|
+
# Detection of Postgres RLS policies in the codebase — either authored as
|
|
6
|
+
# SQL migration text inside a string literal, or invoked via session GUC
|
|
7
|
+
# setters that scope the connection by tenant.
|
|
8
|
+
|
|
9
|
+
id: row_level_security_policy
|
|
10
|
+
description: >
|
|
11
|
+
Postgres row-level security policy authored in the codebase, or session
|
|
12
|
+
GUCs that scope a connection by tenant for the duration of a request.
|
|
13
|
+
|
|
14
|
+
applicable_languages:
|
|
15
|
+
- typescript
|
|
16
|
+
- javascript
|
|
17
|
+
- python
|
|
18
|
+
|
|
19
|
+
detection:
|
|
20
|
+
- language: typescript
|
|
21
|
+
rule:
|
|
22
|
+
any:
|
|
23
|
+
# SET LOCAL app.org_id pattern (per-request connection scoping)
|
|
24
|
+
- pattern: $_.$$queryRaw`SET LOCAL $$$`
|
|
25
|
+
- pattern: $_.$$executeRaw`SET LOCAL $$$`
|
|
26
|
+
# Common helpers
|
|
27
|
+
- pattern: setRlsContext($$$)
|
|
28
|
+
- pattern: setOrgContext($$$)
|
|
29
|
+
- language: python
|
|
30
|
+
rule:
|
|
31
|
+
any:
|
|
32
|
+
- pattern: $_.execute("SET LOCAL $$$")
|
|
33
|
+
- pattern: set_rls_context($$$)
|
|
34
|
+
- pattern: set_org_context($$$)
|
|
35
|
+
|
|
36
|
+
owner: platform-threat-modeling
|
|
37
|
+
lifecycle: draft
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Control: source_attribution_present
|
|
2
|
+
# Referenced by:
|
|
3
|
+
# - retrieval.context-injection-no-validator (META: none_of_controls)
|
|
4
|
+
#
|
|
5
|
+
# A pattern where retrieved documents carry source-identifier metadata
|
|
6
|
+
# the model is required to surface (citations) and / or the calling code
|
|
7
|
+
# uses to apply access control after retrieval. Either flavor counts —
|
|
8
|
+
# the point is that the corpus is not treated as an undifferentiated
|
|
9
|
+
# trusted blob.
|
|
10
|
+
|
|
11
|
+
id: source_attribution_present
|
|
12
|
+
description: >
|
|
13
|
+
Retrieved documents carry source-identifier metadata that flows into
|
|
14
|
+
the prompt as required citations, OR into a post-retrieval access /
|
|
15
|
+
trust filter. Presence of either flavor is treated as evidence that
|
|
16
|
+
the corpus is not being treated as an undifferentiated trusted blob.
|
|
17
|
+
|
|
18
|
+
applicable_languages:
|
|
19
|
+
- typescript
|
|
20
|
+
- javascript
|
|
21
|
+
- python
|
|
22
|
+
|
|
23
|
+
detection:
|
|
24
|
+
- language: typescript
|
|
25
|
+
rule:
|
|
26
|
+
any:
|
|
27
|
+
# Citation-style: doc IDs / sources embedded in prompt template
|
|
28
|
+
- pattern: $_.sourceId
|
|
29
|
+
- pattern: $_.source_id
|
|
30
|
+
- pattern: $_.citation
|
|
31
|
+
- pattern: $_.sourceUrl
|
|
32
|
+
- pattern: $_.documentId
|
|
33
|
+
# Post-retrieval access filter
|
|
34
|
+
- pattern: filterByAccess($$$)
|
|
35
|
+
- pattern: filterBySourceAccess($$$)
|
|
36
|
+
- pattern: filterRetrievedByPermission($$$)
|
|
37
|
+
- pattern: checkDocumentAccess($$$)
|
|
38
|
+
- pattern: assertSourceAllowed($$$)
|
|
39
|
+
# LangChain-style citation chains
|
|
40
|
+
- pattern: createCitationsChain($$$)
|
|
41
|
+
- pattern: new SourceAttributedRetrievalChain($$$)
|
|
42
|
+
- language: python
|
|
43
|
+
rule:
|
|
44
|
+
any:
|
|
45
|
+
- pattern: $_.source_id
|
|
46
|
+
- pattern: $_.citation
|
|
47
|
+
- pattern: $_.source_url
|
|
48
|
+
- pattern: $_.document_id
|
|
49
|
+
- pattern: filter_by_access($$$)
|
|
50
|
+
- pattern: filter_by_source_access($$$)
|
|
51
|
+
- pattern: filter_retrieved_by_permission($$$)
|
|
52
|
+
- pattern: check_document_access($$$)
|
|
53
|
+
- pattern: assert_source_allowed($$$)
|
|
54
|
+
# LangChain
|
|
55
|
+
- pattern: create_citations_chain($$$)
|
|
56
|
+
|
|
57
|
+
owner: platform-threat-modeling
|
|
58
|
+
lifecycle: draft
|
|
@@ -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-31T22:32:10.810Z",
|
|
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.
|