bezoar 1.0.0a2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (530) hide show
  1. bezoar-1.0.0a2/.gitignore +31 -0
  2. bezoar-1.0.0a2/CHANGELOG.md +141 -0
  3. bezoar-1.0.0a2/LICENSE +202 -0
  4. bezoar-1.0.0a2/NOTICE +9 -0
  5. bezoar-1.0.0a2/PKG-INFO +201 -0
  6. bezoar-1.0.0a2/README.md +176 -0
  7. bezoar-1.0.0a2/pyproject.toml +89 -0
  8. bezoar-1.0.0a2/schemas/policy.v1.schema.json +233 -0
  9. bezoar-1.0.0a2/schemas/rulepack.v1.schema.json +129 -0
  10. bezoar-1.0.0a2/schemas/scan-result.v1.schema.json +412 -0
  11. bezoar-1.0.0a2/src/bezoar/__init__.py +24 -0
  12. bezoar-1.0.0a2/src/bezoar/__main__.py +7 -0
  13. bezoar-1.0.0a2/src/bezoar/adapters/__init__.py +15 -0
  14. bezoar-1.0.0a2/src/bezoar/adapters/base.py +505 -0
  15. bezoar-1.0.0a2/src/bezoar/adapters/claude_code.py +365 -0
  16. bezoar-1.0.0a2/src/bezoar/adapters/codex.py +824 -0
  17. bezoar-1.0.0a2/src/bezoar/adapters/copilot.py +552 -0
  18. bezoar-1.0.0a2/src/bezoar/adapters/cursor.py +291 -0
  19. bezoar-1.0.0a2/src/bezoar/adapters/gemini_cli.py +710 -0
  20. bezoar-1.0.0a2/src/bezoar/adapters/generic.py +1732 -0
  21. bezoar-1.0.0a2/src/bezoar/cache.py +568 -0
  22. bezoar-1.0.0a2/src/bezoar/cli.py +492 -0
  23. bezoar-1.0.0a2/src/bezoar/data/NOTICE +39 -0
  24. bezoar-1.0.0a2/src/bezoar/data/harness/claude_code.yml +120 -0
  25. bezoar-1.0.0a2/src/bezoar/data/harness/codex.yml +78 -0
  26. bezoar-1.0.0a2/src/bezoar/data/harness/common.yml +53 -0
  27. bezoar-1.0.0a2/src/bezoar/data/harness/copilot.yml +41 -0
  28. bezoar-1.0.0a2/src/bezoar/data/harness/cursor.yml +65 -0
  29. bezoar-1.0.0a2/src/bezoar/data/harness/gemini_cli.yml +66 -0
  30. bezoar-1.0.0a2/src/bezoar/data/harness/grok.yml +77 -0
  31. bezoar-1.0.0a2/src/bezoar/data/policy/default.yml +66 -0
  32. bezoar-1.0.0a2/src/bezoar/data/rules/MANIFEST.json +573 -0
  33. bezoar-1.0.0a2/src/bezoar/data/rules/exfil_sinks.yml +103 -0
  34. bezoar-1.0.0a2/src/bezoar/data/rules/external_instructions.yml +79 -0
  35. bezoar-1.0.0a2/src/bezoar/data/rules/prompt_injection.yml +328 -0
  36. bezoar-1.0.0a2/src/bezoar/data/rules/secrets.yml +690 -0
  37. bezoar-1.0.0a2/src/bezoar/detectors/__init__.py +19 -0
  38. bezoar-1.0.0a2/src/bezoar/detectors/data_exfiltration.py +198 -0
  39. bezoar-1.0.0a2/src/bezoar/detectors/external_instructions.py +156 -0
  40. bezoar-1.0.0a2/src/bezoar/detectors/harness_forgery/__init__.py +12 -0
  41. bezoar-1.0.0a2/src/bezoar/detectors/harness_forgery/context.py +251 -0
  42. bezoar-1.0.0a2/src/bezoar/detectors/harness_forgery/detector.py +579 -0
  43. bezoar-1.0.0a2/src/bezoar/detectors/harness_forgery/tags.py +537 -0
  44. bezoar-1.0.0a2/src/bezoar/detectors/harness_forgery/vocab.py +344 -0
  45. bezoar-1.0.0a2/src/bezoar/detectors/hidden_behavior.py +358 -0
  46. bezoar-1.0.0a2/src/bezoar/detectors/permissions.py +556 -0
  47. bezoar-1.0.0a2/src/bezoar/detectors/prompt_injection.py +6 -0
  48. bezoar-1.0.0a2/src/bezoar/detectors/secrets.py +6 -0
  49. bezoar-1.0.0a2/src/bezoar/detectors/supply_chain.py +722 -0
  50. bezoar-1.0.0a2/src/bezoar/engine/__init__.py +61 -0
  51. bezoar-1.0.0a2/src/bezoar/engine/dedupe.py +147 -0
  52. bezoar-1.0.0a2/src/bezoar/engine/edges.py +195 -0
  53. bezoar-1.0.0a2/src/bezoar/engine/pipeline.py +828 -0
  54. bezoar-1.0.0a2/src/bezoar/engine/session.py +409 -0
  55. bezoar-1.0.0a2/src/bezoar/engine/verdict.py +359 -0
  56. bezoar-1.0.0a2/src/bezoar/errors.py +105 -0
  57. bezoar-1.0.0a2/src/bezoar/incremental.py +184 -0
  58. bezoar-1.0.0a2/src/bezoar/judge/__init__.py +48 -0
  59. bezoar-1.0.0a2/src/bezoar/judge/advisory.py +417 -0
  60. bezoar-1.0.0a2/src/bezoar/judge/prompts/__init__.py +45 -0
  61. bezoar-1.0.0a2/src/bezoar/judge/prompts/v1.py +35 -0
  62. bezoar-1.0.0a2/src/bezoar/judge/protocol.py +333 -0
  63. bezoar-1.0.0a2/src/bezoar/judge/redact.py +125 -0
  64. bezoar-1.0.0a2/src/bezoar/mcp/__init__.py +27 -0
  65. bezoar-1.0.0a2/src/bezoar/mcp/probe.py +1032 -0
  66. bezoar-1.0.0a2/src/bezoar/mcp/tool_poisoning.py +578 -0
  67. bezoar-1.0.0a2/src/bezoar/models.py +674 -0
  68. bezoar-1.0.0a2/src/bezoar/normalize.py +520 -0
  69. bezoar-1.0.0a2/src/bezoar/parallel.py +231 -0
  70. bezoar-1.0.0a2/src/bezoar/parsing/__init__.py +36 -0
  71. bezoar-1.0.0a2/src/bezoar/parsing/commands.py +124 -0
  72. bezoar-1.0.0a2/src/bezoar/parsing/frontmatter.py +173 -0
  73. bezoar-1.0.0a2/src/bezoar/parsing/hooks.py +32 -0
  74. bezoar-1.0.0a2/src/bezoar/parsing/loaders.py +142 -0
  75. bezoar-1.0.0a2/src/bezoar/parsing/mcp_config.py +265 -0
  76. bezoar-1.0.0a2/src/bezoar/parsing/text.py +292 -0
  77. bezoar-1.0.0a2/src/bezoar/policy/__init__.py +38 -0
  78. bezoar-1.0.0a2/src/bezoar/policy/apply.py +583 -0
  79. bezoar-1.0.0a2/src/bezoar/policy/discovery.py +189 -0
  80. bezoar-1.0.0a2/src/bezoar/policy/schema.py +789 -0
  81. bezoar-1.0.0a2/src/bezoar/redact.py +319 -0
  82. bezoar-1.0.0a2/src/bezoar/registry.py +434 -0
  83. bezoar-1.0.0a2/src/bezoar/reporters/__init__.py +15 -0
  84. bezoar-1.0.0a2/src/bezoar/reporting/__init__.py +51 -0
  85. bezoar-1.0.0a2/src/bezoar/reporting/baseline.py +267 -0
  86. bezoar-1.0.0a2/src/bezoar/reporting/context.py +63 -0
  87. bezoar-1.0.0a2/src/bezoar/reporting/discover.py +79 -0
  88. bezoar-1.0.0a2/src/bezoar/reporting/exitcodes.py +49 -0
  89. bezoar-1.0.0a2/src/bezoar/reporting/json.py +37 -0
  90. bezoar-1.0.0a2/src/bezoar/reporting/paths.py +85 -0
  91. bezoar-1.0.0a2/src/bezoar/reporting/sarif.py +216 -0
  92. bezoar-1.0.0a2/src/bezoar/reporting/serialize.py +407 -0
  93. bezoar-1.0.0a2/src/bezoar/reporting/text.py +100 -0
  94. bezoar-1.0.0a2/src/bezoar/rules/__init__.py +21 -0
  95. bezoar-1.0.0a2/src/bezoar/rules/compile.py +992 -0
  96. bezoar-1.0.0a2/src/bezoar/rules/detector.py +350 -0
  97. bezoar-1.0.0a2/src/bezoar/rules/lint.py +186 -0
  98. bezoar-1.0.0a2/src/bezoar/rules/loader.py +213 -0
  99. bezoar-1.0.0a2/src/bezoar/rules/schema.py +476 -0
  100. bezoar-1.0.0a2/src/bezoar/serve/__init__.py +6 -0
  101. bezoar-1.0.0a2/src/bezoar/serve/__main__.py +9 -0
  102. bezoar-1.0.0a2/src/bezoar/serve/config.py +133 -0
  103. bezoar-1.0.0a2/src/bezoar/serve/core.py +869 -0
  104. bezoar-1.0.0a2/src/bezoar/serve/handler.py +698 -0
  105. bezoar-1.0.0a2/src/bezoar/serve/main.py +218 -0
  106. bezoar-1.0.0a2/src/bezoar/serve/problems.py +87 -0
  107. bezoar-1.0.0a2/src/bezoar/serve/scans.py +142 -0
  108. bezoar-1.0.0a2/src/bezoar/serve/security.py +306 -0
  109. bezoar-1.0.0a2/src/bezoar/serve/store.py +548 -0
  110. bezoar-1.0.0a2/tests/corpus/benign/copilot/mcp-vscode-pinned/.vscode/mcp.json +8 -0
  111. bezoar-1.0.0a2/tests/corpus/benign/cursor/command-test/.cursor/commands/test.md +3 -0
  112. bezoar-1.0.0a2/tests/corpus/benign/cursor/hooks-safe/.cursor/hooks.json +9 -0
  113. bezoar-1.0.0a2/tests/corpus/benign/cursor/mcp-pinned/.cursor/mcp.json +8 -0
  114. bezoar-1.0.0a2/tests/corpus/benign/cursor/rules-react/.cursor/rules/react.mdc +9 -0
  115. bezoar-1.0.0a2/tests/corpus/benign/cursor/rules-typescript/.cursor/rules/typescript.mdc +9 -0
  116. bezoar-1.0.0a2/tests/corpus/benign/cursor/security-scanner-skill/.cursor/skills/xml-audit/SKILL.md +15 -0
  117. bezoar-1.0.0a2/tests/corpus/benign/cursor/skill-docs-html-comments/.cursor/skills/doc-comments/SKILL.md +11 -0
  118. bezoar-1.0.0a2/tests/corpus/benign/cursor/skill-refactor/.cursor/skills/refactor/SKILL.md +7 -0
  119. bezoar-1.0.0a2/tests/corpus/malicious/copilot/sc-mcpjacking-http/.vscode/mcp.json +7 -0
  120. bezoar-1.0.0a2/tests/corpus/malicious/cursor/hf-encoded-hex/.cursor/skills/hex-notes/SKILL.md +9 -0
  121. bezoar-1.0.0a2/tests/corpus/malicious/cursor/hf-encoded-html-entities/.cursor/skills/entity-notes/SKILL.md +9 -0
  122. bezoar-1.0.0a2/tests/corpus/malicious/cursor/hf-model-layer/.cursor/skills/shell-wrap/SKILL.md +9 -0
  123. bezoar-1.0.0a2/tests/corpus/malicious/cursor/hf-steer-prefix/.cursor/skills/queue-helper/SKILL.md +8 -0
  124. bezoar-1.0.0a2/tests/corpus/malicious/cursor/hf-turn-marker/.cursor/rules/always.mdc +7 -0
  125. bezoar-1.0.0a2/tests/corpus/malicious/cursor/sc-mutable-git-ref/.cursor/skills/git-helpers/SKILL.md +7 -0
  126. bezoar-1.0.0a2/tests/corpus/malicious/cursor/sc-mutable-git-ref/.cursor/skills/git-helpers/package.json +6 -0
  127. bezoar-1.0.0a2/tests/corpus/malicious/cursor/sc-unpinned-uvx/.cursor/mcp.json +8 -0
  128. bezoar-1.0.0a2/tests/e2e/__init__.py +1 -0
  129. bezoar-1.0.0a2/tests/e2e/conftest.py +57 -0
  130. bezoar-1.0.0a2/tests/e2e/e2e_support.py +124 -0
  131. bezoar-1.0.0a2/tests/e2e/test_e2e_corpus.py +202 -0
  132. bezoar-1.0.0a2/tests/e2e/test_e2e_determinism.py +31 -0
  133. bezoar-1.0.0a2/tests/e2e/test_e2e_discover.py +44 -0
  134. bezoar-1.0.0a2/tests/e2e/test_e2e_exit_codes.py +127 -0
  135. bezoar-1.0.0a2/tests/e2e/test_e2e_incremental.py +126 -0
  136. bezoar-1.0.0a2/tests/e2e/test_e2e_sarif.py +43 -0
  137. bezoar-1.0.0a2/tests/e2e/test_e2e_text.py +57 -0
  138. bezoar-1.0.0a2/tests/fixtures/benign-skill/SKILL.md +18 -0
  139. bezoar-1.0.0a2/tests/fixtures/harness/manifest.json +534 -0
  140. bezoar-1.0.0a2/tests/fixtures/harness/negatives/a-colon-midline.md +3 -0
  141. bezoar-1.0.0a2/tests/fixtures/harness/negatives/antml-prose.md +3 -0
  142. bezoar-1.0.0a2/tests/fixtures/harness/negatives/base64-innocent.md +5 -0
  143. bezoar-1.0.0a2/tests/fixtures/harness/negatives/channel-prose.md +3 -0
  144. bezoar-1.0.0a2/tests/fixtures/harness/negatives/chatml-prose.md +3 -0
  145. bezoar-1.0.0a2/tests/fixtures/harness/negatives/copilot-usage-heading.md +9 -0
  146. bezoar-1.0.0a2/tests/fixtures/harness/negatives/directive-prose.md +3 -0
  147. bezoar-1.0.0a2/tests/fixtures/harness/negatives/environment-word.md +3 -0
  148. bezoar-1.0.0a2/tests/fixtures/harness/negatives/escaped-prose.md +3 -0
  149. bezoar-1.0.0a2/tests/fixtures/harness/negatives/fence-example-detect.md +9 -0
  150. bezoar-1.0.0a2/tests/fixtures/harness/negatives/fence-html-example.md +7 -0
  151. bezoar-1.0.0a2/tests/fixtures/harness/negatives/fork-prose.md +3 -0
  152. bezoar-1.0.0a2/tests/fixtures/harness/negatives/function-results-prose.md +3 -0
  153. bezoar-1.0.0a2/tests/fixtures/harness/negatives/human-assistant-prose.md +3 -0
  154. bezoar-1.0.0a2/tests/fixtures/harness/negatives/inst-prose.md +3 -0
  155. bezoar-1.0.0a2/tests/fixtures/harness/negatives/invoke-prose.md +3 -0
  156. bezoar-1.0.0a2/tests/fixtures/harness/negatives/json-config.md +4 -0
  157. bezoar-1.0.0a2/tests/fixtures/harness/negatives/looks-like-without-tag.md +8 -0
  158. bezoar-1.0.0a2/tests/fixtures/harness/negatives/markdown-user-midline.md +4 -0
  159. bezoar-1.0.0a2/tests/fixtures/harness/negatives/match-example-prose.md +3 -0
  160. bezoar-1.0.0a2/tests/fixtures/harness/negatives/mcp-prose.md +3 -0
  161. bezoar-1.0.0a2/tests/fixtures/harness/negatives/normal-skill-formatter.md +7 -0
  162. bezoar-1.0.0a2/tests/fixtures/harness/negatives/notice-word.md +3 -0
  163. bezoar-1.0.0a2/tests/fixtures/harness/negatives/output-word.md +3 -0
  164. bezoar-1.0.0a2/tests/fixtures/harness/negatives/permissions-docs.md +3 -0
  165. bezoar-1.0.0a2/tests/fixtures/harness/negatives/prose-system-reminder.md +4 -0
  166. bezoar-1.0.0a2/tests/fixtures/harness/negatives/python-print.md +5 -0
  167. bezoar-1.0.0a2/tests/fixtures/harness/negatives/regex-docs.md +3 -0
  168. bezoar-1.0.0a2/tests/fixtures/harness/negatives/rules-word.md +3 -0
  169. bezoar-1.0.0a2/tests/fixtures/harness/negatives/scheduled-prose.md +3 -0
  170. bezoar-1.0.0a2/tests/fixtures/harness/negatives/security-readme-prose.md +7 -0
  171. bezoar-1.0.0a2/tests/fixtures/harness/negatives/shell-snippet.md +5 -0
  172. bezoar-1.0.0a2/tests/fixtures/harness/negatives/skill-information-prose.md +3 -0
  173. bezoar-1.0.0a2/tests/fixtures/harness/negatives/source-word.md +3 -0
  174. bezoar-1.0.0a2/tests/fixtures/harness/negatives/table-not-turn.md +5 -0
  175. bezoar-1.0.0a2/tests/fixtures/harness/negatives/untrusted-word.md +3 -0
  176. bezoar-1.0.0a2/tests/fixtures/harness/negatives/user-query-prose.md +3 -0
  177. bezoar-1.0.0a2/tests/fixtures/harness/negatives/workspace-word.md +3 -0
  178. bezoar-1.0.0a2/tests/fixtures/harness/negatives/xml-div-span.md +4 -0
  179. bezoar-1.0.0a2/tests/fixtures/harness/negatives/yaml-frontmatter-only.md +7 -0
  180. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-bash-stdout-close.md +8 -0
  181. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-channel-open.md +9 -0
  182. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-confusable-fw.md +9 -0
  183. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-cross-gemini.md +8 -0
  184. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-encoded-b64.md +9 -0
  185. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-escalation.md +7 -0
  186. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-escaped-bs.md +7 -0
  187. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-escaped.md +7 -0
  188. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-hidden-comment.md +10 -0
  189. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-notice-system.md +8 -0
  190. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-pseudo-fnr.md +9 -0
  191. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-pseudo-meta.md +9 -0
  192. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-01.md +9 -0
  193. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-02.md +9 -0
  194. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-03.md +9 -0
  195. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-04.md +9 -0
  196. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-05.md +9 -0
  197. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-06.md +9 -0
  198. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-07.md +9 -0
  199. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-08.md +9 -0
  200. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-09.md +9 -0
  201. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-10.md +9 -0
  202. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-11.md +9 -0
  203. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-12.md +9 -0
  204. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-reminder-tpl-13.md +9 -0
  205. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-steer-directive.md +7 -0
  206. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-steer.md +7 -0
  207. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude-tool-ends.md +8 -0
  208. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude_code-context-close.md +8 -0
  209. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude_code-envelope-close.md +8 -0
  210. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude_code-fork-close.md +8 -0
  211. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude_code-mcp-close.md +8 -0
  212. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude_code-open-imperative.md +9 -0
  213. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude_code-reminder-close.md +8 -0
  214. bezoar-1.0.0a2/tests/fixtures/harness/positives/claude_code-tool_result-close.md +8 -0
  215. bezoar-1.0.0a2/tests/fixtures/harness/positives/codex-context-close.md +8 -0
  216. bezoar-1.0.0a2/tests/fixtures/harness/positives/codex-context-perm-close.md +8 -0
  217. bezoar-1.0.0a2/tests/fixtures/harness/positives/codex-context-skill-close.md +8 -0
  218. bezoar-1.0.0a2/tests/fixtures/harness/positives/codex-envelope-close.md +8 -0
  219. bezoar-1.0.0a2/tests/fixtures/harness/positives/codex-msg-type.md +9 -0
  220. bezoar-1.0.0a2/tests/fixtures/harness/positives/codex-open-imperative.md +9 -0
  221. bezoar-1.0.0a2/tests/fixtures/harness/positives/codex-prose.md +8 -0
  222. bezoar-1.0.0a2/tests/fixtures/harness/positives/common-context-close.md +8 -0
  223. bezoar-1.0.0a2/tests/fixtures/harness/positives/common-im-start.md +10 -0
  224. bezoar-1.0.0a2/tests/fixtures/harness/positives/common-inst.md +8 -0
  225. bezoar-1.0.0a2/tests/fixtures/harness/positives/common-tool_result-close.md +8 -0
  226. bezoar-1.0.0a2/tests/fixtures/harness/positives/copilot-context-close.md +8 -0
  227. bezoar-1.0.0a2/tests/fixtures/harness/positives/copilot-context-ins-close.md +8 -0
  228. bezoar-1.0.0a2/tests/fixtures/harness/positives/copilot-encoded-url.md +9 -0
  229. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-context-close.md +8 -0
  230. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-context-files-close.md +8 -0
  231. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-context-rules-close.md +8 -0
  232. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-encoded-hex.md +9 -0
  233. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-encoded-html.md +9 -0
  234. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-model-layer.md +9 -0
  235. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-open-imperative.md +9 -0
  236. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-reminder-close.md +8 -0
  237. bezoar-1.0.0a2/tests/fixtures/harness/positives/cursor-turn-pair.md +8 -0
  238. bezoar-1.0.0a2/tests/fixtures/harness/positives/gemini-notice-continue.md +8 -0
  239. bezoar-1.0.0a2/tests/fixtures/harness/positives/gemini_cli-context-close.md +8 -0
  240. bezoar-1.0.0a2/tests/fixtures/harness/positives/gemini_cli-context-proj-close.md +8 -0
  241. bezoar-1.0.0a2/tests/fixtures/harness/positives/gemini_cli-envelope-close.md +8 -0
  242. bezoar-1.0.0a2/tests/fixtures/harness/positives/gemini_cli-open-imperative.md +9 -0
  243. bezoar-1.0.0a2/tests/fixtures/harness/positives/grok-context-bg-close.md +8 -0
  244. bezoar-1.0.0a2/tests/fixtures/harness/positives/grok-context-close.md +8 -0
  245. bezoar-1.0.0a2/tests/fixtures/harness/positives/grok-context-tr-close.md +8 -0
  246. bezoar-1.0.0a2/tests/fixtures/harness/positives/grok-notice-agent.md +8 -0
  247. bezoar-1.0.0a2/tests/fixtures/harness/positives/grok-open-imperative.md +9 -0
  248. bezoar-1.0.0a2/tests/fixtures/malicious-skill/SKILL.md +28 -0
  249. bezoar-1.0.0a2/tests/unit/adapters_e1/conftest.py +59 -0
  250. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude/CLAUDE.md +1 -0
  251. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude/agents/user-agent.md +4 -0
  252. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude/commands/user-cmd.md +4 -0
  253. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude/plugins/acme/demo/.claude-plugin/plugin.json +4 -0
  254. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude/plugins/acme/demo/skills/plug/SKILL.md +4 -0
  255. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude/settings.json +5 -0
  256. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude/skills/user-skill/SKILL.md +4 -0
  257. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.claude.json +7 -0
  258. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.cursor/hooks.json +5 -0
  259. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.cursor/mcp.json +8 -0
  260. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.cursor/plugins/cache/acme/widget/deadbeef/mcp.json +8 -0
  261. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.cursor/plugins/cache/acme/widget/deadbeef/rules/cached.mdc +5 -0
  262. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.cursor/plugins/cache/acme/widget/deadbeef/skills/cached/SKILL.md +4 -0
  263. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.cursor/skills/user-cursor/SKILL.md +4 -0
  264. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/home/.cursor/skills-cursor/builtin/SKILL.md +4 -0
  265. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/malformed/.claude/skills/bad/SKILL.md +4 -0
  266. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/malformed/.claude-plugin/plugin.json +1 -0
  267. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/malformed/.cursor/rules/bad.mdc +4 -0
  268. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/malformed/new-schema/.claude-plugin/plugin.json +5 -0
  269. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/outside/SKILL.md +4 -0
  270. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/CLAUDE.md +1 -0
  271. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/agents/reviewer.md +6 -0
  272. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/commands/nested/deep.md +4 -0
  273. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/commands/review.md +6 -0
  274. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/settings.json +20 -0
  275. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/settings.local.json +5 -0
  276. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/skills/proj-skill/SKILL.md +6 -0
  277. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude/skills/proj-skill/scripts/install.sh +2 -0
  278. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude-plugin/marketplace.json +5 -0
  279. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.claude-plugin/plugin.json +5 -0
  280. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursor/agents/cursor-agent.md +5 -0
  281. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursor/commands/test.md +2 -0
  282. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursor/hooks.json +5 -0
  283. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursor/mcp.json +8 -0
  284. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursor/rules/always.mdc +8 -0
  285. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursor/settings.json +3 -0
  286. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursor/skills/cursor-skill/SKILL.md +6 -0
  287. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.cursorrules +1 -0
  288. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/.mcp.json +12 -0
  289. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/AGENTS.md +2 -0
  290. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/CLAUDE.local.md +2 -0
  291. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/CLAUDE.md +2 -0
  292. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/agentskills-layout/README.md +1 -0
  293. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/agentskills-layout/manifest.json +5 -0
  294. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/custom.mcp.json +8 -0
  295. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/extra.agent.md +5 -0
  296. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/local-mcp/server.py +2 -0
  297. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/managed-settings.json +5 -0
  298. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/nested/bundle/.claude-plugin/plugin.json +4 -0
  299. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/nested/bundle/skills/inner/SKILL.md +5 -0
  300. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/nested/bundle/skills/inner/scripts/run.sh +2 -0
  301. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/node_modules/fake/SKILL.md +4 -0
  302. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/orphan-skill/skill.json +4 -0
  303. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/skills/bundled/SKILL.md +5 -0
  304. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/standalone-skill/SKILL.md +6 -0
  305. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/standalone-skill/scripts/setup.sh +4 -0
  306. bezoar-1.0.0a2/tests/unit/adapters_e1/fixtures/project/vendor/plugin.json +5 -0
  307. bezoar-1.0.0a2/tests/unit/adapters_e1/goldens/claude_code.discover.json +385 -0
  308. bezoar-1.0.0a2/tests/unit/adapters_e1/goldens/cursor.discover.json +204 -0
  309. bezoar-1.0.0a2/tests/unit/adapters_e1/goldens/generic.discover.json +197 -0
  310. bezoar-1.0.0a2/tests/unit/adapters_e1/test_e1_corpus.py +55 -0
  311. bezoar-1.0.0a2/tests/unit/adapters_e1/test_e1_discover.py +216 -0
  312. bezoar-1.0.0a2/tests/unit/adapters_e1/test_e1_edges.py +49 -0
  313. bezoar-1.0.0a2/tests/unit/adapters_e1/test_e1_malformed.py +54 -0
  314. bezoar-1.0.0a2/tests/unit/adapters_e1/test_goldens.py +59 -0
  315. bezoar-1.0.0a2/tests/unit/adapters_e1/test_load.py +173 -0
  316. bezoar-1.0.0a2/tests/unit/adapters_e1/test_safety.py +37 -0
  317. bezoar-1.0.0a2/tests/unit/adapters_e2/conftest.py +18 -0
  318. bezoar-1.0.0a2/tests/unit/adapters_e2/e2_helpers.py +287 -0
  319. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/malformed/.codex/config.toml +1 -0
  320. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/new_schema/.codex/config.toml +2 -0
  321. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/.codex/config.toml +16 -0
  322. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/.codex/skills/demo/SKILL.md +6 -0
  323. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/AGENTS.md +5 -0
  324. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/AGENTS.override.md +2 -0
  325. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/extra-skills/bundled/SKILL.md +4 -0
  326. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/extra.md +1 -0
  327. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/nested/app/.codex/skills/inner/SKILL.md +4 -0
  328. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/project/scripts/mcp-server.py +1 -0
  329. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/user/AGENTS.md +1 -0
  330. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/user/config.toml +6 -0
  331. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/user/plugins/pack/plugin.json +1 -0
  332. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/user/plugins/pack/skills/bundled/SKILL.md +4 -0
  333. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/user/prompts/review.md +4 -0
  334. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/codex/user/skills/user-skill/SKILL.md +4 -0
  335. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/malformed/.vscode/mcp.json +1 -0
  336. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.copilot/skills/c/SKILL.md +4 -0
  337. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.github/agents/reviewer.agent.md +5 -0
  338. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.github/copilot/agents/extra.md +4 -0
  339. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.github/copilot/mcp.json +1 -0
  340. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.github/copilot-instructions.md +1 -0
  341. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.github/instructions/testing.instructions.md +4 -0
  342. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.github/prompts/sum.prompt.md +4 -0
  343. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.github/skills/s/SKILL.md +4 -0
  344. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.mcp.json +1 -0
  345. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.vscode/mcp.json +10 -0
  346. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/.vscode/settings.json +1 -0
  347. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/AGENTS.md +1 -0
  348. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/project/nested/.mcp.json +1 -0
  349. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/user/config.json +1 -0
  350. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/copilot/user/mcp-config.json +1 -0
  351. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/escape/.gemini/extensions/evil/gemini-extension.json +1 -0
  352. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/malformed/.gemini/settings.json +1 -0
  353. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/new_schema/.gemini/extensions/x/gemini-extension.json +1 -0
  354. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/commands/nested/foo.toml +2 -0
  355. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/commands/review.toml +3 -0
  356. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/extensions/docs/agents/writer.md +5 -0
  357. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/extensions/docs/bin/server +2 -0
  358. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/extensions/docs/commands/sum.toml +2 -0
  359. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/extensions/docs/gemini-extension.json +14 -0
  360. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/extensions/docs/skills/outline/SKILL.md +4 -0
  361. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/settings.json +14 -0
  362. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/.gemini/skills/s/SKILL.md +5 -0
  363. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/CONTEXT.md +1 -0
  364. bezoar-1.0.0a2/tests/unit/adapters_e2/fixtures/gemini_cli/project/GEMINI.md +1 -0
  365. bezoar-1.0.0a2/tests/unit/adapters_e2/goldens/codex.discover.json +124 -0
  366. bezoar-1.0.0a2/tests/unit/adapters_e2/goldens/copilot.discover.json +194 -0
  367. bezoar-1.0.0a2/tests/unit/adapters_e2/goldens/gemini_cli.discover.json +162 -0
  368. bezoar-1.0.0a2/tests/unit/adapters_e2/test_codex.py +133 -0
  369. bezoar-1.0.0a2/tests/unit/adapters_e2/test_common.py +127 -0
  370. bezoar-1.0.0a2/tests/unit/adapters_e2/test_copilot.py +118 -0
  371. bezoar-1.0.0a2/tests/unit/adapters_e2/test_gemini_cli.py +132 -0
  372. bezoar-1.0.0a2/tests/unit/adapters_e2/test_golden.py +33 -0
  373. bezoar-1.0.0a2/tests/unit/cli/conftest.py +34 -0
  374. bezoar-1.0.0a2/tests/unit/cli/test_baseline_path.py +146 -0
  375. bezoar-1.0.0a2/tests/unit/cli/test_cli_discover.py +66 -0
  376. bezoar-1.0.0a2/tests/unit/cli/test_cli_streams.py +82 -0
  377. bezoar-1.0.0a2/tests/unit/cli/test_exit_codes.py +74 -0
  378. bezoar-1.0.0a2/tests/unit/cli/test_flags.py +247 -0
  379. bezoar-1.0.0a2/tests/unit/cli/test_policy_rules_cache.py +148 -0
  380. bezoar-1.0.0a2/tests/unit/cli/test_scan.py +61 -0
  381. bezoar-1.0.0a2/tests/unit/core/fixtures/mcp/claude.mcp.json +18 -0
  382. bezoar-1.0.0a2/tests/unit/core/fixtures/mcp/codex.config.toml +9 -0
  383. bezoar-1.0.0a2/tests/unit/core/fixtures/mcp/cursor.mcp.json +8 -0
  384. bezoar-1.0.0a2/tests/unit/core/fixtures/mcp/gemini.settings.json +8 -0
  385. bezoar-1.0.0a2/tests/unit/core/fixtures/mcp/vscode.mcp.json +19 -0
  386. bezoar-1.0.0a2/tests/unit/core/test_adapter_truncation.py +202 -0
  387. bezoar-1.0.0a2/tests/unit/core/test_adapters_base.py +98 -0
  388. bezoar-1.0.0a2/tests/unit/core/test_cache_key.py +184 -0
  389. bezoar-1.0.0a2/tests/unit/core/test_errors.py +38 -0
  390. bezoar-1.0.0a2/tests/unit/core/test_file_truncation.py +188 -0
  391. bezoar-1.0.0a2/tests/unit/core/test_locate_property.py +70 -0
  392. bezoar-1.0.0a2/tests/unit/core/test_mcp_config.py +164 -0
  393. bezoar-1.0.0a2/tests/unit/core/test_models.py +109 -0
  394. bezoar-1.0.0a2/tests/unit/core/test_normalize.py +161 -0
  395. bezoar-1.0.0a2/tests/unit/core/test_p0_compat.py +29 -0
  396. bezoar-1.0.0a2/tests/unit/core/test_parsing.py +87 -0
  397. bezoar-1.0.0a2/tests/unit/core/test_registry.py +53 -0
  398. bezoar-1.0.0a2/tests/unit/core/test_registry_plugins.py +97 -0
  399. bezoar-1.0.0a2/tests/unit/detectors/conftest.py +136 -0
  400. bezoar-1.0.0a2/tests/unit/detectors/test_corpus_required.py +102 -0
  401. bezoar-1.0.0a2/tests/unit/detectors/test_data_exfiltration.py +124 -0
  402. bezoar-1.0.0a2/tests/unit/detectors/test_external_instructions.py +111 -0
  403. bezoar-1.0.0a2/tests/unit/detectors/test_hidden_behavior.py +228 -0
  404. bezoar-1.0.0a2/tests/unit/detectors/test_permissions.py +236 -0
  405. bezoar-1.0.0a2/tests/unit/detectors/test_supply_chain.py +232 -0
  406. bezoar-1.0.0a2/tests/unit/engine/test_cache_metamorphic.py +526 -0
  407. bezoar-1.0.0a2/tests/unit/engine/test_changed_since.py +61 -0
  408. bezoar-1.0.0a2/tests/unit/engine/test_dedupe.py +123 -0
  409. bezoar-1.0.0a2/tests/unit/engine/test_engine_edges.py +75 -0
  410. bezoar-1.0.0a2/tests/unit/engine/test_int_seams.py +270 -0
  411. bezoar-1.0.0a2/tests/unit/engine/test_p0_scan.py +30 -0
  412. bezoar-1.0.0a2/tests/unit/engine/test_pipeline.py +158 -0
  413. bezoar-1.0.0a2/tests/unit/engine/test_policy_boundary.py +141 -0
  414. bezoar-1.0.0a2/tests/unit/engine/test_policy_controls.py +345 -0
  415. bezoar-1.0.0a2/tests/unit/engine/test_rule_timeout_fold.py +106 -0
  416. bezoar-1.0.0a2/tests/unit/engine/test_session.py +78 -0
  417. bezoar-1.0.0a2/tests/unit/engine/test_to_dict.py +127 -0
  418. bezoar-1.0.0a2/tests/unit/engine/test_verdict.py +238 -0
  419. bezoar-1.0.0a2/tests/unit/eval/test_score.py +110 -0
  420. bezoar-1.0.0a2/tests/unit/harness/__init__.py +1 -0
  421. bezoar-1.0.0a2/tests/unit/harness/_gen_fixtures.py +507 -0
  422. bezoar-1.0.0a2/tests/unit/harness/helpers.py +112 -0
  423. bezoar-1.0.0a2/tests/unit/harness/test_context.py +24 -0
  424. bezoar-1.0.0a2/tests/unit/harness/test_corpus.py +79 -0
  425. bezoar-1.0.0a2/tests/unit/harness/test_detector.py +174 -0
  426. bezoar-1.0.0a2/tests/unit/harness/test_p0_fixture.py +31 -0
  427. bezoar-1.0.0a2/tests/unit/harness/test_perf.py +28 -0
  428. bezoar-1.0.0a2/tests/unit/harness/test_registry.py +19 -0
  429. bezoar-1.0.0a2/tests/unit/harness/test_vocab.py +102 -0
  430. bezoar-1.0.0a2/tests/unit/harness/test_wsk_corpus.py +43 -0
  431. bezoar-1.0.0a2/tests/unit/judge/conftest.py +9 -0
  432. bezoar-1.0.0a2/tests/unit/judge/factories.py +127 -0
  433. bezoar-1.0.0a2/tests/unit/judge/fakes.py +155 -0
  434. bezoar-1.0.0a2/tests/unit/judge/test_advisory.py +83 -0
  435. bezoar-1.0.0a2/tests/unit/judge/test_band_immunity.py +76 -0
  436. bezoar-1.0.0a2/tests/unit/judge/test_escalation.py +74 -0
  437. bezoar-1.0.0a2/tests/unit/judge/test_hook.py +52 -0
  438. bezoar-1.0.0a2/tests/unit/judge/test_judge_malformed.py +65 -0
  439. bezoar-1.0.0a2/tests/unit/judge/test_prompts.py +41 -0
  440. bezoar-1.0.0a2/tests/unit/judge/test_protocol.py +88 -0
  441. bezoar-1.0.0a2/tests/unit/judge/test_redaction.py +99 -0
  442. bezoar-1.0.0a2/tests/unit/mcp/conftest.py +179 -0
  443. bezoar-1.0.0a2/tests/unit/mcp/fixtures/fake_stdio_server.py +150 -0
  444. bezoar-1.0.0a2/tests/unit/mcp/mcp_helpers.py +44 -0
  445. bezoar-1.0.0a2/tests/unit/mcp/test_probe_flag.py +109 -0
  446. bezoar-1.0.0a2/tests/unit/mcp/test_probe_http.py +82 -0
  447. bezoar-1.0.0a2/tests/unit/mcp/test_probe_redirect.py +120 -0
  448. bezoar-1.0.0a2/tests/unit/mcp/test_probe_ssrf.py +239 -0
  449. bezoar-1.0.0a2/tests/unit/mcp/test_probe_stdio.py +98 -0
  450. bezoar-1.0.0a2/tests/unit/mcp/test_tool_poisoning.py +222 -0
  451. bezoar-1.0.0a2/tests/unit/parsing/test_bounded_read.py +117 -0
  452. bezoar-1.0.0a2/tests/unit/parsing/test_command_hooks.py +36 -0
  453. bezoar-1.0.0a2/tests/unit/parsing/test_mcp_redact.py +186 -0
  454. bezoar-1.0.0a2/tests/unit/perf/test_cache.py +273 -0
  455. bezoar-1.0.0a2/tests/unit/perf/test_incremental.py +149 -0
  456. bezoar-1.0.0a2/tests/unit/perf/test_no_cache.py +104 -0
  457. bezoar-1.0.0a2/tests/unit/perf/test_parallel.py +116 -0
  458. bezoar-1.0.0a2/tests/unit/policy/test_apply.py +455 -0
  459. bezoar-1.0.0a2/tests/unit/policy/test_discovery.py +118 -0
  460. bezoar-1.0.0a2/tests/unit/policy/test_explain.py +83 -0
  461. bezoar-1.0.0a2/tests/unit/policy/test_policy_schema.py +153 -0
  462. bezoar-1.0.0a2/tests/unit/policy/test_unenforced_controls.py +91 -0
  463. bezoar-1.0.0a2/tests/unit/reporting/conftest.py +121 -0
  464. bezoar-1.0.0a2/tests/unit/reporting/goldens/scan.json +226 -0
  465. bezoar-1.0.0a2/tests/unit/reporting/test_baseline.py +147 -0
  466. bezoar-1.0.0a2/tests/unit/reporting/test_identity.py +142 -0
  467. bezoar-1.0.0a2/tests/unit/reporting/test_json.py +91 -0
  468. bezoar-1.0.0a2/tests/unit/reporting/test_redact.py +479 -0
  469. bezoar-1.0.0a2/tests/unit/reporting/test_reporting_schema.py +105 -0
  470. bezoar-1.0.0a2/tests/unit/reporting/test_sarif.py +31 -0
  471. bezoar-1.0.0a2/tests/unit/reporting/test_text.py +28 -0
  472. bezoar-1.0.0a2/tests/unit/rules/benign/01-readme.md +4 -0
  473. bezoar-1.0.0a2/tests/unit/rules/benign/02-claude.md +5 -0
  474. bezoar-1.0.0a2/tests/unit/rules/benign/03-agents.md +3 -0
  475. bezoar-1.0.0a2/tests/unit/rules/benign/04-skill.md +7 -0
  476. bezoar-1.0.0a2/tests/unit/rules/benign/05-package.json +5 -0
  477. bezoar-1.0.0a2/tests/unit/rules/benign/06-pyproject.toml +4 -0
  478. bezoar-1.0.0a2/tests/unit/rules/benign/07-config.yml +5 -0
  479. bezoar-1.0.0a2/tests/unit/rules/benign/08-settings.json +4 -0
  480. bezoar-1.0.0a2/tests/unit/rules/benign/09-script.sh +4 -0
  481. bezoar-1.0.0a2/tests/unit/rules/benign/10-app.py +6 -0
  482. bezoar-1.0.0a2/tests/unit/rules/benign/11-utils.ts +3 -0
  483. bezoar-1.0.0a2/tests/unit/rules/benign/12-query.js +4 -0
  484. bezoar-1.0.0a2/tests/unit/rules/benign/13-Makefile +5 -0
  485. bezoar-1.0.0a2/tests/unit/rules/benign/14-Dockerfile +4 -0
  486. bezoar-1.0.0a2/tests/unit/rules/benign/15-github-actions.yml +7 -0
  487. bezoar-1.0.0a2/tests/unit/rules/benign/16-env-example +3 -0
  488. bezoar-1.0.0a2/tests/unit/rules/benign/17-jwt-docs.md +4 -0
  489. bezoar-1.0.0a2/tests/unit/rules/benign/18-security-notes.md +4 -0
  490. bezoar-1.0.0a2/tests/unit/rules/benign/19-ignore-files.md +3 -0
  491. bezoar-1.0.0a2/tests/unit/rules/benign/20-passwords-docs.md +4 -0
  492. bezoar-1.0.0a2/tests/unit/rules/benign/21-curl-docs.md +3 -0
  493. bezoar-1.0.0a2/tests/unit/rules/benign/22-webhook-docs.md +3 -0
  494. bezoar-1.0.0a2/tests/unit/rules/benign/23-ssh-docs.md +3 -0
  495. bezoar-1.0.0a2/tests/unit/rules/benign/24-review-checklist.md +5 -0
  496. bezoar-1.0.0a2/tests/unit/rules/benign/25-CHANGELOG.md +4 -0
  497. bezoar-1.0.0a2/tests/unit/rules/benign/26-LICENSE.md +3 -0
  498. bezoar-1.0.0a2/tests/unit/rules/benign/27-CONTRIBUTING.md +3 -0
  499. bezoar-1.0.0a2/tests/unit/rules/benign/28-skill.json +4 -0
  500. bezoar-1.0.0a2/tests/unit/rules/benign/29-mcp.json +8 -0
  501. bezoar-1.0.0a2/tests/unit/rules/benign/30-GEMINI.md +3 -0
  502. bezoar-1.0.0a2/tests/unit/rules/benign/31-typescript.mdc +5 -0
  503. bezoar-1.0.0a2/tests/unit/rules/benign/32-test_helper.py +2 -0
  504. bezoar-1.0.0a2/tests/unit/rules/conftest.py +88 -0
  505. bezoar-1.0.0a2/tests/unit/rules/test_builtin_packs.py +11 -0
  506. bezoar-1.0.0a2/tests/unit/rules/test_compile.py +214 -0
  507. bezoar-1.0.0a2/tests/unit/rules/test_detector.py +244 -0
  508. bezoar-1.0.0a2/tests/unit/rules/test_external_and_exfil.py +39 -0
  509. bezoar-1.0.0a2/tests/unit/rules/test_fp_benign.py +52 -0
  510. bezoar-1.0.0a2/tests/unit/rules/test_lint.py +93 -0
  511. bezoar-1.0.0a2/tests/unit/rules/test_loader.py +57 -0
  512. bezoar-1.0.0a2/tests/unit/rules/test_prompt_injection.py +88 -0
  513. bezoar-1.0.0a2/tests/unit/rules/test_rules_corpus.py +76 -0
  514. bezoar-1.0.0a2/tests/unit/rules/test_rules_schema.py +128 -0
  515. bezoar-1.0.0a2/tests/unit/rules/test_secrets.py +68 -0
  516. bezoar-1.0.0a2/tests/unit/serve/conftest.py +85 -0
  517. bezoar-1.0.0a2/tests/unit/serve/data.py +43 -0
  518. bezoar-1.0.0a2/tests/unit/serve/http_client.py +69 -0
  519. bezoar-1.0.0a2/tests/unit/serve/openapi_check.py +197 -0
  520. bezoar-1.0.0a2/tests/unit/serve/test_atomicity.py +78 -0
  521. bezoar-1.0.0a2/tests/unit/serve/test_cli.py +39 -0
  522. bezoar-1.0.0a2/tests/unit/serve/test_contract.py +270 -0
  523. bezoar-1.0.0a2/tests/unit/serve/test_core_wiring.py +224 -0
  524. bezoar-1.0.0a2/tests/unit/serve/test_csp.py +75 -0
  525. bezoar-1.0.0a2/tests/unit/serve/test_file_redact.py +92 -0
  526. bezoar-1.0.0a2/tests/unit/serve/test_paths.py +51 -0
  527. bezoar-1.0.0a2/tests/unit/serve/test_scans.py +69 -0
  528. bezoar-1.0.0a2/tests/unit/serve/test_security.py +354 -0
  529. bezoar-1.0.0a2/tests/unit/serve/test_store_policy.py +63 -0
  530. bezoar-1.0.0a2/tests/unit/serve/test_token_sources.py +94 -0
