# gitleaks - Doramagic AI Context Pack

> 定位：安装前体验与判断资产。它帮助宿主 AI 有一个好的开始，但不代表已经安装、执行或验证目标项目。

## 充分原则

- **充分原则，不是压缩原则**：AI Context Pack 应该充分到让宿主 AI 在开工前理解项目价值、能力边界、使用入口、风险和证据来源；它可以分层组织，但不以最短摘要为目标。
- **压缩策略**：只压缩噪声和重复内容，不压缩会影响判断和开工质量的上下文。

## 给宿主 AI 的使用方式

你正在读取 Doramagic 为 gitleaks 编译的 AI Context Pack。请把它当作开工前上下文：帮助用户理解适合谁、能做什么、如何开始、哪些必须安装后验证、风险在哪里。不要声称你已经安装、运行或执行了目标项目。

## Claim 消费规则

- **事实来源**：Repo Evidence + Claim/Evidence Graph；Human Wiki 只提供显著性、术语和叙事结构。
- **事实最低状态**：`supported`
- `supported`：可以作为项目事实使用，但回答中必须引用 claim_id 和证据路径。
- `weak`：只能作为低置信度线索，必须要求用户继续核实。
- `inferred`：只能用于风险提示或待确认问题，不能包装成项目事实。
- `unverified`：不得作为事实使用，应明确说证据不足。
- `contradicted`：必须展示冲突来源，不得替用户强行选择一个版本。

## 它最适合谁

- **想在安装前理解开源项目价值和边界的用户**：当前证据主要来自项目文档。 证据：`README.md` Claim：`clm_0002` supported 0.86

## 它能做什么

- **命令行启动或安装流程**（需要安装后验证）：项目文档中存在可执行命令，真实使用需要在本地或宿主环境中运行这些命令。 证据：`README.md` Claim：`clm_0001` supported 0.86

## 怎么开始

- `git clone https://github.com/gitleaks/gitleaks.git` 证据：`README.md` Claim：`clm_0003` supported 0.86

## 继续前判断卡

- **当前建议**：仅建议沙盒试装
- **为什么**：项目存在安装命令、宿主配置或本地写入线索，不建议直接进入主力环境，应先在隔离环境试装。

### 30 秒判断

- **现在怎么做**：仅建议沙盒试装
- **最小安全下一步**：先跑 Prompt Preview；若仍要安装，只在隔离环境试装
- **先别相信**：真实输出质量不能在安装前相信。
- **继续会触碰**：命令执行、本地环境或项目文件、宿主 AI 上下文

### 现在可以相信

- **适合人群线索：想在安装前理解开源项目价值和边界的用户**（supported）：有 supported claim 或项目证据支撑，但仍不等于真实安装效果。 证据：`README.md` Claim：`clm_0002` supported 0.86
- **能力存在：命令行启动或安装流程**（supported）：可以相信项目包含这类能力线索；是否适合你的具体任务仍要试用或安装后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86
- **存在 Quick Start / 安装命令线索**（supported）：可以相信项目文档出现过启动或安装入口；不要因此直接在主力环境运行。 证据：`README.md` Claim：`clm_0003` supported 0.86

### 现在还不能相信

- **真实输出质量不能在安装前相信。**（unverified）：Prompt Preview 只能展示引导方式，不能证明真实项目中的结果质量。
- **宿主 AI 版本兼容性不能在安装前相信。**（unverified）：Claude、Cursor、Codex、Gemini 等宿主加载规则和版本差异必须在真实环境验证。
- **不会污染现有宿主 AI 行为，不能直接相信。**（inferred）：Skill、plugin、AGENTS/CLAUDE/GEMINI 指令可能改变宿主 AI 的默认行为。
- **可安全回滚不能默认相信。**（unverified）：除非项目明确提供卸载和恢复说明，否则必须先在隔离环境验证。
- **真实安装后是否与用户当前宿主 AI 版本兼容？**（unverified）：兼容性只能通过实际宿主环境验证。
- **项目输出质量是否满足用户具体任务？**（unverified）：安装前预览只能展示流程和边界，不能替代真实评测。
- **安装命令是否需要网络、权限或全局写入？**（unverified）：这影响企业环境和个人环境的安装风险。 证据：`README.md`

### 继续会触碰什么

- **命令执行**：包管理器、网络下载、本地插件目录、项目配置或用户主目录。 原因：运行第一条命令就可能产生环境改动；必须先判断是否值得跑。 证据：`README.md`
- **本地环境或项目文件**：安装结果、插件缓存、项目配置或本地依赖目录。 原因：安装前无法证明写入范围和回滚方式，需要隔离验证。 证据：`README.md`
- **宿主 AI 上下文**：AI Context Pack、Prompt Preview、Skill 路由、风险规则和项目事实。 原因：导入上下文会影响宿主 AI 后续判断，必须避免把未验证项包装成事实。

### 最小安全下一步

- **先跑 Prompt Preview**：用安装前交互式试用判断工作方式是否匹配，不需要授权或改环境。（适用：任何项目都适用，尤其是输出质量未知时。）
- **只在隔离目录或测试账号试装**：避免安装命令污染主力宿主 AI、真实项目或用户主目录。（适用：存在命令执行、插件配置或本地写入线索时。）
- **安装后只验证一个最小任务**：先验证加载、兼容、输出质量和回滚，再决定是否深用。（适用：准备从试用进入真实工作流时。）

### 退出方式

