Skip to content

fix(ci): route Strix through Vertex AI org secrets - #288

Merged
seonghobae merged 10 commits into
masterfrom
fix/strix-vertex-org-secrets-20260528
May 28, 2026
Merged

fix(ci): route Strix through Vertex AI org secrets#288
seonghobae merged 10 commits into
masterfrom
fix/strix-vertex-org-secrets-20260528

Conversation

@seonghobae

@seonghobae seonghobae commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Route Strix Security Scan through the organization Vertex AI model vertex_ai/gemini-3.1-pro-preview-customtools using org GCP_SA_KEY.
  • Keep direct OpenAI GPT-5.4+ support as a fail-closed fallback path, but stop exposing generic LLM_API_KEY to Vertex scans.
  • Preserve privileged pull_request_target safety: trusted workspace scripts, no actions/checkout, PR head treated as data, no GitHub Models routing.
  • Carry forward timeout/fallback fixes so LLM timeouts move to configured fallbacks instead of same-model retry loops.

Operational setup verified

  • Org STRIX_LLM exists and repo-level STRIX_LLM is absent, so org secret will apply.
  • Vertex mode requires GCP_SA_KEY and exports LiteLLM Vertex env: GOOGLE_APPLICATION_CREDENTIALS, VERTEXAI_PROJECT, and VERTEXAI_LOCATION.

Verification

  • bash scripts/ci/test_strix_quick_gate.sh
  • python3 - <<'PY' ... yaml.safe_load('.github/workflows/strix.yml') ... PY
  • bash -n scripts/ci/strix_quick_gate.sh scripts/ci/test_strix_quick_gate.sh
  • git diff --check

Notes

This PR intentionally does not use GitHub Models and does not add models: read.

Summary by CodeRabbit

  • New Features

    • Provider-driven LLM routing with org-default Vertex AI (validated model) and optional explicit OpenAI mode; workflows accept manual PR inputs for trusted PR-scoped evidence.
  • Documentation

    • Updated governance/README/docs to mandate Vertex default, restrict silent cross-provider fallbacks, and clarify direct-OpenAI as explicit-only.
  • Tests

    • Expanded CI tests for Vertex scenarios, credential handling, input-safety, and updated fallback/timeout expectations.
  • Chores

    • Hardened workflow validation, credential export/masking, error messages, and fail-closed behavior.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR extends the Strix security scanning workflow to support Vertex AI as a provider route alongside direct OpenAI, implementing model-driven provider gating, conditional credential handling, Vertex credential preparation in CI, updated timeout/fallback behavior in the gate script, and comprehensive test/documentation updates reflecting the new provider contract.

Changes

Vertex AI Provider Support

