Repository navigation
fix(agent-audit): name project MCP servers that run the checkout's own code, and unpinned npx/uvx runners - #1129
Merged
sandstream merged 1 commit intoNov 27, 2026
Conversation
…unpinned runners A project MCP server whose command builds or runs the checkout's own code (go run ./..., cargo run, node ./..., python -m <local package>, npm run, uv run, a relative command) now gets a low warning, "runs repository code at session start" (kit-research artex-cc-vs-kit: ARTEX-CC's .mcp.json runs `go run ./cmd/artex-cc`). `npx -y <pkg>` and `uvx <pkg>` without a version were "unpinned" to `kit triage skill` and passed by `kit agent-audit` on purpose (a failure on every npx config is noise, per the comment on auditMcpStdio). The choice stands: it is not a failure. agent-audit now gives a low warning with the triage skill's runner list and pinned test, so both commands call the same entry unpinned (kit-research shrink-anything-vs-kit). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Docker image built, scanned, and smoke-tested in CI. The PR image is local to this run and is not published. |
sandstream
deleted the
claude/web-kit-status-sync-p6fg9a-protected-audit-mcp-local-code
branch
November 27, 2026 11:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Protected — owner merges (touches
src/agent-audit.ts, in thesecretsset: a comment, one import, and one call).Sources:
artex-cc-vs-kit), Measurement §3 and Plan step 3: ARTEX-CC's committed.mcp.jsonrunsgo run ./cmd/artex-cc serve --stdio --pg ${ARTEX_PG}.shrink-anything-vs-kit: the samenpx -y <pkg>MCP entry is "unpinned" tokit triage skilland passed bykit agent-audit.(a) Runs repository code at session start
src/agent-audit-mcp-launch.tsreads each stdio server in every project configrunAgentAuditreads (.mcp.json,.claude.json,.cursor/mcp.json,.vscode/mcp.json,opencode.json(c), and Codexconfig.tomlthroughconfigView). It warns, severity low, with "runs repository code at session start" when the command is one of:go runon./…,.or a.gofile;cargo run;node,bun,deno run,tsx,ts-nodeorpythonon a relative path, or on${workspaceFolder}/${CLAUDE_PROJECT_DIR};python -m <pkg>where<pkg>is a directory or.pyin the checkout (orsrc/);npm|pnpm|yarn|bun|uv run;./bin/server).Not flagged:
go run github.com/x/y@v1,deno run jsr:…,python -m http.server, absolute paths,docker run, andnpx <pkg>.Why a warning and not a failure: building your own server from source is normal inside that server's own repository. The risk is that any commit or branch decides what runs with the agent's credentials. That is worth a line, not a red build.
(b)
npx -y <pkg>/uvx <pkg>without a versionThe reason for the old behaviour, read first. The comment on
auditMcpStdio(src/agent-audit.ts, lines 141–147 onmain) says: "We do NOT flag the common-and-legitimatenpx <pkg>shape (that would warn on almost every config — noise is the #1 reason security tooling gets ignored)." That is a deliberate decision recorded in code. No ADR or doc states it.Choice: keep it. An unpinned runner is still not a failure. But
agent-auditnow gives a low warning,unpinned MCP runner "<name>" in <file>, that names the runner and the package. So both commands now call the same entry unpinned. The runner list (npx,bunx,uvx,pnpm dlx,yarn dlx,pipx run) and the pinned test (name@<digit>…,@scope/name@<digit>…) are copied from the triage skill'sRUNNERand_pinned(skills/triage/scripts/plugin_scan.py). Sox@latestanduvx pkg==1.0are unpinned in both commands, and@scope/x@1.2.3is pinned in both. The comment onauditMcpStdionow points to the warning.Before / after
scripts/mcp-demo.sh(scratch): a.mcp.jsonwith ARTEX-CC's server and shrink-anything'snpx -y @el4cteo/shrink-anything mcp.Before (
origin/main):After:
Test:
src/agent-audit-mcp-launch.test.ts. It includes the triage skill's own fixture (npx -y lookup-server-fixture@latest, in.mcp.jsonand in Codex'sconfig.toml). Onmain, the module does not exist andrunAgentAuditreturns the single pass row. On this branch, 5/5 pass, and the existingagent-audit*,check-agent-configandtriage-skill-pack-hookstests pass (97 in total).Harness coverage, and choices for the owner
.vscode/mcp.json), OpenCode and Codex.~/.claude.json,~/.codex/config.toml). Plugins and skill packs are covered bykit triage.mcpServersin.gemini/settings.json. The file is read, but this check runs only on theCONFIG_FILESviews.kit checkfailures, it is a one-word change.docs/THREAT_MODEL.mdinstead ofdocs/FEATURES.mditem 3. That line is next to the one docs: Codex has a command allowlist (prefix_rule) #1112 edits, and thedocs/COMMANDS.mdagent-audit row is edited by feat(agent-audit): per-rule allow/ask/deny ledger across Claude Code, Codex, Cursor CLI and Gemini CLI, with a baseline #1121; editing either here would conflict.macOS is unverified. The only file access is
existsSynconnode:path-joined paths forpython -m.Generated by Claude Code