Repository navigation
fix(agent): reject API keys in custom engine local paths - #381
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
left a comment
There was a problem hiding this comment.
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.
Custom-engine local path templates could expand
${api_key}(including through kwargs) intoinput_file,output_file, orcwd. 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), andmake buildpassed. Added regression tests for direct and kwargs-expanded credentials in all three path fields and symlink resolution.