[codex] fail closed on unsafe live scans and restore scanner fidelity#12
Draft
alexyorke wants to merge 18 commits intoAgentSafe-AI:mainfrom
Draft
[codex] fail closed on unsafe live scans and restore scanner fidelity#12alexyorke wants to merge 18 commits intoAgentSafe-AI:mainfrom
alexyorke wants to merge 18 commits intoAgentSafe-AI:mainfrom
Conversation
…ct-review-findings
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.
What changed
scan --server,gate,tooltrust_scan_server, andtooltrust_scan_configunless an unsafe live scan opt-in is setrequirements.txtinline comments / environment markers===exact pins without corrupting the versionrepo_urlhosts before remote lockfile fetches and normalize trailing.git/GitHub URLsbundleDependencies/bundledDependenciesregistry fields so package scripts and IOC metadata are still inspectedscan-reposource detection capped per language without hiding other languagesscan-repodetection to cover mark3labs Go MCP servers and CommonJS / JSX MCP SDK filessourcemetadata from MCPmetadata.dependenciesentriesrepo_urltools/listresponses instead of silently scanning zero tools_metafields alongside legacymetadatafieldsmaininto the PR branch so the PR is up to dateWhy
The scanner had several high-impact fidelity and safety bugs at once: live scans executed the target command on the host before ToolTrust could score it, MCP adapters dropped nested schema and metadata, live dependency enrichment could import unrelated lockfiles from the caller repo, packaging paths fetched mutable
latestbinaries, local lockfile parsing missed common dependency formats, Python requirement pins with extras,===, hashes, or continuation backslashes produced package/version strings OSV would not match, OSV vector severities could be under-classified, remote lockfile fetches trusted malformed GitHub-looking URLs, npm registry decoding could drop package evidence on common field shapes, source-repo detection could miss embedded MCP servers depending on language ordering or SDK style, MCP report generation dropped dependency visibility fields that the CLI already surfaced, MCP dependency parsing discarded per-dependency provenance needed to label verified lockfile evidence correctly, supply-chain issue generation overwrote dependency provenance back to plainmetadata, the dependency-inventory checker used dependency collection instead of checking visibility fields directly, valid JSON-RPCtools/listpayloads were treated as empty, and standard MCP_metafields were ignored.Impact
allow_unsafe_live_scan=truebefore launching target commands or configured serversgithub.com/in the pathlatestscan-reporeports matches across multiple languages and recognizes more common embedded MCP server implementationslocal_lockfile, so visibility labels stay accuraterepo_urlis presenttools/listresponses and live mcp-go_metametadata now retain tool definitions and analyzer inputsValidation
go test ./... -count=1go vet ./...===pins, pip hash/continuation requirements, CVSS vector severity, GitHub repo URL host validation, trailing.git/repo URL normalization, boolean npm bundle dependency fields, scan-repo per-language caps, mark3labs Go detection, CommonJS MCP SDK detection, MCP dependency visibility propagation, MCP dependency visibility text rendering, MCP dependency source preservation, supply-chain evidence source preservation, AS-014 repo URL false-positive prevention, JSON-RPCtools/listparsing, and MCP_metapreservation