๐ก๏ธ Sentinel: [security improvement] GitHub ํ ํฐ ๋ง์คํน ๋ฒ์ ํ์ฅ - #89
Conversation
์ด์ ์ `ghp_` ๋ฐ `github_pat_` ์ธ์๋ `gho_`, `ghu_`, `ghs_`, `ghr_` ํ ํฐ์ ์์ ํ๊ฒ ๋ง์คํนํ๋๋ก ์ ๊ทํํ์์ ์์ ํ์ต๋๋ค. - `scripts/ci/pr_review_merge_scheduler.py` ์ ๊ทํํ์ ์์ - `tests/test_pr_review_merge_scheduler.py` ์ ๊ท ํ ํฐ ์ผ์ด์ค ์ถ๊ฐ - ํ ์คํธ ์ปค๋ฒ๋ฆฌ์ง 100% ์๋ฃ - Sentinel ๋ณด์ ์ ๋ ์์ฑ ์๋ฃ
|
๐ 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
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_datatoken-matching regex to covergho_,ghu_,ghs_, andghr_prefixes (in addition toghp_andgithub_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.
OpenCode Review Overview
Pull request overviewOpenCode reviewed the current-head bounded evidence and found no blocking issues. FindingsNo blocking findings. SummaryApproved: 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.
Change Flow DAGflowchart 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"]
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"]
# Conflicts: # .jules/sentinel.md # scripts/ci/pr_review_merge_scheduler.py
There was a problem hiding this comment.
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"]
Summary
ghr_runner tokens.main; the scrubber implementation itself is already present onmainafter earlier token-scrubbing fixes.gh[pousr]_/github_pat_masking contract.Verification
bash -n scripts/ci/*.shgit diff --checkpy -3 -m pytest tests/test_pr_review_merge_scheduler.py -qpy -3 scripts/ci/pr_review_merge_scheduler.py --self-testbash scripts/ci/test_strix_quick_gate.sh