Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ separately (currently `1.2.0`) and changes additively.

## [Unreleased]

### Added

- **Repository execution preflight.** `agentmetry scan --preflight PATH`
inventories supported startup hooks, project MCP definitions, VS Code
folder-open tasks, npm install scripts and devcontainer lifecycle commands.
It shows unresolved references and partial coverage without exposing command
text or running repository code.

## [0.12.2] - 2026-11-16

A privacy release. Both fixes apply only with command logging or full-argument
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ To check what the agents on this machine are about to depend on, before anything
agentmetry scan # MCP servers your agents launch, and AGENTS.md / CLAUDE.md files left in Downloads or on the Desktop
agentmetry scan ~/.claude/skills # skills, rules and CLAUDE.md files: text that instructs the model instead of describing a tool
agentmetry scan npm:NAME # one package name, before you install it
agentmetry scan --preflight ./repo # startup hooks, project MCP and setup declarations
```

It reads files and nothing else: it never starts a server or fetches a package. It exits 1 on a finding, and "no findings" means these checks found nothing, never that something is safe. The checks and their limits are in [docs/scanner.md](docs/scanner.md).
Expand Down Expand Up @@ -156,7 +157,7 @@ These are the numbers from commands, not from a slide.

That block is what `agentmetry benchmark` printed from the PyPI 0.9.4 package and from this tree. "Rules covered 13" counts rule ids named in corpus expectations. Twelve of those are published rules. The thirteenth is the experimental rule. Two published rules have no corpus case: `host-subagent-swarm-burst` and `off-hours-activity`. They are named in `apps/orchestrator/tools/generate_sigma_pack.py` so the Sigma pack still has them.

2523 tests collected (`pytest --collect-only -q` from `apps/orchestrator`). The
Expected collection: 2534 tests collected (`pytest --collect-only -q` from `apps/orchestrator`). The
[0.12.1 release PR's CI run](https://github.com/blitzcrieg1/agentmetry/actions/runs/43610018759)
on Python 3.12 reported 2443 passed and 19 skipped on Linux and macOS,
2456 passed and 6 skipped on Windows, and 83% line coverage on Linux
Expand Down
27 changes: 18 additions & 9 deletions apps/orchestrator/agentmetry/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1205,23 +1205,31 @@ def cmd_mcp(args: argparse.Namespace) -> int:


def cmd_scan(args: argparse.Namespace) -> int:
"""Check what an agent is about to depend on: MCP servers, skills, packages.
"""Check agent dependencies or inventory repository execution declarations.

Exits 1 when anything is found and 2 when nothing could be read. Unlike
`mcp` and `posture`, which a health check runs in the background, this is
run on purpose before something is installed, so a finding should stop the
script that ran it. See core/scanner/scan.py.
script that ran it. Preflight reports partial coverage with exit 2.
"""
import json as _json
from pathlib import Path as _Path

from agentmetry.core.scanner.scan import run
if args.preflight is not None:
if args.target is not None or args.project is not None or args.known is not None:
print("--preflight PATH cannot be combined with a target, --project or --known", file=sys.stderr)
return 2
from agentmetry.core.scanner.preflight import inspect_repository

report = run(
args.target,
project=_Path(args.project).resolve() if args.project else _Path.cwd(),
known_file=args.known,
)
report = inspect_repository(_Path(args.preflight))
else:
from agentmetry.core.scanner.scan import run

report = run(
args.target,
project=_Path(args.project).resolve() if args.project else _Path.cwd(),
known_file=args.known,
)
if args.json:
print(_json.dumps(report.to_json(), indent=2))
else:
Expand Down Expand Up @@ -1810,7 +1818,7 @@ def main(argv: list[str] | None = None) -> int:
)
scan = sub.add_parser(
"scan",
help="check MCP servers, skills or a package name before an agent depends on them",
help="check agent dependencies or inventory what a repository can launch",
)
scan.add_argument(
"target", nargs="?", default=None,
Expand All @@ -1820,6 +1828,7 @@ def main(argv: list[str] | None = None) -> int:
)
scan.add_argument("--project", default=None, help="project root whose MCP config to include (default: cwd)")
scan.add_argument("--known", default=None, help="file of extra known package names, one per line (npm:/pypi: or bare)")
scan.add_argument("--preflight", metavar="PATH", help="inventory repository execution declarations")
scan.add_argument("--json", action="store_true", help="print the report as JSON")
otel = sub.add_parser(
"otel", help="receive Claude Code's native OpenTelemetry stream (no hooks needed)"
Expand Down
Loading
Loading