- **保留安装前状态**：记录原始宿主配置和项目状态，后续才能判断是否可恢复。
- **记录安装命令和写入路径**：没有明确卸载说明时，至少要知道哪些目录或配置需要手动清理。
- **如果没有回滚路径，不进入主力环境**：不可回滚是继续前阻断项，不应靠信任或运气继续。

## 哪些只能预览

- 解释项目适合谁和能做什么
- 基于项目文档演示典型对话流程
- 帮助用户判断是否值得安装或继续研究

## 哪些必须安装后验证

- 真实安装 Skill、插件或 CLI
- 执行脚本、修改本地文件或访问外部服务
- 验证真实输出质量、性能和兼容性

## 边界与风险判断卡

- **把安装前预览误认为真实运行**：用户可能高估项目已经完成的配置、权限和兼容性验证。 处理方式：明确区分 prompt_preview_can_do 与 runtime_required。 Claim：`clm_0004` inferred 0.45
- **命令执行会修改本地环境**：安装命令可能写入用户主目录、宿主插件目录或项目配置。 处理方式：先在隔离环境或测试账号中运行。 证据：`README.md` Claim：`clm_0005` supported 0.86
- **待确认**：真实安装后是否与用户当前宿主 AI 版本兼容？。原因：兼容性只能通过实际宿主环境验证。
- **待确认**：项目输出质量是否满足用户具体任务？。原因：安装前预览只能展示流程和边界，不能替代真实评测。
- **待确认**：安装命令是否需要网络、权限或全局写入？。原因：这影响企业环境和个人环境的安装风险。

## 开工前工作上下文

### 加载顺序

- 先读取 how_to_use.host_ai_instruction，建立安装前判断资产的边界。
- 读取 claim_graph_summary，确认事实来自 Claim/Evidence Graph，而不是 Human Wiki 叙事。
- 再读取 intended_users、capabilities 和 quick_start_candidates，判断用户是否匹配。
- 需要执行具体任务时，优先查 role_skill_index，再查 evidence_index。
- 遇到真实安装、文件修改、网络访问、性能或兼容性问题时，转入 risk_card 和 boundaries.runtime_required。

### 任务路由

- **命令行启动或安装流程**：先说明这是安装后验证能力，再给出安装前检查清单。 边界：必须真实安装或运行后验证。 证据：`README.md` Claim：`clm_0001` supported 0.86

### 上下文规模

- 文件总数：362
- 重要文件覆盖：40/362
- 证据索引条目：78
- 角色 / Skill 条目：9

### 证据不足时的处理

- **missing_evidence**：说明证据不足，要求用户提供目标文件、README 段落或安装后验证记录；不要补全事实。
- **out_of_scope_request**：说明该任务超出当前 AI Context Pack 证据范围，并建议用户先查看 Human Manual 或真实安装后验证。
- **runtime_request**：给出安装前检查清单和命令来源，但不要替用户执行命令或声称已执行。
- **source_conflict**：同时展示冲突来源，标记为待核实，不要强行选择一个版本。

## Prompt Recipes

### 适配判断

- 目标：判断这个项目是否适合用户当前任务。
- 预期输出：适配结论、关键理由、证据引用、安装前可预览内容、必须安装后验证内容、下一步建议。

```text
请基于 gitleaks 的 AI Context Pack，先问我 3 个必要问题，然后判断它是否适合我的任务。回答必须包含：适合谁、能做什么、不能做什么、是否值得安装、证据来自哪里。所有项目事实必须引用 evidence_refs、source_paths 或 claim_id。
```

### 安装前体验

- 目标：让用户在安装前感受核心工作流，同时避免把预览包装成真实能力或营销承诺。
- 预期输出：一段带边界标签的体验剧本、安装后验证清单和谨慎建议；不含真实运行承诺或强营销表述。

```text
请把 gitleaks 当作安装前体验资产，而不是已安装工具或真实运行环境。

请严格输出四段：
1. 先问我 3 个必要问题。
2. 给出一段“体验剧本”：用 [安装前可预览]、[必须安装后验证]、[证据不足] 三种标签展示它可能如何引导工作流。
3. 给出安装后验证清单：列出哪些能力只有真实安装、真实宿主加载、真实项目运行后才能确认。
4. 给出谨慎建议：只能说“值得继续研究/试装”“先补充信息后再判断”或“不建议继续”，不得替项目背书。

硬性边界：
- 不要声称已经安装、运行、执行测试、修改文件或产生真实结果。
- 不要写“自动适配”“确保通过”“完美适配”“强烈建议安装”等承诺性表达。
- 如果描述安装后的工作方式，必须使用“如果安装成功且宿主正确加载 Skill，它可能会……”这种条件句。
- 体验剧本只能写成“示例台词/假设流程”：使用“可能会询问/可能会建议/可能会展示”，不要写“已写入、已生成、已通过、正在运行、正在生成”。
- Prompt Preview 不负责给安装命令；如用户准备试装，只能提示先阅读 Quick Start 和 Risk Card，并在隔离环境验证。
- 所有项目事实必须来自 supported claim、evidence_refs 或 source_paths；inferred/unverified 只能作风险或待确认项。

```

### 角色 / Skill 选择

- 目标：从项目里的角色或 Skill 中挑选最匹配的资产。
- 预期输出：候选角色或 Skill 列表，每项包含适用场景、证据路径、风险边界和是否需要安装后验证。

```text
请读取 role_skill_index，根据我的目标任务推荐 3-5 个最相关的角色或 Skill。每个推荐都要说明适用场景、可能输出、风险边界和 evidence_refs。
```

### 风险预检

- 目标：安装或引入前识别环境、权限、规则冲突和质量风险。
- 预期输出：环境、权限、依赖、许可、宿主冲突、质量风险和未知项的检查清单。

```text
请基于 risk_card、boundaries 和 quick_start_candidates，给我一份安装前风险预检清单。不要替我执行命令，只说明我应该检查什么、为什么检查、失败会有什么影响。
```

### 宿主 AI 开工指令

- 目标：把项目上下文转成一次对话开始前的宿主 AI 指令。
- 预期输出：一段边界明确、证据引用明确、适合复制给宿主 AI 的开工前指令。

```text
请基于 gitleaks 的 AI Context Pack，生成一段我可以粘贴给宿主 AI 的开工前指令。这段指令必须遵守 not_runtime=true，不能声称项目已经安装、运行或产生真实结果。
```

## 角色 / Skill 索引

- 共索引 9 个角色 / Skill / 项目文档条目。

- **Gitleaks**（project_doc）：!WARNING Gitleaks is feature complete. I'm not merging new features into Gitleaks. Future releases will be security patches only. I'm shifting my focus to Betterleaks https://github.com/betterleaks/betterleaks 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`README.md`
- **Report Templates**（project_doc）：Report Templates Gitleaks has a neat little feature that lets you format the output of your findings via templates. This means Gitleaks can inject finding data into an html file for a web ui. Use the following command then open index.html after a scan. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`report_templates/README.md`
- **Archives**（project_doc）：This repo has some archive files in its history! 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`testdata/repos/archives/README.md`
- **test**（project_doc）：test This is a repo used for testing gitleaks 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`testdata/repos/small/README.md`
- **test**（project_doc）：test This is a repo used for testing gitleaks 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`testdata/repos/staged/README.md`
- **Contribution guidelines**（project_doc）：If you have a feature or bug fix you would like to contribute please check if there are any open issues describing your proposed addition. If there are open issues, make a comment stating you are working on fixing or implementing said issue. If not, then please open an issue describing your addition. Make sure to link your PR to an issue. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`CONTRIBUTING.md`
- **Security Policy**（project_doc）：Version Supported --------- ----------- Latest Yes 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`SECURITY.md`
- **Who uses Gitleaks?**（project_doc）：As the Gitleaks Community grows, we'd like to keep a list of our users. 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`USERS.md`
- **Template Markdown**（project_doc）：File Line Secret :----- -----: -------- auth.py 1 "a secret" 激活提示：当用户需要理解项目结构、安装方式或边界时参考。 证据：`testdata/expected/report/template_markdown.md`

## 证据索引

- 共索引 78 条证据。

- **Gitleaks**（documentation）：!WARNING Gitleaks is feature complete. I'm not merging new features into Gitleaks. Future releases will be security patches only. I'm shifting my focus to Betterleaks https://github.com/betterleaks/betterleaks 证据：`README.md`
- **Report Templates**（documentation）：Report Templates Gitleaks has a neat little feature that lets you format the output of your findings via templates. This means Gitleaks can inject finding data into an html file for a web ui. Use the following command then open index.html after a scan. 证据：`report_templates/README.md`
- **Archives**（documentation）：This repo has some archive files in its history! 证据：`testdata/repos/archives/README.md`
- **test**（documentation）：test This is a repo used for testing gitleaks 证据：`testdata/repos/small/README.md`
- **test**（documentation）：test This is a repo used for testing gitleaks 证据：`testdata/repos/staged/README.md`
- **Contribution guidelines**（documentation）：If you have a feature or bug fix you would like to contribute please check if there are any open issues describing your proposed addition. If there are open issues, make a comment stating you are working on fixing or implementing said issue. If not, then please open an issue describing your addition. Make sure to link your PR to an issue. 证据：`CONTRIBUTING.md`
- **License**（source_file）：Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files the "Software" , to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 证据：`LICENSE`
- **Detect**（source_file）：package cmd import "os" "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "os" "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- func init var detectCmd = &cobra.Command{ Use: "detect", Short: "detect secrets in code", Run: runDetect, Hidden: true, } func runDetect cmd cobra.Command, args string ⋮---- var err error findings report.Finding ⋮---- var gitCmd sources… 证据：`cmd/detect.go`
- **Directory**（source_file）：package cmd import "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- func init var directoryCmd = &cobra.Command{ Use: "dir flags path ", Aliases: string{"file", "directory"}, Short: "scan directories or files for secrets", Run: runDirectory, } func runDirectory cmd cobra.Command, args string ⋮---- var err error // setup config aka, the thing that defines rules ⋮---- // start timer ⋮---- // set follow symlinks flag 证据：`cmd/directory.go`
- **Git**（source_file）：package cmd import "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- func init var gitCmd = &cobra.Command{ Use: "git flags repo ", Short: "scan git repositories for secrets", Args: cobra.MaximumNArgs 1 , Run: runGit, } func runGit cmd cobra.Command, args string ⋮---- // setup config aka, the thing that defines ru… 证据：`cmd/git.go`
- **Protect**（source_file）：package cmd import "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/detect" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/detect" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- func init var protectCmd = &cobra.Command{ Use: "protect", Short: "protect secrets in code", Run: runProtect, Hidden: true, } func runProtect cmd cobra.Comman… 证据：`cmd/protect.go`
- **Stdin**（source_file）：package cmd import "os" "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "os" "time" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- func init var stdInCmd = &cobra.Command{ Use: "stdin", Short: "detect secrets from stdin", Run: runStdIn, } func runStdIn cmd cobra.Command, string ⋮---- // parse flag s 证据：`cmd/stdin.go`
- **Config**（source_file）：package config import "embed" "errors" "fmt" "sort" "strings" gv "github.com/hashicorp/go-version" "github.com/spf13/viper" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/regexp" "github.com/zricethezav/gitleaks/v8/version" ⋮---- "embed" "errors" "fmt" "sort" "strings" gv "github.com/hashicorp/go-version" "github.com/spf13/viper" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/regexp" "github.com/zricethezav/gitleaks/v8/version" ⋮---- var //go:embed gitleaks.toml DefaultConfig string extendDepth int ⋮---- //go:embed gitleaks.toml ⋮---- const maxExtendDepth = 2 type ViperConfig struct { Title string Description string Extend… 证据：`config/config.go`
- **This file has been auto-generated. Do not edit manually.**（source_file）：This file has been auto-generated. Do not edit manually. If you would like to contribute new rules, please use cmd/generate/config/main.go and follow the contributing guidelines at https://github.com/gitleaks/gitleaks/blob/master/CONTRIBUTING.md How the hell does secret scanning work? Read this: https://lookingatcomputer.substack.com/p/regex-is-almost-all-you-need This is the default gitleaks configuration file. Rules and allowlists are defined within this file. Rules instruct gitleaks on what should be considered a secret. Allowlists instruct gitleaks on what is allowed, i.e. not a secret. 证据：`config/gitleaks.toml`
- **Detect**（source_file）：package detect import "bufio" "context" "fmt" "os" "strings" "sync" "sync/atomic" "time" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/detect/codec" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/regexp" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ahocorasick "github.com/BobuSumisu/aho-corasick" "github.com/fatih/semgroup" "github.com/rs/zerolog" "github.com/spf13/viper" "golang.org/x/exp/maps" ⋮---- "bufio" "context" "fmt" "os" "strings" "sync" "sync/atomic" "time" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/detect/codec" "github.com/zricethez… 证据：`detect/detect.go`
- **Git**（source_file）：package detect import "context" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "context" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- type RemoteInfo sources.RemoteInfo func d Detector DetectGit cmd sources.GitCmd, remote RemoteInfo report.Finding, error func NewRemoteInfo platform scm.Platform, source string RemoteInfo 证据：`detect/git.go`
- **Constants**（source_file）：package report const version = "v8.0.0" const driver = "gitleaks" 证据：`report/constants.go`
- **Csv**（source_file）：package report import "encoding/csv" "io" "strconv" "strings" ⋮---- "encoding/csv" "io" "strconv" "strings" ⋮---- type CsvReporter struct { } var Reporter = CsvReporter nil func r CsvReporter Write w io.WriteCloser, findings Finding error ⋮---- var cw = csv.NewWriter w 证据：`report/csv.go`
- **Finding**（source_file）：package report import "fmt" "math" "strings" "github.com/charmbracelet/lipgloss" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "fmt" "math" "strings" "github.com/charmbracelet/lipgloss" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- type Finding struct { RuleID string Description string StartLine int EndLine int StartColumn int EndColumn int Line string json:"-" Match string Secret string File string SymlinkFile string Commit string Link string json:",omitempty" Entropy float32 Author string Email string Date string Message string Tags string Fingerprint string Fragment sources.Fragment json:",omitempty" requiredFindings RequiredFinding } type RequiredFinding struct { RuleID string… 证据：`report/finding.go`
- **Json**（source_file）：package report import "encoding/json" "io" ⋮---- "encoding/json" "io" ⋮---- type JsonReporter struct { } var Reporter = JsonReporter nil func t JsonReporter Write w io.WriteCloser, findings Finding error 证据：`report/json.go`
- **Junit**（source_file）：package report import "encoding/json" "encoding/xml" "fmt" "io" "strconv" ⋮---- "encoding/json" "encoding/xml" "fmt" "io" "strconv" ⋮---- type JunitReporter struct { } var Reporter = JunitReporter nil func r JunitReporter Write w io.WriteCloser, findings Finding error func getTestSuites findings Finding TestSuite func getTestCases findings Finding TestCase func getFailure f Finding Failure func getData f Finding string func getMessage f Finding string type TestSuites struct { XMLName xml.Name xml:"testsuites" TestSuites TestSuite } type TestSuite struct { XMLName xml.Name xml:"testsuite" Failures string xml:"failures,attr" Name string xml:"name,attr" Tests string xml:"tests,attr" TestCases… 证据：`report/junit.go`
- **Report**（source_file）：package report import "io" ⋮---- "io" ⋮---- const CWE = "CWE-798" CWE DESCRIPTION = "Use of Hard-coded Credentials" StdoutReportPath = "-" type Reporter interface { Write w io.WriteCloser, findings Finding error } 证据：`report/report.go`
- **Git**（source_file）：package sources import "bufio" "bytes" "context" "errors" "fmt" "io" "net/url" "os/exec" "path/filepath" "regexp" "strings" "sync" "time" "github.com/fatih/semgroup" "github.com/gitleaks/go-gitdiff/gitdiff" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/logging" ⋮---- "bufio" "bytes" "context" "errors" "fmt" "io" "net/url" "os/exec" "path/filepath" "regexp" "strings" "sync" "time" "github.com/fatih/semgroup" "github.com/gitleaks/go-gitdiff/gitdiff" "github.com/zricethezav/gitleaks/v8/cmd/scm" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/logging" ⋮---- var quotedOptPattern = regex… 证据：`sources/git.go`
- **Config**（source_file）：package base import "fmt" "strings" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- "fmt" "strings" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- func CreateGlobalConfig config.Config ⋮---- var letters = "abcdefghijklmnopqrstuvwxyz ." patterns string 证据：`cmd/generate/config/base/config.go`
- **Generate**（source_file）：package utils import "fmt" "strings" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- "fmt" "strings" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- const caseInsensitive = ?i func GenerateSemiGenericRegex identifiers string, secretRegex string, isCaseInsensitive bool regexp.Regexp ⋮---- var sb strings.Builder ⋮---- func MergeRegexps regexps ... regexp.Regexp regexp.Regexp func writeIdentifiers sb strings.Builder, identifiers string func GenerateUniqueTokenRegex secretRegex string, isCaseInsensitive bool regexp.Regexp func GenerateSampleSecret identifier string, secret string string func GenerateSampleSecrets identifier string, secret string string 证据：`cmd/generate/config/utils/generate.go`
- **Generate Test**（source_file）：package utils import "testing" ⋮---- "testing" ⋮---- func TestGenerateSemiGenericRegex t testing.T func TestGenerateUniqueTokenRegex t testing.T 证据：`cmd/generate/config/utils/generate_test.go`
- **Validate**（source_file）：package utils import "strings" "github.com/zricethezav/gitleaks/v8/cmd/generate/config/base" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/detect" "github.com/zricethezav/gitleaks/v8/logging" ⋮---- "strings" "github.com/zricethezav/gitleaks/v8/cmd/generate/config/base" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/detect" "github.com/zricethezav/gitleaks/v8/logging" ⋮---- func Validate rule config.Rule, truePositives string, falsePositives string config.Rule func ValidateWithPaths rule config.Rule, truePositives map string string, falsePositives map string string config.Rule func createSingleRuleDetector r config.Rule detec… 证据：`cmd/generate/config/utils/validate.go`
- **Head**（source_file）：ref: refs/heads/main 证据：`testdata/repos/archives/dotGit/HEAD`
- **Orig Head**（source_file）：15fa60c13dccec6add267b7baa065977a6cc748a 证据：`testdata/repos/archives/dotGit/ORIG_HEAD`
- **Config**（source_file）：core repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true 证据：`testdata/repos/archives/dotGit/config`
- **Description**（source_file）：Unnamed repository; edit this file 'description' to name the repository. 证据：`testdata/repos/archives/dotGit/description`
- **git ls-files --others --exclude-from=.git/info/exclude**（source_file）：git ls-files --others --exclude-from=.git/info/exclude Lines that start with ' ' are comments. For a project mostly in C, the following would be a good set of exclude patterns uncomment them if you want to use them : . oa ~ 证据：`testdata/repos/archives/dotGit/info/exclude`
- **Refs**（source_file）：15fa60c13dccec6add267b7baa065977a6cc748a refs/heads/main 证据：`testdata/repos/archives/dotGit/info/refs`
- **Packs**（source_file）：P pack-9d774732f0e985d717a26e126e6574d089375b0d.pack 证据：`testdata/repos/archives/dotGit/objects/info/packs`
- **pack-refs with: peeled fully-peeled sorted**（source_file）：pack-refs with: peeled fully-peeled sorted 15fa60c13dccec6add267b7baa065977a6cc748a refs/heads/main 证据：`testdata/repos/archives/dotGit/packed-refs`
- **Security Policy**（documentation）：Version Supported --------- ----------- Latest Yes 证据：`SECURITY.md`
- **Who uses Gitleaks?**（documentation）：As the Gitleaks Community grows, we'd like to keep a list of our users. 证据：`USERS.md`
- **Template Markdown**（documentation）：File Line Secret :----- -----: -------- auth.py 1 "a secret" 证据：`testdata/expected/report/template_markdown.md`
- **Baseline**（structured_config）：{ "Description": "PyPI upload token", "StartLine": 32, "EndLine": 32, "StartColumn": 21, "EndColumn": 106, "Match": " ", "Secret": " ", "File": "detect/detect test.go", "Commit": "9326f35380636bcbe61e94b0584d1618c4b5c2c2", "Entropy": 1.9606875, "Author": " ", "Email": " ", "Date": "2022-03-07T14:33:06Z", "Message": "Escape - character in regex character groups 802 \n\n fix char escape\n\n add test\n\n fix verbosity in make test", "Tags": , "RuleID": "pypi-upload-token", "Fingerprint": "9326f35380636bcbe61e94b0584d1618c4b5c2c2:detect/detect test.go:pypi-upload-token:32" }, { "Description": "PyPI upload token", "StartLine": 33, "EndLine": 33, "StartColumn": 21, "EndColumn": 106, "Match": " ",… 证据：`testdata/baseline/baseline.json`
- **Empty**（structured_config）： 证据：`testdata/expected/report/empty.json`
- **Json Simple**（structured_config）：{ "RuleID": "test-rule", "Description": "", "StartLine": 1, "EndLine": 2, "StartColumn": 1, "EndColumn": 2, "Match": "line containing secret", "Secret": "a secret", "File": "auth.py", "SymlinkFile": "", "Commit": "0000000000000000", "Entropy": 0, "Author": "John Doe", "Email": "johndoe@gmail.com", "Date": "10-19-2003", "Message": "opps", "Tags": , "Fingerprint": "" } 证据：`testdata/expected/report/json_simple.json`
- **Template Jsonextra**（structured_config）：{ "Description": "A test rule", "StartLine": 1, "EndLine": 2, "StartColumn": 1, "EndColumn": 2, "Line": "whole line containing secret", "Match": "line containing secret", "Secret": "a secret", "File": "auth.py", "SymlinkFile": "", "Commit": "0000000000000000", "Entropy": 0, "Author": "John Doe", "Email": "johndoe@gmail.com", "Date": "10-19-2003", "Message": "opps", "Tags": "tag1","tag2","tag3" , "RuleID": "test-rule", "Fingerprint": "" } 证据：`testdata/expected/report/template_jsonextra.json`
- **Binaries for programs and plugins**（source_file）：Binaries for programs and plugins .exe .exe~ .dll .so .dylib .DS STORE .idea .got gitleaks build profile 证据：`.gitignore`
- **.gitleaksignore**（source_file）：418edf165dbb63d6f46993ae8f8818ffd87ea582:cmd/generate/config/rules/jwt.go:jwt:17 418edf165dbb63d6f46993ae8f8818ffd87ea582:cmd/generate/config/rules/jwt.go:jwt:19 525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:46 525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:48 525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:50 525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:52 525d9792b1e3670b4630b8fcc385ca22e8544f9b:cmd/generate/config/rules/sidekiq.go:sidekiq-sensitive-url:54 525d9792b1e3670b4630b8… 证据：`.gitleaksignore`
- **.Golangci**（source_file）：version: '2' linters: default: none disable: - cyclop - depguard - dupl - err113 - errcheck - exhaustive - exhaustruct - exptostd - forbidigo - funcorder - funlen - gochecknoglobals - gochecknoinits - gocognit - goconst - gocritic - gocyclo - godot - godox - gosec - gosmopolitan - intrange - lll - maintidx - mnd - musttag - nestif - nilerr - nlreturn - nonamedreturns - paralleltest - perfsprint - prealloc - predeclared - tagliatelle - testifylint - testpackage - tparallel - unparam - unused - varnamelen - wastedassign - whitespace - wrapcheck - wsl - zerologlint enable: - inamedparam - misspell - revive - misspell - inamedparam - exhaustruct - inamedparam - misspell - nonamedreturns - stati… 证据：`.golangci.yaml`
- **.Goreleaser**（source_file）：project name: gitleaks builds: - main: main.go binary: gitleaks goos: - darwin - linux - windows goarch: - amd64 - "386" - arm - arm64 goarm: - "6" - "7" tags: - gore2regex ldflags: - -s -w -X=github.com/zricethezav/gitleaks/v8/version.Version={{.Version}} archives: - builds: gitleaks format overrides: - goos: windows format: zip replacements: amd64: x64 386: x32 release: prerelease: true 证据：`.goreleaser.yml`
- **.Pre Commit Hooks**（source_file）：- id: gitleaks name: Detect hardcoded secrets description: Detect hardcoded secrets using Gitleaks entry: gitleaks git --pre-commit --redact --staged --verbose language: golang pass filenames: false - id: gitleaks-docker name: Detect hardcoded secrets description: Detect hardcoded secrets using Gitleaks entry: zricethezav/gitleaks git --pre-commit --redact --staged --verbose language: docker image pass filenames: false - id: gitleaks-system name: Detect hardcoded secrets description: Detect hardcoded secrets using Gitleaks entry: gitleaks git --pre-commit --redact --staged --verbose language: system 证据：`.pre-commit-hooks.yaml`
- **Dockerfile**（source_file）：FROM golang:1.24 AS build WORKDIR /go/src/github.com/zricethezav/gitleaks COPY . . RUN VERSION=$ git describe --tags --abbrev=0 && \ CGO ENABLED=0 go build -o bin/gitleaks -ldflags "-X=github.com/zricethezav/gitleaks/v8/version.Version=${VERSION}" 证据：`Dockerfile`
- **Makefile**（source_file）：.PHONY: test test-cover failfast profile clean format build 证据：`Makefile`
- **Diagnostics**（source_file）：package cmd import "errors" "fmt" "net/http" "net/http/pprof" "os" "path/filepath" "runtime" "runtime/pprof" "runtime/trace" "strings" "github.com/zricethezav/gitleaks/v8/logging" ⋮---- "errors" "fmt" "net/http" "net/http/pprof" "os" "path/filepath" "runtime" "runtime/pprof" "runtime/trace" "strings" "github.com/zricethezav/gitleaks/v8/logging" ⋮---- type DiagnosticsManager struct { Enabled bool DiagTypes string OutputDir string cpuProfile os.File memProfile string traceProfile os.File } func NewDiagnosticsManager diagnosticsFlag string, diagnosticsDir string DiagnosticsManager, error ⋮---- var err error ⋮---- func dm DiagnosticsManager StartDiagnostics error func dm DiagnosticsManager Stop… 证据：`cmd/diagnostics.go`
- **Root**（source_file）：package cmd import "bytes" "context" "fmt" "io" "os" "path/filepath" "strings" "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gitleaks/v8/detect" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/regexp" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/version" ⋮---- "bytes" "context" "fmt" "io" "os" "path/filepath" "strings" "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zricethezav/gitleaks/v8/config" "github.com/zricethezav/gi… 证据：`cmd/root.go`
- **Version**（source_file）：package cmd import "fmt" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/version" ⋮---- "fmt" "github.com/spf13/cobra" "github.com/zricethezav/gitleaks/v8/version" ⋮---- func init var versionCmd = &cobra.Command{ Use: "version", Short: "display gitleaks version", Run: runVersion, } func runVersion cmd cobra.Command, args string 证据：`cmd/version.go`
- **Allowlist**（source_file）：package config import "errors" "strings" ahocorasick "github.com/BobuSumisu/aho-corasick" "golang.org/x/exp/maps" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- "errors" "strings" ahocorasick "github.com/BobuSumisu/aho-corasick" "golang.org/x/exp/maps" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- type AllowlistMatchCondition int const AllowlistMatchOr AllowlistMatchCondition = iota AllowlistMatchAnd func a AllowlistMatchCondition String string type Allowlist struct { Description string MatchCondition AllowlistMatchCondition Commits string Paths regexp.Regexp RegexTarget string Regexes regexp.Regexp StopWords string validated bool commitMap map string struct{} func a Allowlist Valida… 证据：`config/allowlist.go`
- **Allowlist Test**（source_file）：package config import "errors" "testing" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/assert" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- "errors" "testing" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/stretchr/testify/assert" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- func TestCommitAllowed t testing.T func TestRegexAllowed t testing.T func TestPathAllowed t testing.T func TestValidate t testing.T ⋮---- var regexComparer = func x, y regexp.Regexp bool { ⋮---- var benchCommitAllowlist = func Allowlist { func BenchmarkCommitAllowed b testing.B func BenchmarkCommitNotAllowed b testing.B var… 证据：`config/allowlist_test.go`
- **Config Test**（source_file）：package config import "errors" "testing" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- "errors" "testing" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/spf13/viper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- const configPath = "../testdata/config/" var regexComparer = func x, y regexp.Regexp bool { type translateCase struct { cfgName string cfg Config rules string wantError error } func TestTranslate t t… 证据：`config/config_test.go`
- **Rule**（source_file）：package config import "errors" "fmt" "strings" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- "errors" "fmt" "strings" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- type Rule struct { RuleID string Description string Entropy float64 SecretGroup int Regex regexp.Regexp Path regexp.Regexp Tags string Keywords string Allowlists Allowlist validated bool RequiredRules Required SkipReport bool } type Required struct { RuleID string WithinLines int WithinColumns int } func r Rule Validate error ⋮---- // Try to provide helpful context, since id is empty. var sb strings.Builder 证据：`config/rule.go`
- **Utils**（source_file）：package config import "strings" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- "strings" "github.com/zricethezav/gitleaks/v8/regexp" ⋮---- func anyRegexMatch f string, res regexp.Regexp bool func regexMatched f string, re regexp.Regexp bool // joinRegexOr combines multiple patterns into a single regexp.Regexp. func joinRegexOr patterns regexp.Regexp regexp.Regexp ⋮---- var sb strings.Builder 证据：`config/utils.go`
- **Baseline**（source_file）：package detect import "encoding/json" "fmt" "os" "path/filepath" "github.com/zricethezav/gitleaks/v8/report" ⋮---- "encoding/json" "fmt" "os" "path/filepath" "github.com/zricethezav/gitleaks/v8/report" ⋮---- func IsNew finding report.Finding, redact uint, baseline report.Finding bool func LoadBaseline baselinePath string report.Finding, error ⋮---- var previousFindings report.Finding ⋮---- func d Detector AddBaseline baselinePath string, source string error 证据：`detect/baseline.go`
- **Files**（source_file）：package detect import "context" "errors" "os" "sync" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- "context" "errors" "os" "sync" "github.com/zricethezav/gitleaks/v8/logging" "github.com/zricethezav/gitleaks/v8/report" "github.com/zricethezav/gitleaks/v8/sources" ⋮---- func d Detector DetectFiles scanTargets <-chan sources.ScanTarget report.Finding, error ⋮---- var wg sync.WaitGroup 证据：`detect/files.go`
- **Location**（source_file）：package detect type Location struct { startLine int endLine int startColumn int endColumn int startLineIndex int endLineIndex int } func location newlineIndices int, raw string, matchIndex int Location ⋮---- var prevNewLine int location Location lineSet bool lineNum int 证据：`detect/location.go`
- 其余 18 条证据见 `AI_CONTEXT_PACK.json` 或 `EVIDENCE_INDEX.json`。

## 宿主 AI 必须遵守的规则

- **把本资产当作开工前上下文，而不是运行环境。**：AI Context Pack 只包含证据化项目理解，不包含目标项目的可执行状态。 证据：`README.md`, `report_templates/README.md`, `testdata/repos/archives/README.md`
- **回答用户时区分可预览内容与必须安装后才能验证的内容。**：安装前体验的消费者价值来自降低误装和误判，而不是伪装成真实运行。 证据：`README.md`, `report_templates/README.md`, `testdata/repos/archives/README.md`

## 用户开工前应该回答的问题

- 你准备在哪个宿主 AI 或本地环境中使用它？
- 你只是想先体验工作流，还是准备真实安装？
- 你最在意的是安装成本、输出质量、还是和现有规则的冲突？

## 验收标准

- 所有能力声明都能回指到 evidence_refs 中的文件路径。
- AI_CONTEXT_PACK.md 没有把预览包装成真实运行。
- 用户能在 3 分钟内看懂适合谁、能做什么、如何开始和风险边界。

---

## Doramagic Context Augmentation

下面内容用于强化 Repomix/AI Context Pack 主体。Human Manual 只提供阅读骨架；踩坑日志会被转成宿主 AI 必须遵守的工作约束。

## Human Manual 骨架

使用规则：这里只是项目阅读路线和显著性信号，不是事实权威。具体事实仍必须回到 repo evidence / Claim Graph。

宿主 AI 硬性规则：
- 不得把页标题、章节顺序、摘要或 importance 当作项目事实证据。
- 解释 Human Manual 骨架时，必须明确说它只是阅读路线/显著性信号。
- 能力、安装、兼容性、运行状态和风险判断必须引用 repo evidence、source path 或 Claim Graph。

- **Gitleaks 概述与系统架构**：importance `high`
  - source_paths: main.go, README.md, Makefile, go.mod, cmd/root.go
- **配置系统与规则定义**：importance `high`
  - source_paths: config/config.go, config/rule.go, config/allowlist.go, config/utils.go, config/gitleaks.toml
- **扫描模式与检测引擎**：importance `high`
  - source_paths: cmd/git.go, cmd/directory.go, cmd/stdin.go, cmd/detect.go, cmd/protect.go
- **报告输出与误报抑制**：importance `high`
  - source_paths: report/finding.go, report/report.go, report/constants.go, report/json.go, report/csv.go

## Repo Inspection Evidence / 源码检查证据

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `8ad8470035d31a209322c580153b45c18e21b980`
- inspected_files: `Dockerfile`, `README.md`

宿主 AI 硬性规则：
- 没有 repo_clone_verified=true 时，不得声称已经读过源码。
- 没有 repo_inspection_verified=true 时，不得把 README/docs/package 文件判断写成事实。
- 没有 quick_start_verified=true 时，不得声称 Quick Start 已跑通。

## Doramagic Pitfall Constraints / 踩坑约束

这些规则来自 Doramagic 发现、验证或编译过程中的项目专属坑点。宿主 AI 必须把它们当作工作约束，而不是普通说明文字。

### Constraint 1: 来源证据：fix: global commit allowlist silently bypassed due to misscoped continue

- Trigger: GitHub 社区证据显示该项目存在一个安装相关的待验证问题：fix: global commit allowlist silently bypassed due to misscoped continue
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/gitleaks/gitleaks/issues/2165 | 来源类型 github_issue 暴露的待验证使用条件。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 2: 来源证据：Possible leaked API key in this repository

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Possible leaked API key in this repository
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | https://github.com/gitleaks/gitleaks/issues/2110 | 来源讨论提到 api key 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 3: 涉及密钥、隐私或敏感领域

- Trigger: 项目文本出现 secret/private key/privacy/trading/finance 等敏感关键词。
- Host AI rule: 补敏感数据流、密钥存储和权限边界审查。
- Why it matters: 金融、交易、隐私和密钥场景必须比普通工具更保守。
- Evidence: packet_text.keyword_scan | https://github.com/gitleaks/gitleaks | matched secret / private key / privacy / trading / finance keyword
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 4: 依赖 Docker 环境

- Trigger: 安装/运行入口包含 Docker 命令：docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH] # Docker (ghcr.io) docker pull ghcr.io/gitleaks/gitleaks:latest docker run -v ${path_to_host_folder_to_scan}:/path ghcr.io/gitleaks/gitleaks:latest
- Host AI rule: 标注 Docker 前置条件，并提供非 Docker 路径或失败提示。
- Why it matters: 非工程用户可能没有 Docker，启动成本明显增加。
- Evidence: identity.distribution | https://github.com/gitleaks/gitleaks | docker run -v ${path_to_host_folder_to_scan}:/path zricethezav/gitleaks:latest [COMMAND] [OPTIONS] [SOURCE_PATH] # Docker (ghcr.io) docker pull ghcr.io/gitleaks/gitleaks:latest docker run -v ${path_to_host_folder_to_scan}:/path ghcr.io/gitleaks/gitleaks:latest
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 5: 能力判断依赖假设

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: 将假设转成下游验证清单。
- Why it matters: 假设不成立时，用户拿不到承诺的能力。
- Evidence: capability.assumptions | https://github.com/gitleaks/gitleaks | README/documentation is current enough for a first validation pass.
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 6: 维护活跃度未知

- Trigger: 未记录 last_activity_observed。
- Host AI rule: 补 GitHub 最近 commit、release、issue/PR 响应信号。
- Why it matters: 新项目、停更项目和活跃项目会被混在一起，推荐信任度下降。
- Evidence: evidence.maintainer_signals | https://github.com/gitleaks/gitleaks | last_activity_observed missing
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

- Trigger: no_demo
- Evidence: downstream_validation.risk_items | https://github.com/gitleaks/gitleaks | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 8: 存在评分风险

- Trigger: no_demo
- Why it matters: 风险会影响是否适合普通用户安装。
- Evidence: risks.scoring_risks | https://github.com/gitleaks/gitleaks | no_demo; severity=medium
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 9: 来源证据：Add detection for Anthropic OAuth tokens (sk-ant-oat01-, sk-ant-ort01-)

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：Add detection for Anthropic OAuth tokens (sk-ant-oat01-, sk-ant-ort01-)
- Why it matters: 可能影响授权、密钥配置或安全边界。
- Evidence: community_evidence:github | https://github.com/gitleaks/gitleaks/issues/2158 | 来源讨论提到 api key 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。

### Constraint 10: 来源证据：gitleaks_8.30.1_windows_x64.zip checksum does not validate

- Trigger: GitHub 社区证据显示该项目存在一个安全/权限相关的待验证问题：gitleaks_8.30.1_windows_x64.zip checksum does not validate
- Host AI rule: 来源显示可能已有修复、规避或版本变化，说明书中必须标注适用版本。
- Why it matters: 可能增加新用户试用和生产接入成本。
- Evidence: community_evidence:github | https://github.com/gitleaks/gitleaks/issues/2164 | 来源讨论提到 windows 相关条件，需在安装/试用前复核。
- Hard boundary: 不要把这个坑点包装成已解决、已验证或可忽略，除非后续验证证据明确证明它已经关闭。
