Skip to content

๐Ÿ›ก๏ธ Sentinel: [security improvement] GitHub ํ† ํฐ ๋งˆ์Šคํ‚น ๋ฒ”์œ„ ํ™•์žฅ - #89

Merged
opencode-agent[bot] merged 5 commits into
mainfrom
fix-github-token-scrubbing-590919268799149969
Jun 30, 2026
Merged

๐Ÿ›ก๏ธ Sentinel: [security improvement] GitHub ํ† ํฐ ๋งˆ์Šคํ‚น ๋ฒ”์œ„ ํ™•์žฅ#89
opencode-agent[bot] merged 5 commits into
mainfrom
fix-github-token-scrubbing-590919268799149969

Conversation

@seonghobae

@seonghobae seonghobae commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Preserve the expanded GitHub token prefix regression coverage, including ghr_ runner tokens.
  • Resolve the branch against latest main; the scrubber implementation itself is already present on main after earlier token-scrubbing fixes.
  • Update the Sentinel note to document the full gh[pousr]_ / github_pat_ masking contract.

Verification

  • bash -n scripts/ci/*.sh
  • git diff --check
  • py -3 -m pytest tests/test_pr_review_merge_scheduler.py -q
  • py -3 scripts/ci/pr_review_merge_scheduler.py --self-test
  • bash scripts/ci/test_strix_quick_gate.sh

์ด์ „์˜ `ghp_` ๋ฐ `github_pat_` ์™ธ์—๋„ `gho_`, `ghu_`, `ghs_`, `ghr_` ํ† ํฐ์„ ์•ˆ์ „ํ•˜๊ฒŒ ๋งˆ์Šคํ‚นํ•˜๋„๋ก ์ •๊ทœํ‘œํ˜„์‹์„ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
- `scripts/ci/pr_review_merge_scheduler.py` ์ •๊ทœํ‘œํ˜„์‹ ์ˆ˜์ •
- `tests/test_pr_review_merge_scheduler.py` ์‹ ๊ทœ ํ† ํฐ ์ผ€์ด์Šค ์ถ”๊ฐ€
- ํ…Œ์ŠคํŠธ ์ปค๋ฒ„๋ฆฌ์ง€ 100% ์™„๋ฃŒ
- Sentinel ๋ณด์•ˆ ์ €๋„ ์ž‘์„ฑ ์™„๋ฃŒ
Copilot AI review requested due to automatic review settings June 26, 2026 21:23
@google-labs-jules

Copy link
Copy Markdown

๐Ÿ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a ๐Ÿ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens secret-scrubbing in the CI PR review/merge scheduler by expanding masking coverage from only classic PATs to additional valid GitHub token prefixes, reducing the risk of token leakage in logs and exception output.

Changes:

  • Expanded scrub_sensitive_data token-matching regex to cover gho_, ghu_, ghs_, and ghr_ prefixes (in addition to ghp_ and github_pat_).
  • Added unit tests validating scrubbing for the newly covered token prefixes.
  • Documented the learning/prevention note in .jules/sentinel.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
scripts/ci/pr_review_merge_scheduler.py Expands GitHub token masking regex in scrub_sensitive_data.
tests/test_pr_review_merge_scheduler.py Adds assertions to ensure additional GitHub token prefixes are scrubbed.
.jules/sentinel.md Records the security learning/prevention note for expanded token scrubbing.

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .jules/sentinel.md Outdated
@opencode-agent

opencode-agent Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: 57e0063e3332b5f377227b5cd2156843183dd5db
  • Workflow run: 28425130876
  • Workflow attempt: 1
  • Gate result: APPROVE (approval step)

Pull request overview

OpenCode reviewed the current-head bounded evidence and found no blocking issues.

Findings

No blocking findings.

Summary

Approved: Expanded GitHub token scrubbing coverage to include ghr_ runner tokens. Verification posture: Linter/static: N/A (no lint commands), TDD/regression: PASS (107 tests), Coverage: 100%, Docstring coverage: 100%, DAG: SecurityDoc[".jules/sentinel.md"] --> TokenScrubber["scrub_sensitive_data"] --> TestCoverage["test_scrub_sensitive_data_and_run_error"], PoC/execution: Verified ghr_ token scrubbing, DDD/domain: Security hardening, CDD/context: Follows existing pattern, Similar issues: #64, Standards search: GitHub token formats, Compatibility/convention: Consistent with existing scrubber, Breaking-change/backcompat: None, Performance: Unaffected, Developer experience: Clear documentation update, User experience: Reduced credential exposure risk, Accessibility/i18n: N/A, Supply-chain/license: N/A, Packaging: Python package contract complete

Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including .jules/sentinel.md, tests/test_pr_review_merge_scheduler.py.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence reports supported repository test suites passed.
Docstring coverage: coverage execution evidence reports configured repository docstring gates passed or docstring coverage was advisory.
DAG: Change Flow DAG maps .jules/sentinel.md through bounded evidence, review risk, and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, and current-head workflow evidence were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions and compatibility surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: changed files did not identify a user-facing UI surface; bounded evidence was reviewed for UX impact.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.

  • Result: APPROVE
  • Reason: Security improvement with full test coverage
  • Head SHA: 57e0063e3332b5f377227b5cd2156843183dd5db
  • Workflow run: 28425130876
  • Workflow attempt: 1

Change Flow DAG

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: sentinel.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: sentinel.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_pr_review_merge_scheduler.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_pr_review_merge_scheduler.py"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent opencode-agent 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.

Pull request overview

OpenCode reviewed the current-head evidence but found unresolved human review threads before approval.

Findings

1. HIGH .github/workflows/opencode-review.yml:1 - Unresolved human review thread blocks automated approval

  • Problem: OpenCode reached an APPROVE control result, but the approval step found unresolved, non-outdated human review thread evidence on the current pull request.
  • Root cause: Human review feedback can arrive after bounded model evidence is prepared, so the approval step must re-query GitHub immediately before publishing an approval.
  • Fix: Address or resolve the listed human review thread(s), then re-run OpenCode on the current head.
  • Regression test: Keep the approval gate querying reviewThreads(first: 100) after model output and before create_pull_review APPROVE.

Review thread evidence

Latest unresolved human review thread evidence

.jules/sentinel.md line 9

  • Latest human comment: @copilot-pull-request-reviewer at 2026-06-26T21:24:54Z

  • Comment URL: #89 (comment)

  • Comment excerpt: The new Sentinel entry is dated 2024-06-26, but this PRโ€™s context timestamp is 2026-06-26. If this file is meant to be a chronological log of learnings, the header date should reflect when this change was made to avoid confusing readers about when the mitigation was introduced.

  • Result: REQUEST_CHANGES

  • Reason: unresolved human review thread(s) were present before approval.

  • Head SHA: 3fadc1149b197ef0ed41ad1ac813b672db94d837

  • Workflow run: 28266066483

  • Workflow attempt: 1

opencode-agent[bot]
opencode-agent Bot previously approved these changes Jun 29, 2026

@opencode-agent opencode-agent 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.

Pull request overview

OpenCode model attempts did not emit a usable current-head control block, so the approval gate used deterministic current-head evidence instead of model prose.

Findings

No blocking findings.

Summary

  • Result: APPROVE
  • Reason: coverage-evidence passed, peer GitHub Checks completed without failures, mergeability was clean, and no unresolved human review threads remained.
  • Deterministic evidence: current-head changed-file evidence (.jules/sentinel.md, scripts/ci/pr_review_merge_scheduler.py, tests/test_pr_review_merge_scheduler.py); coverage-evidence result success; peer checks from statusCheckRollup excluding this OpenCode check.
  • Model outcomes: primary=failed, fallback=failed, second_fallback=failed, catalog_fallback=unknown.
  • Head SHA: 2201b7ed297e966c9038bddc583bc01471cccc50
  • Workflow run: 28367302261
  • Workflow attempt: 2

Deterministic fallback approval was used only after model-output instability and did not bypass coverage, failed-check, mergeability, or human-review gates.

Change Flow DAG

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: sentinel.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: sentinel.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["CI script: pr_review_merge_scheduler.py"]
  S2 --> I2["review and security gate shell path"]
  I2 --> R2["Review risk: CI script: pr_review_merge_scheduler.py"]
  R2 --> V2["bash -n plus Strix self-test"]
  Evidence --> S3["Test: test_pr_review_merge_scheduler.py"]
  S3 --> I3["regression suite"]
  I3 --> R3["Review risk: Test: test_pr_review_merge_scheduler.py"]
  R3 --> V3["targeted test run"]
Loading

@seonghobae
seonghobae enabled auto-merge (squash) June 29, 2026 21:31
@github-actions
github-actions Bot disabled auto-merge June 29, 2026 21:39
# Conflicts:
#	.jules/sentinel.md
#	scripts/ci/pr_review_merge_scheduler.py

@opencode-agent opencode-agent 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.

Pull request overview

OpenCode reviewed the current-head bounded evidence and found no blocking issues.

Findings

No blocking findings.

Summary

Approved: Expanded GitHub token scrubbing coverage to include ghr_ runner tokens. Verification posture: Linter/static: N/A (no lint commands), TDD/regression: PASS (107 tests), Coverage: 100%, Docstring coverage: 100%, DAG: SecurityDoc[".jules/sentinel.md"] --> TokenScrubber["scrub_sensitive_data"] --> TestCoverage["test_scrub_sensitive_data_and_run_error"], PoC/execution: Verified ghr_ token scrubbing, DDD/domain: Security hardening, CDD/context: Follows existing pattern, Similar issues: #64, Standards search: GitHub token formats, Compatibility/convention: Consistent with existing scrubber, Breaking-change/backcompat: None, Performance: Unaffected, Developer experience: Clear documentation update, User experience: Reduced credential exposure risk, Accessibility/i18n: N/A, Supply-chain/license: N/A, Packaging: Python package contract complete

Verification posture: CodeGraph evidence was initialized and bounded current-head evidence reviewed for changed-file evidence including .jules/sentinel.md, tests/test_pr_review_merge_scheduler.py.
Linter/static: workflow/static review evidence is bounded by the current-head GitHub Checks gate and changed-file evidence.
TDD/regression: coverage execution evidence and focused changed hunks were reviewed from bounded-review-evidence.md.
Coverage: coverage execution evidence reports supported repository test suites passed.
Docstring coverage: coverage execution evidence reports configured repository docstring gates passed or docstring coverage was advisory.
DAG: Change Flow DAG maps .jules/sentinel.md through bounded evidence, review risk, and required checks.
PoC/execution: coverage-evidence job executed on the current head and reported PASS.
DDD/domain: workflow and repository-governance invariants were reviewed against changed files in bounded evidence.
CDD/context: CodeGraph evidence, changed-file history, and focused hunks were reviewed from bounded-review-evidence.md.
Similar issues: changed-file history evidence was reviewed for comparable local precedents.
Claim/concept check: bounded evidence, repository source, and current-head workflow evidence were used for claims.
Standards search: standards and external-source checks are delegated to configured OpenCode web_search/Context7/DeepWiki sources when applicable; no evidence-backed standards blocker is present in bounded evidence.
Compatibility/convention: changed workflow/script conventions and compatibility surfaces were checked in bounded evidence.
Breaking-change/backcompat: deployment evidence and changed-file history were checked for backward-compatibility risk.
Performance: changed surfaces were checked for performance risk in bounded evidence.
Developer experience: changed automation, review, and maintenance surfaces were checked for helpful or obstructive DX impact in bounded evidence.
User experience: changed files did not identify a user-facing UI surface; bounded evidence was reviewed for UX impact.
Security/privacy: workflow-token, review-gate, and repository-automation security/privacy boundaries were checked in bounded evidence.

  • Result: APPROVE
  • Reason: Security improvement with full test coverage
  • Head SHA: 57e0063e3332b5f377227b5cd2156843183dd5db
  • Workflow run: 28425130876
  • Workflow attempt: 1

Change Flow DAG

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file: sentinel.md"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file: sentinel.md"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test: test_pr_review_merge_scheduler.py"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test: test_pr_review_merge_scheduler.py"]
  R2 --> V2["targeted test run"]
Loading

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