Skip to content

fix(ai): the benchmarks name each server by host and port, never by a configured URL with its password #2481

Description

@dan-petty

Problem Description

devops ai benchmark and the embedding benchmark name each Ollama server by the configured URL text. When a URL in ai.ollama_urls holds userinfo, the password goes to the terminal output, to the report object and to the saved JSON report.

Lines cited at e02c3fb0:

  • src/devops_cli/ai/benchmark/runner.py:201 takes the servers from settings.ai.ollama_urls as they are.
  • runner.py:249, :278, :340, :359 and :458 write the raw URL as the server of each task response and peer grade. _compute_server_summaries uses it as the server of each server summary.
  • runner.py:373 and :483 use the raw URL as the backend text of the progress lines in a dry run. runner.py:544 prints the raw URLs in the Workers: line.
  • runner.py:1002 (_save_report) writes report.model_dump_json() to <data>/benchmarks/<session>-benchmark.json with no masking. A dry run does not save the file, but it prints the URLs and holds them in the report.
  • src/devops_cli/ai/benchmark/embedding_runner.py:246 takes the same setting. Lines :339 and :498 print on {server_url}, and :347 and :507 store it as the server of each result.

Userinfo is valid configuration: httpx2 sends it as Basic authentication to an Ollama behind an authenticating proxy. #1110 names the server of each AI reply by httpx2.URL(url).origin and writes the text with origin_label, next to LLMResponse in ai/client/models.py. The benchmark runners are outside the sites of #1110, and the review of #1110 found this defect.

Reproduction Steps

  1. Run an offline dry run in Python: BenchmarkRunner(models=["m"], tasks=[BENCHMARK_TASKS[0]], is_dry_run=True, servers=["<url-with-userinfo>"]).execute().
  2. Read the terminal output, report.responses[*].server, report.peer_grades[*].server and report.server_benchmarks[*].server.
  3. Run devops ai benchmark without --dry-run with the same URL in ai.ollama_urls, and read <data>/benchmarks/<session>-benchmark.json.

Expected vs Actual Behavior

Expected: each benchmark names a server by host[:port] from the origin of its URL (example.com:11434), as origin_label(get_url_origin(url)) gives. No output, report field or saved file holds the userinfo. The client still sends the userinfo as Basic authentication. A URL with no origin shows unknown.

Actual: the Workers: line, the backend= progress lines, every server field and the saved JSON report hold <url-with-userinfo>.

Environment Diagnostics

Logs, Traces, or Terminal Output

Models: 1 | Tasks: 1 | Workers: 1 (<url-with-userinfo>)
Evaluating model: m (<url-with-userinfo>)
  task=sec-ssrf-remediation | model=m | backend=<url-with-userinfo> | 0.8s
responses.server: {'<url-with-userinfo>'}
peer_grades.server: {'<url-with-userinfo>'}
server_benchmarks: ['<url-with-userinfo>']

In this report, <url-with-userinfo> is the URL http://example.com:11434 with a user name and a password before the host. The redaction of intake refuses the literal URL, so the report does not show it.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Source: #1110

Proposed design

Problem statement

The AI benchmark runners write the full configured URL, including any userinfo, into terminal output, report fields, and saved JSON files. A password in the URL is exposed to anyone who reads the terminal, the report object, or the saved file. The fix replaces the raw URL with the host and port from the URL origin at every display and report point, while the HTTP client still sends the userinfo as Basic authentication.

Acceptance criteria

  • Criterion 1: The Workers line and all progress lines show host:port, not the full URL with userinfo.
    Verification: Run a dry run with a URL that has userinfo. Read the terminal output. No line contains the userinfo.
  • Criterion 2: Every server field in report.responses, report.peer_grades, and report.server_benchmarks holds host:port, not the full URL.
    Verification: Run a dry run with a URL that has userinfo. Inspect report.responses[].server, report.peer_grades[].server, and report.server_benchmarks[*].server. None contain the userinfo.
  • Criterion 3: The saved JSON report file contains no userinfo in any field.
    Verification: Run devops ai benchmark without --dry-run with a URL that has userinfo in ai.ollama_urls. Read the saved JSON file. No field contains the userinfo.
  • Criterion 4: A URL with no origin shows the text unknown in the server name.
    Verification: Run a dry run with a URL that has no origin. Read the server field. It holds the text unknown.
  • Criterion 5: The HTTP client still sends the userinfo as Basic authentication to the Ollama server.
    Verification: Run a benchmark against an Ollama behind an authenticating proxy. The request succeeds and the proxy receives the Basic auth header.
  • Criterion 6: The embedding benchmark runner shows host:port in its output and result fields, not the full URL.
    Verification: Run the embedding benchmark with a URL that has userinfo. Read the terminal output and the result server fields. None contain the userinfo.

Key questions

  • Which function derives the display name from a URL?: Use origin_label(get_url_origin(url)) from src/devops_cli/ai/client/models.py, the same pattern that fix(ai): replies carry their server as an httpx2 origin, so a password in an AI URL stays out of output, the spend ledger, metrics, spans and cache #1110 established for naming the server of each AI reply. [sources: src/devops_cli/ai/client/models.py, src/devops_cli/ai/benchmark/runner.py:201]
  • Where do the runners apply the substitution: at self.servers assignment or at each display and report point?: Apply it at each display and report point. self.servers must keep the full URL because the HTTP client uses it to send Basic authentication. The substitution is a read-only formatting step at the point where the name is written to output, a report field, or a saved file. (best practice) [sources: src/devops_cli/ai/benchmark/runner.py:201, src/devops_cli/ai/benchmark/embedding_runner.py:246]
    • Rejected: Replace self.servers with masked names at assignment. Rejected. The HTTP client needs the full URL to send Basic authentication. Replacing it at assignment breaks the client.
    • Chosen: Apply origin_label(get_url_origin(url)) at each display and report point. Chosen. The client keeps the full URL for authentication. Each display and report point formats the name independently. This matches the pattern in ai/client/models.py.
  • What text does a URL with no origin produce?: The text unknown. The body states this as the expected behavior, and origin_label returns it when the origin is absent. [sources: src/devops_cli/ai/client/models.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/security
    status/new
    value/high
    effort/medium
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/security. A configured password leaks into terminal output, report objects, and saved JSON files.
    • Priority: P1-High. Credentials written to disk and terminal output are a security defect.
    • Value: High. Prevents password exposure in benchmark output and saved reports.
    • Effort: Medium. Multiple call sites in two files need the same substitution, but the pattern is clear.
    • Related: fix(rag): the Qdrant upsert span names its server by host and port, never by the full URL with its userinfo #2459, which asks for a different change. Both mask userinfo from a server name, but #2459 fixes the Qdrant span while this fixes the AI benchmark output and saved report.
  3. added
    priority/p1-high
    on Oct 28, 2026
  4. added
    status/ready
    and removed
    status/new
    on Oct 28, 2026
  5. devops-cli-service commented on Oct 28, 2026

    @devops-cli-service
    Contributor

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

  6. removed
    status/ready
    on Oct 30, 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

    effort/mediumpriority/p1-highsource/agenttype/securityvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions