Over-Reach Detector

io.github.choreoatlas由 GitHub 账号 choreoatlas 发布v0.0.6更新于 Oct 24, 2026

Detect when AI code changes exceed declared task scope (MCP server).

已验证STDIO仅桌面开发者工具安全与监控

概览

AI 生成的概览

审计 AI 编码代理:将声明的任务范围与实际改动的文件比对,并报告越界情况。

可以做什么
  • 按声明范围检查改动:传入声明的文件 glob、声明的类别(tests、docs、infra、config、code)以及实际修改的文件列表。
  • 获得包含 in_scope、over_reach 或 empty 状态的报告,以及越界文件和推断出的越界类别。
  • 报告可选择 JSON 或 markdown 格式输出。
  • 除 MCP 服务器外,也可通过命令行或 Python 直接调用同一检查逻辑。
适用场景
当 AI 编码代理在代码仓库中工作时,用于快速、可重复地确认它是否只改动了任务允许的文件和类别,例如在审阅改动前或作为代理工作流中的披露步骤。
运行要求
以 Python 包形式通过 stdio 在本机运行(PyPI 上的 over-reach-detector,可用 uvx 运行),需在代理的 MCP 配置中注册启动命令。未声明需要账号、API 密钥或环境变量。
安装前请注意
它是审计与披露工具,不是沙箱也不是拦截器:不会阻止文件写入,也不会回滚、批准或阻止改动,执行与人工复核仍由调用方负责。范围匹配基于 fnmatch glob 且偏向 Python,结果取决于声明范围是否准确。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Over-Reach Detector,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Over-Reach Detector (MCP server)

Detect and report when AI coding agents change files outside their declared task scope. Designed to plug into Cursor, Claude Code, and other MCP-compatible AI coding agents via the standard stdio transport.

Compares two things:

  1. Declared scope — the files (as fnmatch globs) and categories (tests, docs, infra, config, code) the task is allowed to touch.
  2. Actual diff — the files the AI actually modified.

If the actual diff exceeds the declared scope, the tool returns status=over_reach and lists the offending files and categories.

What this tool does and does not do

over-reach-detector is an audit/disclosure tool, not a sandbox and not a blocker.

It compares a declared task scope with the actual files/categories changed by an AI coding agent. If the actual changes exceed the declared scope, it reports that mismatch.

It does not prevent file writes by itself. It does not decide whether to revert, approve, or block a change. The caller remains responsible for enforcement, rollback, or human review.

Install

From PyPI:

bash
pip install over-reach-detector

From source:

bash
git clone https://github.com/choreoatlas/over_reach_detectorcd over_reach_detectorpip install -e .

Quick start

Run all tests: python -m pytest -v

Try the CLI directly: python -m over_reach_detector.detector --input fixtures/example_pr_1.json --format markdown

Use as MCP server

Start the server (stdio transport): over-reach-detector (or python -m over_reach_detector.server from source)

Register with your AI agent:

  • Cursor: in ~/.cursor/mcp.json, add (after pip install over-reach-detector):
json
{  "mcpServers": {    "over-reach-detector": {      "command": "over-reach-detector"    }  }}

Dev / from source: use "command": "python", "args": ["-m", "over_reach_detector.server"] (run from repo root).

  • Claude Code: after pip install over-reach-detector, run claude mcp add over-reach-detector over-reach-detector (writes to ~/.claude.json). Dev / from source: claude mcp add over-reach-detector /absolute/path/to/python -m over_reach_detector.server.

The tool

check_scope_tool takes:

  • declared_files: list of fnmatch globs (e.g. ["docs/*.md", "tests/*.py"])
  • declared_categories: subset of ["tests", "docs", "infra", "config", "code"]
  • actual_files: list of file paths the AI modified
  • output_format: "json" (default) or "markdown"

Returns a report with:

  • status: in_scope (within declared scope) | over_reach (reported mismatch) | empty
  • file_overreach: files not matching any declared glob
  • category_overreach: inferred categories outside the declared set

Scope discipline

Current scope: CLI + MCP stdio server + 1 tool. Python only. fnmatch-based globs.

Out of scope (forbidden): code quality review, security audit, completeness governance, languages other than Python, multi-tool MCP servers, HTTP/SSE transport, GitHub Actions integration. These are deliberately deferred to later versions or never.

Example usage

Call check_scope_tool directly from Python (same logic the MCP server exposes):

python
import jsonfrom over_reach_detector import server
result = server.check_scope_tool(    declared_files=["docs/*.md"],    declared_categories=["docs"],    actual_files=["docs/a.md", "scripts/extra.py"],    output_format="json",)
report = json.loads(result)print(report["status"])          # "over_reach"print(report["file_overreach"])  # ["scripts/extra.py"]

License

MIT — see LICENSE.

来源:README.md,提交 c72bc0f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.0.6最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分