@@ -0,0 +1,31 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .venv/
6
+ venv/
7
+ build/
8
+ dist/
9
+ .mypy_cache/
10
+ .ruff_cache/
11
+ .pytest_cache/
12
+
13
+ # bezoar runtime
14
+ .bezoar-cache/
15
+ .bezoar-baseline.json
16
+ *.sarif
17
+
18
+ # OS / editors
19
+ .DS_Store
20
+ .idea/
21
+ .vscode/
22
+
23
+ # Test fixtures: platform config dirs MUST be tracked even though editor
24
+ # gitignores (the .vscode/ above, and common global excludes like .cursor/)
25
+ # hide them — the corpus and adapter fixtures live inside these dirs.
26
+ !tests/**/.vscode/
27
+ !tests/**/.vscode/**
28
+ !tests/**/.cursor/
29
+ !tests/**/.cursor/**
30
+ !tests/**/node_modules/
31
+ !tests/**/node_modules/**
@@ -0,0 +1,141 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.0.0a2] - 2026-09-05
11
+
12
+ Second alpha: security remediation wave, fully wired serve API, green
13
+ Windows CI, and a console design-system upgrade.
14
+
15
+ ### Security
16
+
17
+ - Never cache partial scan outcomes: a rule timeout or detector error no
18
+ longer replays as a complete scan from a warm cache
19
+ - Rule-pack lint now rejects polynomial ReDoS shapes (adjacent-star,
20
+ complement-pair, and match-anything wrappers at every sequence level)
21
+ - Redaction covers JSON-quoted keys (`"password":"…"`), spaced assignments,
22
+ headers, Basic auth, and Slack webhook URLs — and no longer redacts
23
+ 40-hex git SHAs
24
+ - `metadata.identity` and MCP config `Location.relpath` no longer leak
25
+ absolute host paths into default JSON reports
26
+ - `bezoar serve`: any-NUL path rejection (400), generic 500 bodies, 405s
27
+ with security headers, Host header guard on static files, serve token via
28
+ `BEZOAR_SERVE_TOKEN` / `--token-file`, and `X-Bezoar-Client` enforced on
29
+ all write methods
30
+ - MCP probe: cross-host redirects no longer leak Authorization; CGNAT and
31
+ NAT64 ranges blocked alongside RFC1918
32
+
33
+ ### Added
34
+
35
+ - `bezoar serve` API fully wired: policy validate, explain, baseline
36
+ read/write, and scan endpoints (schema-invalid `PUT /policy` → 422)
37
+ - Console: seed-derived 8-step token ramps via `color-mix(in oklch)` with a
38
+ parser test enforcing WCAG AA contrast in both themes
39
+ - Console: floating row actions (Open / Set series / Export / Delete) on the
40
+ reports table — keyboard reachable, axe-clean
41
+ - Console policy editor: YAML 1.1 boolean round-trip and raw-byte report
42
+ import
43
+
44
+ ### Fixed
45
+
46
+ - Windows: CRLF code-fence parsing crash in detectors, concurrent baseline
47
+ write `PermissionError` (retry with backoff), home-directory resolution in
48
+ tests (`USERPROFILE`), UTF-8 console output
49
+ - CI: `uv venv` everywhere (PEP 668), pytest `pythonpath` for bare `pytest`,
50
+ pinned pnpm via `pnpm/action-setup`, test-fixture directories re-included
51
+ from gitignore
52
+ - `--changed-since` handles non-ASCII filenames (NUL-delimited git diff) and
53
+ anchors at the git toplevel for subdirectory scans
54
+
55
+ ## [1.0.0a1] - 2026-09-05
56
+
57
+ First public alpha of bezoar — an offline-first security scanner for the
58
+ AI-agent supply chain (skills, MCP servers, plugins, subagents, rules,
59
+ commands, hooks, CLI helpers, and agent configs).
60
+
61
+ ### Added
62
+
63
+ #### Core
64
+
65
+ - Package `bezoar` `1.0.0a1` (Python 3.11+, hatchling src layout, runtime
66
+ dependency `pyyaml>=6.0`)
67
+ - Six platform adapters: Claude Code, Cursor, Codex CLI, Gemini CLI, GitHub
68
+ Copilot, and generic discovery
69
+ - Wheel ships `bezoar/data/rules/*.yml` + `MANIFEST.json`, seven
70
+ `bezoar/data/harness/*.yml` vocabularies, `bezoar/data/policy/default.yml`,
71
+ `bezoar/data/NOTICE`, and `bezoar/data/schemas/policy.v1.schema.json`
72
+ (required for an installed `bezoar scan`)
73
+
74
+ #### Detectors
75
+
76
+ - 136 declarative rule-pack rules in four builtin packs (`data/rules/`,
77
+ counted in `MANIFEST.json`): secrets 80, prompt_injection 36,
78
+ external_instructions 8, exfil_sinks 12
79
+ - Programmatic detectors: harness-envelope forgery (the differentiator —
80
+ data-driven vocabs + structural-sequence matchers), hidden behavior,
81
+ permissions, supply chain, data exfiltration, external instructions,
82
+ MCP tool-poisoning
83
+ - Flag-gated MCP live probe (`--probe-mcp`; INFO-only, cannot move a band)
84
+ - Advisory LLM judge (`--judge`; `NullProvider` via entry point
85
+ `bezoar.judge:null`; cannot move a band)
86
+
87
+ #### Policy and bands
88
+
89
+ - Band algebra (`safe` | `potential_risk` | `unsafe` | `malicious`) with
90
+ disposition caps and corroboration
91
+ - Policy engine (`.bezoar.yml` layered merge, builtin `data/policy/default.yml`)
92
+ mapping bands to decisions (`allow` | `allow_with_notice` | `alert` | `block`)
93
+ - Expiring exceptions, pins, baselines; band is a fact, decision is policy
94
+
95
+ #### CLI, reporters, schemas
96
+
97
+ - Console script `bezoar` (`scan`, `discover`, `rules lint`, `policy
98
+ validate|explain`, `baseline update|diff`, `cache stats|clear`, `serve`,
99
+ `version`)
100
+ - Scan flags include `--fail-on`, `--format text|json|sarif`, `--changed-since`,
101
+ `--config`, `--baseline`, `--jobs`, `--no-cache`, `--cache-dir`
102
+ - Three reporters: text, JSON (`schemas/scan-result.v1.schema.json`), SARIF 2.1.0
103
+ - Versioned schemas: `scan-result.v1`, `policy.v1`, `rulepack.v1`
104
+
105
+ #### Integrations
106
+
107
+ - Composite GitHub Action (`action.yml`): maps to the CLI flags above, always
108
+ writes `bezoar.sarif` from stdout, uploads via `github/codeql-action/upload-sarif`
109
+ when `upload-sarif` is true (including after a failed gate), then re-raises
110
+ the CLI exit code
111
+ - Extra `bezoar[console]` → `bezoar-console==1.0.0a1`
112
+ - Entry-point groups: `bezoar.detectors`, `bezoar.adapters`, `bezoar.reporters`,
113
+ `bezoar.judge` (`null = bezoar.judge:NullProvider`)
114
+ - Multi-stage `Dockerfile` (python:3.12-slim)
115
+ - CI matrix: CPython 3.11/3.12/3.13 × Ubuntu/macOS/Windows, plus
116
+ `python -m bezoar.rules.lint`
117
+
118
+ #### Web console
119
+
120
+ - Static report viewer (drag/drop `bezoar.scan/v1` JSON → IndexedDB)
121
+ - `bezoar serve` (stdlib server + `/api/v1`) when `bezoar-console` is installed
122
+ - See [docs/console.md](docs/console.md)
123
+
124
+ #### Evaluation and performance
125
+
126
+ - Bundled corpus `tests/corpus` + `scripts/eval/score.py`: detection rate
127
+ **1.0000** (41/41 malicious), finding-level FP rate **0.0000** (0/47 benign)
128
+ - Reference machine: 10,001-file / ~200 MiB synthetic
129
+ monorepo through `map_files` + file cache — **12.72 s** cold / **1.54 s**
130
+ warm (targets: < 60 s / < 5 s)
131
+
132
+ #### Supply-chain hygiene
133
+
134
+ - Reproducible `uv build` (`SOURCE_DATE_EPOCH`)
135
+ - Dual SBOMs: CycloneDX and SPDX
136
+ - Sigstore keyless signatures
137
+ - SLSA provenance (`actions/attest-build-provenance`)
138
+ - PyPI trusted publishing (OIDC, `pypi` environment — maintainer setup TODO)
139
+
140
+ [Unreleased]: https://github.com/IsmailKharoub/bezoar/compare/v1.0.0a1...HEAD
141
+ [1.0.0a1]: https://github.com/IsmailKharoub/bezoar/releases/tag/v1.0.0a1
bezoar-1.0.0a2/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
bezoar-1.0.0a2/NOTICE ADDED
@@ -0,0 +1,9 @@
1
+ bezoar
2
+ Copyright 2026 the bezoar authors
3
+
4
+ This product is licensed under the Apache License, Version 2.0.
5
+ See the LICENSE file for the full license text.
6
+
7
+ Third-party pattern attributions for builtin rule packs (principally
8
+ gitleaks, MIT) are in src/bezoar/data/NOTICE, which is also installed
9
+ in the wheel as bezoar/data/NOTICE.
@@ -0,0 +1,201 @@
1
+ Metadata-Version: 2.5
2
+ Name: bezoar
3
+ Version: 1.0.0a2
4
+ Summary: Open-source security scanner for the AI-agent supply chain — skills, MCPs, plugins, subagents
5
+ License: Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Classifier: Programming Language :: Python :: 3 :: Only
9
+ Classifier: Topic :: Security
10
+ Requires-Python: >=3.11
11
+ Requires-Dist: pyyaml>=6.0
12
+ Provides-Extra: console
13
+ Requires-Dist: bezoar-console==1.0.0a2; extra == 'console'
14
+ Provides-Extra: dev
15
+ Requires-Dist: hypothesis; extra == 'dev'
16
+ Requires-Dist: jsonschema; extra == 'dev'
17
+ Requires-Dist: mypy>=1.10; extra == 'dev'
18
+ Requires-Dist: pytest-xdist; extra == 'dev'
19
+ Requires-Dist: pytest>=8; extra == 'dev'
20
+ Requires-Dist: ruff>=0.6; extra == 'dev'
21
+ Requires-Dist: types-pyyaml; extra == 'dev'
22
+ Provides-Extra: sbom
23
+ Requires-Dist: cyclonedx-bom; extra == 'sbom'
24
+ Description-Content-Type: text/markdown
25
+
26
+ # bezoar
27
+
28
+ **The open-source security scanner for the AI-agent supply chain** — skills, MCP servers,
29
+ plugins, subagents, and CLI add-ons across every major agent platform.
30
+
31
+ > *Bezoar: the legendary stone believed to neutralize any poison. This one neutralizes
32
+ > poisoned agent add-ons.*
33
+
34
+ `bezoar scan` audits an add-on before it enters your agent's context: static detectors,
35
+ four verdict **bands**, and a policy layer that turns those bands into **decisions**.
36
+ Think `npm audit` for agent add-ons — offline-first, deterministic, CI-friendly,
37
+ SARIF/JSON output.
38
+
39
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
40
+ [![PyPI](https://img.shields.io/pypi/v/bezoar.svg)](https://pypi.org/project/bezoar/)
41
+ [![CI](https://github.com/IsmailKharoub/bezoar/actions/workflows/ci.yml/badge.svg)](https://github.com/IsmailKharoub/bezoar/actions/workflows/ci.yml)
42
+ [![SARIF](https://img.shields.io/badge/SARIF-2.1.0-informational)](docs/ci.md)
43
+
44
+ **1.0.0a2** ships the scanner, CLI, SARIF/JSON reporters, GitHub Action, and web
45
+ console. The commands below and the guides in `docs/` describe that shipped
46
+ surface.
47
+
48
+ ## 60-second quickstart
49
+
50
+ Requires Python ≥ 3.11.
51
+
52
+ ```bash
53
+ # From this checkout (works before PyPI)
54
+ uv tool install .
55
+
56
+ # After the 1.0.0a2 tag is published
57
+ # uv tool install bezoar==1.0.0a2
58
+
59
+ bezoar version
60
+ bezoar scan tests/corpus/benign/claude_code/skill-markdown-lint --fail-on unsafe
61
+ ```
62
+
63
+ Point `bezoar scan` at any skill directory or repo root. Flags: `--format
64
+ text|json|sarif` (reports go to stdout; there is no `--output`), `--fail-on`,
65
+ `--config`, `--changed-since`, `--baseline`. Exit `0` = gate passed, `1` =
66
+ band ≥ `--fail-on`, `2` usage, `3` incomplete, `4` internal.
67
+
68
+ See [Getting started](docs/getting-started.md) for reading findings.
69
+
70
+ ### Illustrative text report
71
+
72
+ The live text reporter prints a band table, then per-component rows.
73
+ The excerpt below is the finding shape: `band` is a fact; `decision` is
74
+ policy; locations are raw `file:line:column`; rule ids use `<family>/<rule>`.
75
+
76
+ ```text
77
+ ✗ band=malicious decision=block components=1 findings=4
78
+
79
+ generic:skill:pdf-optimizer@<hash12> malicious → block (band_default)
80
+
81
+ [critical] harness_forgery/control-tag-close SKILL.md:16:1 [hidden]
82
+ Close of a trusted harness wrapper — the breakout primitive
83
+ evidence: </system-reminder>
84
+
85
+ [ high] harness_forgery/control-tag-open SKILL.md:17:1 [hidden]
86
+ Open of a reminder-role control tag with an imperative body
87
+ evidence: <system-reminder priority="critical">
88
+
89
+ [ high] harness_forgery/prose-terminator SKILL.md:22:1 [hidden]
90
+ Prose-form function-end marker (semantic escape)
91
+ evidence: [Function results halted by user]
92
+
93
+ [critical] prompt_injection/instruction-override SKILL.md:27:1
94
+ Instruction-override language
95
+ evidence: Ignore all previous instructions
96
+ ```
97
+
98
+ `--format json` and `--format sarif` are the stable machine interfaces.
99
+ JSON/SARIF are byte-identical across runs (modulo `stats.duration_ms`).
100
+
101
+ ## Bands and decisions
102
+
103
+ **Band is a fact about the component. Decision is what the org does.** No exception,
104
+ pin, baseline, or vendor trust rewrites a band.
105
+
106
+ | Band (fact) | Default decision (policy) |
107
+ |---|---|
108
+ | `safe` | `allow` |
109
+ | `potential_risk` | `allow_with_notice` |
110
+ | `unsafe` | `alert` |
111
+ | `malicious` | `block` |
112
+
113
+ Four bands, four decisions. The three enforcement outcomes people quote
114
+ (allow / alert / block) are the same table: `allow_with_notice` is the fourth decision —
115
+ allow, but surface the risk. Capability-only findings (permissions, unpinned-only
116
+ supply-chain, metadata) cap the band at `potential_risk` unless an intent-bearing
117
+ finding corroborates them. Details: [Policy](docs/policy.md).
118
+
119
+ ## Why bezoar
120
+
121
+ Enterprises deploy coding agents with no seatbelt. Skills and MCPs are executable
122
+ supply-chain artifacts that load straight into an agent's context. Public scanners
123
+ catch generic jailbreak phrases and leaked keys; they miss the class that actually
124
+ steers the model — **harness-envelope forgery** (content impersonating the host
125
+ harness's own control syntax). bezoar maps findings to the
126
+ [OWASP Agentic Skills Top 10](https://owasp.org/www-project-agentic-skills-top-10/)
127
+ and adds that missing family. See [Harness-envelope forgery](docs/harness-forgery.md).
128
+
129
+ A default scan performs **no network requests** and **never executes** scanned
130
+ artifacts. Same inputs → same JSON/SARIF.
131
+
132
+ ## Comparison
133
+
134
+ Public posture as of 2026-09. “Harness-envelope forgery” means a first-class,
135
+ per-platform vocabulary of harness control syntax plus structural-sequence
136
+ matchers — not generic “ignore previous instructions” or “system message”
137
+ regexes.
138
+
139
+ | | Offline | Deterministic | Harness-forgery detection | Policy-as-code | SARIF | Price |
140
+ |---|---|---|---|---|---|---|
141
+ | **bezoar** | Yes (default) | Yes | Yes | Yes (`.bezoar.yml`) | Yes | Apache-2.0 |
142
+ | [Snyk agent-scan](https://github.com/snyk/agent-scan) | No (`SNYK_TOKEN` + hosted analysis) | No | No | No (Snyk org / API) | No (JSON) | Free Snyk account required; commercial platform |
143
+ | [Cisco skill-scanner](https://github.com/cisco-ai-defense/skill-scanner) | Partial (patterns/YARA offline; LLM optional) | Partial (LLM judge optional) | No | Yes (YAML presets) | Yes | Apache-2.0 |
144
+ | [invariantlabs mcp-scan](https://github.com/invariantlabs-ai/mcp-scan) | No (Invariant API or OpenAI; connects to MCP servers) | No | No | Partial (proxy guardrails) | No | Apache-2.0 + cloud / OpenAI |
145
+ | [AIR](https://air.security) | No (inline firewall + cloud) | No | No | Yes (product policy) | Not documented | Commercial |
146
+
147
+ `invariantlabs-ai/mcp-scan` now redirects into Snyk agent-scan; the column reflects
148
+ the historical Invariant CLI that still appears in comparisons. AIR is the commercial
149
+ category reference — see [FAQ](docs/faq.md#how-does-bezoar-relate-to-air).
150
+
151
+ ## Docs
152
+
153
+ | Doc | What it covers |
154
+ |---|---|
155
+ | [Getting started](docs/getting-started.md) | Install, first scan, reading findings, exit codes |
156
+ | [Policy](docs/policy.md) | `.bezoar.yml`, bands vs decisions, exceptions, vendor trust |
157
+ | [Rules authoring](docs/rules-authoring.md) | Rule-pack schema, severity / disposition / confidence, `bezoar rules lint` |
158
+ | [CI](docs/ci.md) | GitHub Action, baselines, SARIF → Code Scanning |
159
+ | [Web console](docs/console.md) | Static JSON viewer and `bezoar serve` |
160
+ | [Harness-envelope forgery](docs/harness-forgery.md) | The differentiator, per-platform vocabularies, tuning |
161
+ | [Platforms](docs/platforms.md) | Discovery matrix and per-platform limits |
162
+ | [FAQ](docs/faq.md) | Offline, determinism, LLM judge, AIR, license |
163
+
164
+ ## Web console
165
+
166
+ The console **never computes security facts** — it renders `bezoar.scan/v1` JSON
167
+ from the CLI.
168
+
169
+ - **Viewer:** open the static export (`console/apps/web/out/index.html` or
170
+ `bezoar_console.dist_path()` after `pip install bezoar-console`). Drag-drop a
171
+ JSON report; it stays in IndexedDB. SARIF is rejected — re-scan with
172
+ `--format json`.
173
+ - **Serve:** `bezoar serve` (loopback + `/api/v1`). Needs the console extra:
174
+
175
+ ```bash
176
+ pip install 'bezoar[console]' # bezoar-console==1.0.0a2
177
+ bezoar serve
178
+ ```
179
+
180
+ Details: [docs/console.md](docs/console.md).
181
+
182
+ ## GitHub Action
183
+
184
+ ```yaml
185
+ # permissions: { contents: read, security-events: write }
186
+ - uses: IsmailKharoub/bezoar@v1.0.0a2
187
+ with:
188
+ path: .
189
+ fail-on: malicious
190
+ upload-sarif: true
191
+ ```
192
+
193
+ The Action always writes `bezoar.sarif` from `bezoar scan --format sarif`
194
+ (stdout; the CLI has no `--output`), uploads it to Code Scanning when
195
+ `upload-sarif` is true — including after a failed gate — then re-raises the
196
+ CLI exit code.
197
+
198
+ ## License
199
+
200
+ Apache-2.0. Rule-pack pattern attributions (gitleaks) are in [`NOTICE`](NOTICE)
201
+ and [`src/bezoar/data/NOTICE`](src/bezoar/data/NOTICE).