Skip to content

fix(agent): reject API keys in custom engine local paths - #381

Merged
zpzjzj merged 2 commits into
mainfrom
fix/custom-engine-secret-logging
Nov 6, 2026
Merged

zpzjzj merged 2 commits into
mainfrom
fix/custom-engine-secret-logging

Conversation

@zpzjzj

@zpzjzj zpzjzj commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Custom-engine local path templates could expand ${api_key} (including through kwargs) into input_file, output_file, or cwd. Workspace validation returned those paths in errors logged by the judge, and input uploads could expose them in runtime diagnostics. Existing output-file warning redaction did not cover these paths.

Reject credential-bearing local paths before use and check resolved symlink targets as well. Redact workspace validation errors before returning them to callers. Environment-based credential delivery and normal path operations remain supported.

Addresses code-scanning alert #21. CodeQL reanalysis will verify the alert on this PR; main-branch closure requires merge and reanalysis.

Validation: make fmt, make verify (0 issues), make test (plugin tests, Skill regression tests, and all Go race tests), and make build passed. Added regression tests for direct and kwargs-expanded credentials in all three path fields and symlink resolution.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T07:40:22.582132Z dd1e2ea PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@JHWang-1997 JHWang-1997 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The local input_file, output_file, and cwd checks reject the resolved API key after template/kwargs expansion and also check resolved symlink targets before use. Workspace-validation errors are redacted before returning to callers, and environment-based credential delivery remains supported.

Validated with go test -race ./internal/agent -run TestCustom -count=1; the current CI and extended checks are passing. No blocking code findings. The CLA status is still pending and should be cleared before merge.

@JHWang-1997
JHWang-1997 added this pull request to the merge queue Nov 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 6, 2026
@zpzjzj
zpzjzj added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 9020c7c Nov 6, 2026
16 checks passed
@zpzjzj zpzjzj mentioned this pull request Nov 9, 2026
10 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants