The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
fix: cover Docker and Python MCP dependency selectors
Tom Elias05c6b017e10e
diff --git a/.agents/skills/mcp-dependency-review/SKILL.md b/.agents/skills/mcp-dependency-review/SKILL.mdindex 6fc96a72e..a8c530596 100644--- a/.agents/skills/mcp-dependency-review/SKILL.md+++ b/.agents/skills/mcp-dependency-review/SKILL.md@@ -32,7 +32,7 @@ Do not:## Static Classification Rules-For npm/npx-style package selectors, classify the package reference itself:+For npm/npx-style package selectors, Python package selectors, and Docker image references, classify the direct reference:| Selector | Result | Why || --- | --- | --- |@@ -46,6 +46,20 @@ For npm/npx-style package selectors, classify the package reference itself:| wildcard / inequality / other range | MEDIUM | Selector permits more than one version. || local path / script / unknown binary | REVIEW | Package-version drift rules do not establish its update behavior. |+For Docker and Python references, apply these additional outcomes:++| Selector | Result | Why |+| --- | --- | --- |+| Docker image pinned by `@sha256:DIGEST` | SAFE | A well-formed full SHA-256 digest fixes the direct image content, including when a tag is also present. |+| Docker image with a tag or no tag and no digest | HIGH | All tags, including version-looking tags and the default `latest`, can move to different image content. |+| Python exact version (`package==1.2.3` or `uvx [email protected]`) | SAFE | The direct version selector is exact; wildcard equality is not an exact pin. |+| Python package without a version or `uvx package@latest` | HIGH | Future resolution can select different package code. |+| Python version range or wildcard (`package>=1.2,<2`, `package~=1.2`, `package==1.*`) | MEDIUM | The selector permits more than one version. |+| Python editable / direct URL / VCS reference | REVIEW | These forms need separate source and integrity review; do not infer safety from a URL or commit-looking suffix. |+| Unsupported or ambiguous Docker / Python invocation or selector | REVIEW | Record the invocation even when its selected reference cannot be isolated confidently. |++For every runner, `SAFE` applies only to the direct selector or image digest. It does not establish package integrity, provenance, or full transitive dependency reproducibility; it is not a complete security verdict.+Treat `-y` / `--yes` only as context. It suppresses interactive confirmation; it is not a vulnerability by itself.## Review Workflow@@ -72,6 +86,12 @@ Read JSON or configuration text and identify each configured MCP server. For pacPackage-valued flags count as package selectors too. For example, in `npx --package ecc-universal ecc`, classify `ecc-universal` as the package selector and treat `ecc` as the executable. If multiple package-valued flags are present, review every supplied package selector.+For `docker run` and `docker container run`, isolate the image separately from Docker options and the in-container command. For example, `docker run --rm -i example/server:1.2.3 serve` selects `example/server:1.2.3`, not `serve`. Account for option values before the image; do not treat a volume, environment value, or option argument as the image. Inspect an explicit image field in equivalent configuration as an image reference too.++For `uvx` (including `uv tool run`), classify the package from `--from`; for `pipx run`, classify the package from `--spec`. For example, `uvx --from example-tool==1.2.3 example-command` and `pipx run --spec example-tool==1.2.3 example-command` both select `example-tool==1.2.3`; `example-command` is the executable. Accept both separated flag values and `--from=SPEC` / `--spec=SPEC` forms. Without those flags, isolate the tool/package selector (`uvx [email protected]` or `pipx run example-tool`) from subsequent executable arguments. Review additional package-bearing options such as uv's `--with` separately when their syntax is clear.++If the invocation, option boundaries, or selector syntax is unsupported or ambiguous, report REVIEW and never omit the configured server, guess a selected package, or execute the command to resolve uncertainty. Editable installs, direct URLs, VCS sources, shell wrappers, and uncertain executable-to-package mappings require REVIEW.+Never execute the discovered command to learn what it does.### 3. Classify the selectordiff --git a/.cursor/skills/mcp-dependency-review/SKILL.md b/.cursor/skills/mcp-dependency-review/SKILL.mdindex cc3162ad3..5d6e2343a 100644--- a/.cursor/skills/mcp-dependency-review/SKILL.md+++ b/.cursor/skills/mcp-dependency-review/SKILL.md@@ -32,7 +32,7 @@ Do not:## Static Classification Rules-For npm/npx-style package selectors, classify the package reference itself:+For npm/npx-style package selectors, Python package selectors, and Docker image references, classify the direct reference:| Selector | Result | Why || --- | --- | --- |@@ -46,6 +46,20 @@ For npm/npx-style package selectors, classify the package reference itself:| wildcard / inequality / other range | MEDIUM | Selector permits more than one version. || local path / script / unknown binary | REVIEW | Package-version drift rules do not establish its update behavior. |+For Docker and Python references, apply these additional outcomes:++| Selector | Result | Why |+| --- | --- | --- |+| Docker image pinned by `@sha256:DIGEST` | SAFE | A well-formed full SHA-256 digest fixes the direct image content, including when a tag is also present. |+| Docker image with a tag or no tag and no digest | HIGH | All tags, including version-looking tags and the default `latest`, can move to different image content. |+| Python exact version (`package==1.2.3` or `uvx [email protected]`) | SAFE | The direct version selector is exact; wildcard equality is not an exact pin. |+| Python package without a version or `uvx package@latest` | HIGH | Future resolution can select different package code. |+| Python version range or wildcard (`package>=1.2,<2`, `package~=1.2`, `package==1.*`) | MEDIUM | The selector permits more than one version. |+| Python editable / direct URL / VCS reference | REVIEW | These forms need separate source and integrity review; do not infer safety from a URL or commit-looking suffix. |+| Unsupported or ambiguous Docker / Python invocation or selector | REVIEW | Record the invocation even when its selected reference cannot be isolated confidently. |++For every runner, `SAFE` applies only to the direct selector or image digest. It does not establish package integrity, provenance, or full transitive dependency reproducibility; it is not a complete security verdict.+Treat `-y` / `--yes` only as context. It suppresses interactive confirmation; it is not a vulnerability by itself.## Review Workflow@@ -72,6 +86,12 @@ Read JSON or configuration text and identify each configured MCP server. For pacPackage-valued flags count as package selectors too. For example, in `npx --package ecc-universal ecc`, classify `ecc-universal` as the package selector and treat `ecc` as the executable. If multiple package-valued flags are present, review every supplied package selector.+For `docker run` and `docker container run`, isolate the image separately from Docker options and the in-container command. For example, `docker run --rm -i example/server:1.2.3 serve` selects `example/server:1.2.3`, not `serve`. Account for option values before the image; do not treat a volume, environment value, or option argument as the image. Inspect an explicit image field in equivalent configuration as an image reference too.++For `uvx` (including `uv tool run`), classify the package from `--from`; for `pipx run`, classify the package from `--spec`. For example, `uvx --from example-tool==1.2.3 example-command` and `pipx run --spec example-tool==1.2.3 example-command` both select `example-tool==1.2.3`; `example-command` is the executable. Accept both separated flag values and `--from=SPEC` / `--spec=SPEC` forms. Without those flags, isolate the tool/package selector (`uvx [email protected]` or `pipx run example-tool`) from subsequent executable arguments. Review additional package-bearing options such as uv's `--with` separately when their syntax is clear.++If the invocation, option boundaries, or selector syntax is unsupported or ambiguous, report REVIEW and never omit the configured server, guess a selected package, or execute the command to resolve uncertainty. Editable installs, direct URLs, VCS sources, shell wrappers, and uncertain executable-to-package mappings require REVIEW.+Never execute the discovered command to learn what it does.### 3. Classify the selectordiff --git a/skills/mcp-dependency-review/SKILL.md b/skills/mcp-dependency-review/SKILL.mdindex 8f00fea77..4b08af8b0 100644--- a/skills/mcp-dependency-review/SKILL.md+++ b/skills/mcp-dependency-review/SKILL.md@@ -33,7 +33,7 @@ Do not:## Static Classification Rules-For npm/npx-style package selectors, classify the package reference itself:+For npm/npx-style package selectors, Python package selectors, and Docker image references, classify the direct reference:| Selector | Result | Why || --- | --- | --- |@@ -47,6 +47,20 @@ For npm/npx-style package selectors, classify the package reference itself:| wildcard / inequality / other range | MEDIUM | Selector permits more than one version. || local path / script / unknown binary | REVIEW | Package-version drift rules do not establish its update behavior. |+For Docker and Python references, apply these additional outcomes:++| Selector | Result | Why |+| --- | --- | --- |+| Docker image pinned by `@sha256:DIGEST` | SAFE | A well-formed full SHA-256 digest fixes the direct image content, including when a tag is also present. |+| Docker image with a tag or no tag and no digest | HIGH | All tags, including version-looking tags and the default `latest`, can move to different image content. |+| Python exact version (`package==1.2.3` or `uvx [email protected]`) | SAFE | The direct version selector is exact; wildcard equality is not an exact pin. |+| Python package without a version or `uvx package@latest` | HIGH | Future resolution can select different package code. |+| Python version range or wildcard (`package>=1.2,<2`, `package~=1.2`, `package==1.*`) | MEDIUM | The selector permits more than one version. |+| Python editable / direct URL / VCS reference | REVIEW | These forms need separate source and integrity review; do not infer safety from a URL or commit-looking suffix. |+| Unsupported or ambiguous Docker / Python invocation or selector | REVIEW | Record the invocation even when its selected reference cannot be isolated confidently. |++For every runner, `SAFE` applies only to the direct selector or image digest. It does not establish package integrity, provenance, or full transitive dependency reproducibility; it is not a complete security verdict.+Treat `-y` / `--yes` only as context. It suppresses interactive confirmation; it is not a vulnerability by itself.## Review Workflow@@ -73,6 +87,12 @@ Read JSON or configuration text and identify each configured MCP server. For pacPackage-valued flags count as package selectors too. For example, in `npx --package ecc-universal ecc`, classify `ecc-universal` as the package selector and treat `ecc` as the executable. If multiple package-valued flags are present, review every supplied package selector.+For `docker run` and `docker container run`, isolate the image separately from Docker options and the in-container command. For example, `docker run --rm -i example/server:1.2.3 serve` selects `example/server:1.2.3`, not `serve`. Account for option values before the image; do not treat a volume, environment value, or option argument as the image. Inspect an explicit image field in equivalent configuration as an image reference too.++For `uvx` (including `uv tool run`), classify the package from `--from`; for `pipx run`, classify the package from `--spec`. For example, `uvx --from example-tool==1.2.3 example-command` and `pipx run --spec example-tool==1.2.3 example-command` both select `example-tool==1.2.3`; `example-command` is the executable. Accept both separated flag values and `--from=SPEC` / `--spec=SPEC` forms. Without those flags, isolate the tool/package selector (`uvx [email protected]` or `pipx run example-tool`) from subsequent executable arguments. Review additional package-bearing options such as uv's `--with` separately when their syntax is clear.++If the invocation, option boundaries, or selector syntax is unsupported or ambiguous, report REVIEW and never omit the configured server, guess a selected package, or execute the command to resolve uncertainty. Editable installs, direct URLs, VCS sources, shell wrappers, and uncertain executable-to-package mappings require REVIEW.+Never execute the discovered command to learn what it does.### 3. Classify the selectordiff --git a/tests/skills/mcp-dependency-review.test.js b/tests/skills/mcp-dependency-review.test.jsindex 7aac1fee4..a88683367 100644--- a/tests/skills/mcp-dependency-review.test.js+++ b/tests/skills/mcp-dependency-review.test.js@@ -59,6 +59,29 @@ test('classifies mutable selectors without treating them as compromise evidence'assert.match(canonical, /not breach claims/i);assert.match(canonical, /describe dependency mutability alone as proof of a vulnerability, compromise, or malicious package/i);});+test('covers Docker and Python selectors without silently skipping ambiguous invocations', () => {+ const rows = canonical.split('\n').filter(line => line.startsWith('| '));+ const cases = [+ ['Docker image pinned by', 'SAFE'],+ ['Docker image with a tag or no tag and no digest', 'HIGH'],+ ['Python exact version', 'SAFE'],+ ['Python package without a version', 'HIGH'],+ ['Python version range or wildcard', 'MEDIUM'],+ ['Python editable / direct URL / VCS reference', 'REVIEW'],+ ];+ for (const [selector, result] of cases) {+ assert.ok(rows.some(row => row.includes(selector) && row.includes(`| ${result} |`)),+ `${selector} must have an explicit ${result} classification`);+ }+ assert.match(canonical, /`docker run`.*`docker container run`/);+ assert.match(canonical, /image separately from Docker options and the in-container command/i);+ assert.match(canonical, /`uvx --from example-tool==1\.2\.3 example-command`/);+ assert.match(canonical, /`pipx run --spec example-tool==1\.2\.3 example-command`/);+ assert.match(canonical, /`--from=SPEC`.*`--spec=SPEC`/);+ assert.match(canonical, /unsupported or ambiguous.*REVIEW.*never omit/i);+ assert.match(canonical, /package integrity, provenance, or full transitive dependency reproducibility/i);+});+test('does not recommend substituting an arbitrary current latest version', () => {assert.match(canonical, /Do \*\*not\*\* invent a pin by substituting today's latest registry version/i);assert.match(canonical, /pin a version the team has reviewed/i);