xiwuqiAI coding agents are changing what belongs in code review. A pull request may no longer be only...
AI coding agents are changing what belongs in code review.
A pull request may no longer be only application code. It might also add an MCP server, modify AGENTS.md, change Cursor or Claude rules, expand GitHub Actions permissions, or add package lifecycle scripts.
Those changes are worth reviewing because they can alter what tools an agent can run, which tokens it expects, or what CI automation can publish or deploy.
I built ScopeDiff as a small local CLI to make those changes visible before merge.
ScopeDiff is a review aid, not a complete security audit. It does not claim to prevent every AI agent or MCP risk. The goal is simpler: make permission and tooling changes easier to notice during ordinary PR review.
Agent-related configuration is starting to live next to source code:
AGENTS.md and other repo-level instructionsSome of those files are harmless documentation. Some of them can change capability boundaries.
For example, a PR might add an MCP server that expects GITHUB_TOKEN, switch a workflow to pull_request_target, expand contents from read to write, or add an unpinned npx command.
None of those automatically means "bad". But they are review-worthy.
ScopeDiff scans or diffs repository files such as:
.mcp.jsonmcp.json.cursor/mcp.json.cursor/rules/**.claude/settings.json.claude/skills/**/SKILL.mdAGENTS.mdCLAUDE.mdGEMINI.md.github/copilot-instructions.md.github/workflows/*.ymlpackage.jsonDockerfiledocker-compose.yml.env.exampleIt produces Markdown and JSON reports with:
Suppose a PR adds this MCP config:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "${GITHUB_TOKEN}"
}
}
}
}
ScopeDiff can report things like:
If the same PR also changes a workflow from pull_request to pull_request_target and expands contents to write, ScopeDiff reports those changes too.
The point is not to block the PR automatically. The point is to give the reviewer a concise checklist:
You can try the published package with:
npx scopediff@latest scan
npx scopediff@latest diff --base main
npx scopediff@latest report --format markdown
In CI:
name: ScopeDiff
on:
pull_request:
permissions:
contents: read
jobs:
scopediff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: npx scopediff@0.1.0 ci --fail-on high
By default, the CI mode writes to the GitHub Step Summary. It does not comment on PRs.
For v0.1.0, ScopeDiff is intentionally conservative:
.env reading by defaultThe report should help a maintainer decide what to review, not replace human judgment.
ScopeDiff is not:
It can miss things. It can also produce false positives. That is why the report includes evidence and suggested review actions instead of pretending every finding is an exploit.
The most useful feedback right now is practical:
Repo: https://github.com/xiwuqi/scopediff
npm: https://www.npmjs.com/package/scopediff
If ScopeDiff helps you review agent/tooling changes, feedback is welcome. If it is useful, a star helps other maintainers find it.
Disclosure: I used an AI coding assistant to help draft and edit this post, then reviewed and approved the content before publishing.