Layer / File(s) Summary
Governance and documentation
AGENTS.md, README.md, docs/plans/*
Specify Vertex AI as the default route via STRIX_LLM+GCP_SA_KEY, restrict direct OpenAI to explicit STRIX_OPENAI_API_KEY, and document fail-closed/no-fallback rules and robot-review requirements.
Trusted workspace and PR head fetching
.github/workflows/strix.yml
Adds workflow_dispatch inputs for manual PR scope; replaces tarball materialization with git init, shallow fetch, and detached checkout; updates PR-head fetching to handle both pull_request_target and dispatch modes.
Provider mode gating, LLM key file, and model input
.github/workflows/strix.yml
Sanitizes model string to set provider_mode (openai_direct vs vertex_ai); conditionally mask/require LLM API key only for openai_direct; accepts Vertex model strings and updates validation messages.
Prepare Vertex AI credentials & run env
.github/workflows/strix.yml
Write GCP SA JSON to a temp file, require project_id, export GOOGLE_APPLICATION_CREDENTIALS, VERTEXAI_PROJECT, VERTEXAI_LOCATION; set STRIX_LLM_DEFAULT_PROVIDER and pass Vertex credential/project/location vars into Run Strix step; rewire PR-scope envs to use dispatch inputs when applicable.
Gate script: PR metadata & changed-file handling
scripts/ci/strix_quick_gate.sh
Treat workflow_dispatch as PR-context only when PR metadata envs are present; compute changed-files using explicit base/head diff when metadata exists; preserve fail-closed behavior otherwise.
Gate script: Model detection and API key validation
scripts/ci/strix_quick_gate.sh
Hoist Vertex/Gemini detection earlier; require trusted non-empty API key file for non-Vertex models; allow Vertex runs without LLM_API_KEY; trim resolved key file contents when provided.
Gate script: Child process env, credential forwarding & target handling
scripts/ci/strix_quick_gate.sh
Set STRIX_CHILD_LLM_API_KEY empty for Vertex attempts and to parent key for non-Vertex; inject LLM_API_KEY into child only when present; expand forwarded allowlist to include Vertex/GCP auth/location variables; canonicalize target dir and run Strix with cwd + -t ..
Gate script: Timeout, retry, and fallback handling
scripts/ci/strix_quick_gate.sh
Make timeouts ineligible for same-model transient retry (force fallback evaluation); return failure when no fallback models were attempted and fallback configuration is invalid/duplicate.
Test hardening and model guard (implicit in changes)
scripts/ci/test_strix_quick_gate.sh
(See test changes in PR) Expand self-test assertions for Vertex mode, add Vertex-specific tests (no-API-key, non-forwarding), extend allowlist for approved Vertex model, and adjust timeout/fallback scenario expectations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related issues

  • Seongho-Bae/llm-gateway-console#1053: Adjusts timeout/retry and provider/fallback handling that this PR also modifies.

Possibly related PRs

  • Seongho-Bae/naruon#248: Overlaps on Strix quick gate script and model rejection hardening; related gate logic and tests.
  • Seongho-Bae/naruon#238: Contrasting approach to provider/auth routing (OpenAI-direct vs Vertex-first) relevant to merge/conflict considerations.
  • Seongho-Bae/naruon#230: Prior changes to model/auth wiring in the workflow/gate scripts that this PR further evolves.

Poem

🐰 I’m a rabbit in CI’s glinting light,
Routing secrets, choosing right,
Vertex hums while OpenAI waits,
Timeouts bow to fallback gates—
Hooray, provider modes take flight!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(ci): route Strix through Vertex AI org secrets' accurately summarizes the main change: routing the Strix security scan through Vertex AI using organization secrets (GCP_SA_KEY and STRIX_LLM).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/strix-vertex-org-secrets-20260528

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for 45fbaf65403bb81d80bf42925240b4995d54b1a8:

  • Current-head CodeRabbit issue comment has blocking warning/failure evidence on 45fbaf6.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for 45fbaf65403bb81d80bf42925240b4995d54b1a8:

  • CodeRabbit issue comments could not be read: gh: HTTP 404.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for 45fbaf65403bb81d80bf42925240b4995d54b1a8:

  • CodeRabbit issue comments could not be read: gh: HTTP 404.

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for 738f8664156b4a7c1a98b1dd9b23da87f39da11d:

  • Current-head CodeRabbit review comment has blocking warning/failure evidence on 738f866.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Strix Vertex routing is implemented and locally verified on head fc1e19e.

Evidence:

  • bash scripts/ci/test_strix_quick_gate.sh passed locally.
  • YAML parse, bash -n, and git diff --check passed locally.
  • Branch workflow_dispatch run 26577393487 passed trusted workspace materialization and the workflow self-test, then failed closed at Gate Strix secrets because GCP_SA_KEY was not available to this public repo.

Root cause confirmed:

  • Seongho-Bae/naruon is PUBLIC.
  • org STRIX_LLM visibility is all.
  • org GCP_SA_KEY visibility is private, so Actions passes it as empty for this repo.

I did not reset GCP_SA_KEY because GitHub does not expose existing secret values. To complete this PR, re-set the organization secret with public/selected repo access, for example:

gh secret set GCP_SA_KEY --org Seongho-Bae --visibility all < gcp-sa-key.json
# or selected access if preferred:
gh secret set GCP_SA_KEY --org Seongho-Bae --repos naruon < gcp-sa-key.json

After that, rerun Strix on this PR. The workflow intentionally does not use GitHub Models or models: read.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/strix.yml:
- Around line 81-110: The workflow currently adds a Vertex/Gemini branch and
defaults STRIX_MODEL to a Vertex value; remove the entire
vertex_ai/gemini-3.1-pro-preview-customtools case block (including handling of
STRIX_VERTEX_CREDENTIALS, GCP_SA_KEY, trimmed_vertex_credentials, and the
'provider_mode=vertex_ai' / 'enabled' exports) and ensure STRIX_MODEL's default
is an OpenAI GPT-5.4+ identifier (e.g., remove
"vertex_ai/gemini-3.1-pro-preview-customtools" from STRIX_MODEL default),
leaving only the OpenAI branch that validates STRIX_OPENAI_API_KEY, writes
provider_mode=openai_direct, and requires a non-empty trimmed_openai_key; also
remove any other vertex/GCP-related envs or exports referenced elsewhere (e.g.,
STRIX_VERTEX_CREDENTIALS, GCP_SA_KEY) so the workflow enforces OpenAI-only
GPT-5.4+ usage.

In `@scripts/ci/strix_quick_gate.sh`:
- Around line 171-189: The checks use raw STRIX_LLM so models that normalize to
Vertex or a Vertex fallback still require an OpenAI key; call normalize_model on
STRIX_LLM (and on the fallback variable used in this script, e.g.
STRIX_LLM_FALLBACK or the script's fallback name) and use the normalized values
with is_vertex_model when deciding whether an API key is required; update the
conditional guards around LLM_API_KEY_FILE, the resolve_trusted_input_file call,
and the empty-key check to treat the LLM as Vertex if either the normalized
primary or normalized fallback is a Vertex model so Vertex-mode runs don’t
wrongly require an OpenAI key.
- Around line 1913-1914: The code unconditionally copies STRIX_CHILD_LLM_API_KEY
into child_env["LLM_API_KEY"], which leaks the global OpenAI key into Vertex
attempts; change the assignment so it only sets child_env["LLM_API_KEY"] for
non-Vertex providers — e.g. check the child run's provider indicator (use
whatever variable you already use to pick provider, such as
os.environ.get("STRIX_CHILD_PROVIDER") or child_env.get("PROVIDER")) and only
set child_env["LLM_API_KEY"] if that provider is not "vertex"
(case-insensitive); otherwise skip the assignment to preserve provider
isolation.

In `@scripts/ci/test_strix_quick_gate.sh`:
- Around line 76-96: The tests were changed to accept Vertex/Gemini and make
Vertex the default, which violates the repo policy; revert and enforce
OpenAI-only expectations by removing or replacing assertions that reference
provider_mode=vertex_ai, vertex_ai/gemini-3.1-pro-preview-customtools,
GCP_SA_KEY, and GOOGLE_APPLICATION_CREDENTIALS, and instead assert
provider_mode=openai_direct, STRIX_LLM_DEFAULT_PROVIDER selecting OpenAI, and
that STRIX_OPENAI_API_KEY is required (keep the exact assertion
'STRIX_OPENAI_API_KEY is required for Strix OpenAI Platform scans'); also ensure
tests assert no generic secrets.LLM_API_KEY exposure and that LLM_API_KEY_*
variables use secrets.STRIX_OPENAI_API_KEY as in the existing
'LLM_API_KEY_SECRET'/'LLM_API_KEY' assertions. Make these changes wherever
similar Vertex-related assertions appear (the other referenced blocks) so the
suite only blesses workflows that supply explicit STRIX_OPENAI_API_KEY + OpenAI
GPT-5.4-or-newer usage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 913a1039-1031-40d9-807b-582936ce41dc

📥 Commits

Reviewing files that changed from the base of the PR and between 29ea986 and fc1e19e.

📒 Files selected for processing (3)
  • .github/workflows/strix.yml
  • scripts/ci/strix_quick_gate.sh
  • scripts/ci/test_strix_quick_gate.sh

Comment thread .github/workflows/strix.yml Outdated
Comment thread scripts/ci/strix_quick_gate.sh Outdated
Comment thread scripts/ci/strix_quick_gate.sh
Comment thread scripts/ci/test_strix_quick_gate.sh
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

I addressed the provider-isolation findings that are valid for the current Vertex decision:

  • LLM_API_KEY_FILE startup checks now use normalized primary model provider detection.
  • Vertex attempts no longer receive LLM_API_KEY in the Strix child environment, even when an API key file exists.
  • Added regression coverage for Vertex runs with an API key file that must not be forwarded.

The OpenAI-only rollback suggestions are intentionally not applied because the current project instruction is to use organization secrets with vertex_ai/gemini-3.1-pro-preview-customtools and not GitHub Models.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

@seonghobae Thanks for the detailed summary of what was addressed. I'll kick off a fresh review of the latest changes now.


✏️ Learnings added
Learnt from: seonghobae
URL: https://github.com/Seongho-Bae/naruon/pull/288

Timestamp: 2026-05-28T14:06:29.774Z
Learning: In the Seongho-Bae/naruon repository, the Strix security scan CI workflow (`.github/workflows/strix.yml`) routes through Vertex AI using org-level `GCP_SA_KEY` and `STRIX_LLM` secrets. The project instruction is to use `vertex_ai/gemini-3.1-pro-preview-customtools` via organization secrets and NOT GitHub Models. OpenAI-only rollback suggestions should not be applied; they are intentionally declined.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Updated the Strix provider governance docs on the current head 0f636ef86ff36161770af275a736e792067d8830 so the review policy matches the current operator direction: no GitHub Models, org-secret STRIX_LLM=vertex_ai/gemini-3.1-pro-preview-customtools with GCP_SA_KEY, and direct OpenAI GPT-5.4+ only when explicitly selected with STRIX_OPENAI_API_KEY.

The provider-isolation finding was already fixed in 4a24fa0; the OpenAI-only rollback comments are superseded by the updated governance contract. Local evidence on this head:

  • bash scripts/ci/test_strix_quick_gate.sh
  • python3 YAML parse for .github/workflows/strix.yml
  • bash -n scripts/ci/strix_quick_gate.sh scripts/ci/test_strix_quick_gate.sh
  • git diff --check

Branch Strix evidence is running as workflow_dispatch run 26581416713 for the same head because the pull_request_target run still executes the protected base workflow until this PR lands.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

@seonghobae Thanks for the detailed update. Noted that:

  • The provider-isolation finding is confirmed fixed in 4a24fa0.
  • The governance contract is now explicit: Vertex AI (vertex_ai/gemini-3.1-pro-preview-customtools) via org secrets (GCP_SA_KEY), direct OpenAI GPT-5.4+ only when STRIX_OPENAI_API_KEY is explicitly set, and GitHub Models remain excluded.
  • All local verification checks passed on head 0f636ef86ff36161770af275a736e792067d8830.

Kicking off a fresh review of the latest changes now.


✏️ Learnings added
Learnt from: seonghobae
URL: https://github.com/Seongho-Bae/naruon/pull/288

Timestamp: 2026-05-28T14:36:01.842Z
Learning: In the Seongho-Bae/naruon repository, the Strix security scan CI workflow uses `STRIX_OPENAI_API_KEY` (not a generic `LLM_API_KEY`) for the direct OpenAI GPT-5.4+ path. The governance contract is: `vertex_ai/gemini-3.1-pro-preview-customtools` via org secrets (`GCP_SA_KEY` + `STRIX_LLM`), direct OpenAI only when `STRIX_OPENAI_API_KEY` is explicitly provided, and GitHub Models are intentionally excluded. Vertex AI attempts must never receive `LLM_API_KEY` in the child environment.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Actionable comments posted: 0

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Updated current head 270fdadfa7042b91cfe66bc866723899fc93309d after Strix evidence run 26581416713 proved two facts:

  • vertex_ai/gemini-3.1-pro-preview-customtools returns Vertex 404/no-access for this GCP project.
  • full-repo workflow_dispatch scans are too noisy for PR evidence and can timeout or report findings outside the PR change set.

Changes now added:

  • workflow_dispatch accepts PR number/base/head inputs and reuses trusted PR-scope scanning.
  • workflow_dispatch PR-scope evidence uses the same 1200s process timeout as pull_request_target.
  • STRIX_LLM org secret was updated to the validated Vertex model vertex_ai/gemini-2.5-flash with GCP_SA_KEY still org-visible.
  • Docs and self-tests record the unavailable-model anti-pattern so stale 3.1-only examples do not re-enter.

Local evidence passed again: bash scripts/ci/test_strix_quick_gate.sh, workflow YAML parse, bash -n, and git diff --check. New PR-scoped branch Strix evidence is running as workflow_dispatch run 26585920954 for this head.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

@seonghobae Thanks for the detailed update and evidence. Noted the key facts:

  • vertex_ai/gemini-3.1-pro-preview-customtools confirmed unavailable (404) for this GCP project — org secret STRIX_LLM updated to vertex_ai/gemini-2.5-flash.
  • workflow_dispatch now scopes to PR number/base/head inputs using the same 1200 s process timeout as pull_request_target, eliminating full-repo scan noise.
  • Docs and self-tests now guard against stale 3.1-only model examples re-entering.
  • All local verification checks passed on head 270fdadfa7042b91cfe66bc866723899fc93309d.

Kicking off a fresh review now.


✏️ Learnings added
Learnt from: seonghobae
URL: https://github.com/Seongho-Bae/naruon/pull/288

Timestamp: 2026-05-28T15:55:01.230Z
Learning: In the Seongho-Bae/naruon repository, the active Strix Vertex AI model changed from `vertex_ai/gemini-3.1-pro-preview-customtools` (confirmed 404/no-access for this GCP project) to `vertex_ai/gemini-2.5-flash` as of head 270fdadfa7042b91cfe66bc866723899fc93309d. The governance contract is: `STRIX_LLM=vertex_ai/gemini-2.5-flash` via org `GCP_SA_KEY`, direct OpenAI only when `STRIX_OPENAI_API_KEY` is explicitly provided, and GitHub Models are intentionally excluded. Vertex AI attempts must never receive `LLM_API_KEY` in the child environment. The `workflow_dispatch` trigger now accepts PR number/base/head inputs and reuses trusted PR-scope scanning with a 1200 s process timeout, matching `pull_request_target` behavior.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/strix.yml (1)

46-50: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Make manual PR-scope dispatch require and use pr_base_sha.

workflow_dispatch reruns currently materialize the trusted workspace from github.sha, and they switch into PR-scoped mode whenever pr_number is non-empty. That means a manual run can enter PR-scope with an empty PR_BASE_SHA, and it will execute the trusted scripts/config from the wrong base revision. scripts/ci/strix_quick_gate.sh only treats dispatch as PR-context when PR_NUMBER, PR_BASE_SHA, and PR_HEAD_SHA are all present, so the workflow should use that same three-field predicate and feed pr_base_sha into TRUSTED_WORKSPACE_SHA.

Suggested patch
       - name: Materialize trusted workspace
         env:
           GH_TOKEN: ${{ github.token }}
           REPOSITORY: ${{ github.repository }}
-          TRUSTED_WORKSPACE_SHA: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.sha }}
+          TRUSTED_WORKSPACE_SHA: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || (github.event.inputs.pr_number != '' && github.event.inputs.pr_base_sha || github.sha) }}
         run: |
           set -euo pipefail
@@
       - name: Fetch pull request head for trusted scan
-        if: github.event_name == 'pull_request_target' || github.event.inputs.pr_number != ''
+        if: github.event_name == 'pull_request_target' || (github.event.inputs.pr_number != '' && github.event.inputs.pr_base_sha != '' && github.event.inputs.pr_head_sha != '')
         env:
           PR_NUMBER: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || github.event.inputs.pr_number }}
+          PR_BASE_SHA: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.base.sha || github.event.inputs.pr_base_sha }}
           PR_HEAD_SHA: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.event.inputs.pr_head_sha }}
         run: |
-          if [ -z "$PR_NUMBER" ] || [ -z "$PR_HEAD_SHA" ]; then
-            echo "::error::PR number and head SHA are required for trusted PR-scope Strix evidence."
+          if [ -z "$PR_NUMBER" ] || [ -z "$PR_BASE_SHA" ] || [ -z "$PR_HEAD_SHA" ]; then
+            echo "::error::PR number, base SHA, and head SHA are required for trusted PR-scope Strix evidence."
             exit 1
           fi
@@
-          STRIX_PROCESS_TIMEOUT_SECONDS: ${{ (github.event_name == 'pull_request_target' || github.event.inputs.pr_number != '') && '1200' || '2400' }}
+          STRIX_PROCESS_TIMEOUT_SECONDS: ${{ (github.event_name == 'pull_request_target' || (github.event.inputs.pr_number != '' && github.event.inputs.pr_base_sha != '' && github.event.inputs.pr_head_sha != '')) && '1200' || '2400' }}
@@
-          STRIX_DISABLE_PR_SCOPING: ${{ (github.event_name == 'pull_request_target' || github.event.inputs.pr_number != '') && '0' || '1' }}
-          GH_TOKEN: ${{ (github.event_name == 'pull_request_target' || github.event.inputs.pr_number != '') && github.token || '' }}
+          STRIX_DISABLE_PR_SCOPING: ${{ (github.event_name == 'pull_request_target' || (github.event.inputs.pr_number != '' && github.event.inputs.pr_base_sha != '' && github.event.inputs.pr_head_sha != '')) && '0' || '1' }}
+          GH_TOKEN: ${{ (github.event_name == 'pull_request_target' || (github.event.inputs.pr_number != '' && github.event.inputs.pr_base_sha != '' && github.event.inputs.pr_head_sha != '')) && github.token || '' }}

Also applies to: 67-75, 247-255

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/strix.yml around lines 46 - 50, The TRUSTED_WORKSPACE_SHA
assignment currently falls back to github.sha for manual dispatches even when
PR-scoped inputs exist; update the env assignment for TRUSTED_WORKSPACE_SHA to
use the PR base SHA only when the workflow is running in PR scope and all three
PR inputs are present (PR_NUMBER, PR_BASE_SHA, PR_HEAD_SHA) — i.e. change the
conditional that sets TRUSTED_WORKSPACE_SHA to require github.event_name ==
'pull_request_target' (or presence of PR_NUMBER) AND non-empty PR_BASE_SHA and
PR_HEAD_SHA, otherwise use github.sha; apply the same fix to the other
occurrences of TRUSTED_WORKSPACE_SHA in the workflow (the blocks around the
other two ranges) and ensure the variables PR_NUMBER, PR_BASE_SHA, PR_HEAD_SHA
are referenced consistently and match scripts/ci/strix_quick_gate.sh
expectations.
🧹 Nitpick comments (1)
scripts/ci/test_strix_quick_gate.sh (1)

71-73: ⚡ Quick win

Also pin the manual SHA inputs in this self-test.

This only locks down pr_number plus the error string, so a workflow regression that drops or renames base_sha/head_sha would still pass. Add assertions for both input keys and their github.event.inputs.* reads.

🔍 Suggested hardening
 	assert_file_contains "$workflow_file" "pr_number:" "strix workflow accepts manual PR-scope evidence inputs"
+	assert_file_contains "$workflow_file" "base_sha:" "strix workflow accepts manual PR base SHA input"
+	assert_file_contains "$workflow_file" "head_sha:" "strix workflow accepts manual PR head SHA input"
 	assert_file_contains "$workflow_file" "github.event.inputs.pr_number" "strix workflow can run PR-scoped workflow_dispatch evidence"
+	assert_file_contains "$workflow_file" "github.event.inputs.base_sha" "strix workflow reads manual PR base SHA input"
+	assert_file_contains "$workflow_file" "github.event.inputs.head_sha" "strix workflow reads manual PR head SHA input"
 	assert_file_contains "$workflow_file" "PR number and head SHA are required for trusted PR-scope Strix evidence" "strix workflow fails closed when manual PR-scope metadata is incomplete"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci/test_strix_quick_gate.sh` around lines 71 - 73, Add assertions to
pin the manual SHA inputs in the self-test by extending the existing
assert_file_contains checks that use $workflow_file and assert_file_contains;
specifically add assertions for the input keys "base_sha" and "head_sha" and
their runtime reads "github.event.inputs.base_sha" and
"github.event.inputs.head_sha" (mirroring the existing checks for "pr_number"
and "github.event.inputs.pr_number") so a regression that drops/renames those
inputs will fail the test.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ci/test_strix_quick_gate.sh`:
- Around line 122-123: Remove the obsolete preview model string
"vertex_ai/gemini-3.1-pro-preview-customtools" from the allow-list in
scripts/ci/test_strix_quick_gate.sh and also delete the corresponding positive
case that checks for that exact model elsewhere in the script; ensure the guard
now only accepts "vertex_ai/gemini-2.5-flash" (and any existing approved
entries) so the Strix Security Scan uses STRIX_LLM with GCP_SA_KEY and the
supported Vertex model.

---

Outside diff comments:
In @.github/workflows/strix.yml:
- Around line 46-50: The TRUSTED_WORKSPACE_SHA assignment currently falls back
to github.sha for manual dispatches even when PR-scoped inputs exist; update the
env assignment for TRUSTED_WORKSPACE_SHA to use the PR base SHA only when the
workflow is running in PR scope and all three PR inputs are present (PR_NUMBER,
PR_BASE_SHA, PR_HEAD_SHA) — i.e. change the conditional that sets
TRUSTED_WORKSPACE_SHA to require github.event_name == 'pull_request_target' (or
presence of PR_NUMBER) AND non-empty PR_BASE_SHA and PR_HEAD_SHA, otherwise use
github.sha; apply the same fix to the other occurrences of TRUSTED_WORKSPACE_SHA
in the workflow (the blocks around the other two ranges) and ensure the
variables PR_NUMBER, PR_BASE_SHA, PR_HEAD_SHA are referenced consistently and
match scripts/ci/strix_quick_gate.sh expectations.

---

Nitpick comments:
In `@scripts/ci/test_strix_quick_gate.sh`:
- Around line 71-73: Add assertions to pin the manual SHA inputs in the
self-test by extending the existing assert_file_contains checks that use
$workflow_file and assert_file_contains; specifically add assertions for the
input keys "base_sha" and "head_sha" and their runtime reads
"github.event.inputs.base_sha" and "github.event.inputs.head_sha" (mirroring the
existing checks for "pr_number" and "github.event.inputs.pr_number") so a
regression that drops/renames those inputs will fail the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 67a0cd37-b1d1-4aed-a75c-7e4deb39e799

📥 Commits

Reviewing files that changed from the base of the PR and between 0f636ef and 270fdad.

📒 Files selected for processing (10)
  • .github/workflows/strix.yml
  • AGENTS.md
  • README.md
  • docs/plans/2026-05-19-north-star-gap-closure.md
  • docs/plans/2026-05-27-caldav-writeback-source-registry.md
  • docs/plans/2026-05-27-self-sent-webdav-materialization-intent.md
  • docs/plans/2026-05-27-strix-openai-direct-only.md
  • docs/plans/2026-05-27-webdav-opaque-source-id.md
  • scripts/ci/strix_quick_gate.sh
  • scripts/ci/test_strix_quick_gate.sh
✅ Files skipped from review due to trivial changes (4)
  • docs/plans/2026-05-27-webdav-opaque-source-id.md
  • docs/plans/2026-05-27-caldav-writeback-source-registry.md
  • docs/plans/2026-05-27-self-sent-webdav-materialization-intent.md
  • docs/plans/2026-05-19-north-star-gap-closure.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/ci/strix_quick_gate.sh

Comment thread scripts/ci/test_strix_quick_gate.sh Outdated
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Current head: 05022ff

I addressed the latest robot review items:

  • Vertex child test fakes now assert both LLM_API_KEY and LLM_API_KEY_FILE are not forwarded.
  • The unavailable vertex_ai/gemini-3.1-pro-preview-customtools model was removed from the Strix workflow allow-list and guard tests; vertex_ai/gemini-2.5-flash remains the validated org-secret Vertex model.
  • STRIX_LLM_FILE content is now read into an intermediate variable before trimming, with a regression case proving literal $() content does not execute.

Local evidence:

  • bash -n scripts/ci/strix_quick_gate.sh scripts/ci/test_strix_quick_gate.sh
  • python3 YAML parse for .github/workflows/strix.yml
  • bash scripts/ci/test_strix_quick_gate.sh -> PASS
  • git diff --check -> PASS

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

@seonghobae Thanks for the detailed update. Noted the following for head 05022ff8a27373388c5963d6123f2b8453f77ee7:

  • Vertex child isolation hardened: test fakes now assert both LLM_API_KEY and LLM_API_KEY_FILE are absent from the child environment.
  • Allow-list cleaned up: vertex_ai/gemini-3.1-pro-preview-customtools fully removed from the workflow allow-list and guard tests; vertex_ai/gemini-2.5-flash is the sole validated org-secret Vertex model going forward.
  • Command-injection guard: STRIX_LLM_FILE content read into an intermediate variable before trimming, with a regression case confirming literal $() content does not execute.
  • All local verification checks (bash -n, YAML parse, test suite, git diff --check) passed.

Kicking off a fresh review now.


✏️ Learnings added
Learnt from: seonghobae
URL: https://github.com/Seongho-Bae/naruon/pull/288

Timestamp: 2026-05-28T17:09:29.322Z
Learning: In the Seongho-Bae/naruon repository, `vertex_ai/gemini-3.1-pro-preview-customtools` has been fully removed from the Strix workflow allow-list and guard tests as of head 05022ff8a27373388c5963d6123f2b8453f77ee7. The only validated org-secret Vertex AI model is `vertex_ai/gemini-2.5-flash`. Vertex child environments must never receive `LLM_API_KEY` or `LLM_API_KEY_FILE`. `STRIX_LLM_FILE` content must be read into an intermediate variable before trimming to prevent command injection.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Full review triggered.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Comments resolved and changes approved.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ci/test_strix_quick_gate.sh`:
- Around line 3740-3743: The current checks use -n which only fails when
variables are empty; change them to assert the variables are not present in the
environment at all by testing for their existence (e.g. via printenv/env lookup)
instead of non-emptiness. Replace the `[ -n "${LLM_API_KEY_FILE:-}" ]` and
analogous `LLM_API_KEY` checks with existence checks that fail if the variable
is exported at all (for the symbols LLM_API_KEY_FILE and LLM_API_KEY in the
script), and keep the same error message and exit behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 993f44dc-fc92-49b1-b028-6b5e2b3238fb

📥 Commits

Reviewing files that changed from the base of the PR and between b843ab5 and f6d8fdc.

📒 Files selected for processing (3)
  • .github/workflows/strix.yml
  • scripts/ci/strix_quick_gate.sh
  • scripts/ci/test_strix_quick_gate.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/strix.yml
  • scripts/ci/strix_quick_gate.sh

Comment thread scripts/ci/test_strix_quick_gate.sh Outdated
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Comments resolved and changes approved.

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.

1 participant