Skip to content

fix(security): scan_uv_audit runs a uv audit adapter, and the uv pip audit command that uv does not have goes #2106

Description

@dan-petty

Friction

The agent scan tool scan_uv_audit and the MCP tool scan_uv_audit (src/devops_cli/ai/mcp/server.py) run their own argv. No adapter in src/devops_cli/security/ runs uv audit. For a requirements_file, the tool runs uv pip audit, which uv 0.12.23 does not have (unrecognized subcommand 'audit'), so that path always fails.

What should happen

Evidence

Source: #1435

Proposed design

Problem statement

The scan_uv_audit agent tool and MCP tool run uv pip audit for a requirements file. uv 0.12.23 has no pip audit subcommand, so that path always fails. No adapter in devops_cli.security runs uv audit. The fix adds a uv audit adapter and routes both tools through it.

Acceptance criteria

  • Criterion 1: An adapter in src/devops_cli/security/ runs uv audit --output-format json through ToolExecutor and returns a ScanOutcome.
    Verification: Import the adapter and call its scan function with a ToolExecutorFake. Assert the request argv is ["uv", "audit", "--output-format", "json"] and the return type is ScanOutcome.
  • Criterion 2: The agent scan tool scan_uv_audit calls the adapter and returns its ScanOutcome.
    Verification: Call scan_uv_audit from devops_cli.ai.tools.builtin_tools on a directory with a pyproject.toml. Assert the result is a ScanOutcome.
  • Criterion 3: The MCP scan_uv_audit delegates to the same adapter as the agent tool.
    Verification: Call the MCP scan_uv_audit handler. Assert it calls the same adapter function as the agent tool.
  • Criterion 4: The uv pip audit command is removed from the codebase.
    Verification: Run grep -r 'uv pip audit' src/ and assert zero matches.

Key questions

  • What command does the adapter run?: uv audit --output-format json, as stated in the issue body. (proposed)
  • Where does the adapter live?: In src/devops_cli/security/, as stated in the issue body. (proposed)
  • What executor pattern do the other security adapters use?: They run through ToolExecutor in src/devops_cli/security/tool_executor.py. The agent scan tools call adapter functions that start the tool through the ToolExecutor with an empty standard input. [sources: SECURITY.md, docs/TESTING.md, openspec/changes/archive/2026-10-24-1435-agent-scan-tools-run-the-adapters/proposal.md]
  • Does uv audit exist as a subcommand in the pinned uv version?: Yes. The pre-push gate runs uv audit, and advisories from issues fix(deps): virtualenv 21.14.13 fixes GHSA-cx6f-vjhg-g3cc, which fails the audit check of every pull request #1995 and fix(deps): fastmcp 4.1.2 and filelock 4.2.4 fix seven advisories, which fail the audit check of every pull request #2012 came from it. uv pip audit does not exist in uv 0.12.23. [sources: openspec/changes/archive/2026-10-24-1435-agent-scan-tools-run-the-adapters/proposal.md]
  • Where is the current agent scan tool implementation?: In src/devops_cli/ai/tools/builtin_tools.py. The MCP server imports it at line 147 with from devops_cli.ai.tools.builtin_tools import scan_uv_audit. [sources: src/devops_cli/ai/mcp/server.py:147]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/security
    on Oct 24, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/security. The candidate fixes a security scanning tool by adding an adapter for uv audit command.
    • Priority: P2-Medium. Fixes a broken security tool, but not critical to core functionality. The failed run 1435 does not set P0: the author has no write access, and no caller attached it as evidence. A person can set P0 on the board.
    • Value: Medium. Improves security scanning capability for the team and project.
    • Effort: Low. Adds one adapter file and modifies two calling functions.
    • Related: fix(deps): aiohttp 3.14.4 clears three advisories that fail every devops ci audit, and the maintain test stops running a real uv audit #1697, which asks for a different change. Both items deal with uv audit failures, but the candidate adds an adapter while the related item updates dependencies to fix advisories.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added a commit that references this issue on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source/agenttype/security

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions