Skip to content

fix(ci): isolate performance candidate trust - #127160

Merged
vincentkoc merged 1 commit into
mainfrom
security/performance-candidate-trust
Aug 21, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
security/performance-candidate-trust

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Resolves a problem where manually selected OpenClaw performance targets could run through candidate-owned setup code with repository cache access, while live OpenAI credentials and report-publishing credentials were not tied to the exact trusted workflow revision.

Related alerts:

Why This Change Was Made

The performance workflow now classifies the resolved candidate once and carries typed secret_eligible and cache_write_allowed facts to every consumer. Only the canonical default-branch workflow revision is eligible for live credentials, cache restore, or app-token publication; arbitrary refs remain mock-only and cache-off.

Workflow-owned helpers and local actions are checked out from the exact github.workflow_sha into a separate harness before candidate code runs. Publisher artifact validation still completes before any app token is created, and the existing report paths, latest pointers, and tested-SHA identity are unchanged.

Architectural owner: .github/workflows/openclaw-performance.yml.

Removed unsafe paths:

  • candidate-owned setup-node-env execution
  • cache restoration for arbitrary performance refs
  • live OpenAI secret exposure for non-canonical targets
  • report app-token creation for non-canonical targets

Production LOC: +76 / -13, net +63. The positive delta implements the workflow trust boundary, explicit credential/cache authority, and trusted nested-action staging in both benchmark jobs; tests are +203 / -9.

User Impact

No product UI change. Maintainers can still benchmark arbitrary refs and receive the same artifacts, source summaries, comparison SHA, and report layout, but those candidate runs are secretless, mock-only, non-publishing, and unable to consume repository caches. Canonical scheduled and default-branch manual runs retain live and publication behavior.

Maintainer Decision

Accept the exact-head boundary. GitHub documents github.workflow_sha as "the commit SHA for the workflow file"; scheduled workflows run only on the default branch at its latest commit, and workflow_dispatch exposes the branch or tag that received the dispatch. The gate additionally requires GITHUB_REF to be the repository default branch and the resolved candidate SHA to equal github.workflow_sha, so an arbitrary target_ref cannot acquire cache, credential, or publication authority.

Contract references:

Evidence

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 21, 2026
@vincentkoc
vincentkoc requested review from a team August 21, 2026 11:08
@vincentkoc vincentkoc self-assigned this Aug 21, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 21, 2026 11:08
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 10:50 AM ET / 14:50 UTC.

ClawSweeper review

What this changes

The PR gates performance-run credentials, caches, trusted helper code, and report publication on the resolved target matching the default-branch workflow revision.

Merge readiness

⚠️ Ready for maintainer review - 5 items remain

Keep open for maintainer review. The patch cleanly centralizes candidate trust and removes candidate-owned helper execution, but its security boundary depends on the exact GitHub Actions semantics of github.workflow_sha, which could not be independently verified in this environment.

Priority: P1
Reviewed head: 100d9974cd49fb96d7b6f93fdb991cedbbb212f6
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and covers its source-level boundary, but merge confidence is limited by the unverified Actions context contract.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored CI hardening change has focused workflow tests and exact-head hosted checks; the external-contributor real-setup proof gate does not apply.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored CI hardening change has focused workflow tests and exact-head hosted checks; the external-contributor real-setup proof gate does not apply.
Evidence reviewed 6 items Current main exposure: Current main checks out the requested target and then executes its workspace-local setup action with cache restore enabled, so an arbitrary target can supply that action graph.
Privileged boundary in the patch: The patch defaults both authority facts to false and requires the default branch plus equality between the resolved candidate and workflow SHA before enabling them.
Trusted helper staging: Both benchmark and source-probe jobs check out helpers at the workflow SHA, replace the candidate nested cache action, and invoke the staged setup action.
Findings None None.
Security Needs attention Verify the workflow revision context: Credential, cache, and publication authority now depend on github.workflow_sha; merge requires confidence that this context identifies the intended trusted workflow revision for both trigger modes.

How this fits together

The performance workflow resolves a requested benchmark revision, prepares its runtime, and optionally uses credentials or publishes reports. The new trust decision is propagated to benchmark, source-probe, and publishing jobs.

flowchart LR
  A[Performance trigger] --> B[Resolve benchmark target]
  B --> C[Classify candidate trust]
  C --> D[Stage trusted workflow helpers]
  C --> E[Run benchmark jobs]
  C --> F[Gate cache and credentials]
  F --> G[Publish reports]
  E --> G
Loading

Decision needed

Question Recommendation
Is the focused source/CI evidence sufficient for this GitHub Actions trust boundary, or should merge wait for direct confirmation of github.workflow_sha semantics in the approved workflow environment? Require context-contract confirmation: Confirm the documented or approved runtime behavior of github.workflow_sha before merging the credential-bound gate.

Why: The resulting credential and publication gate is security-sensitive, while the authoritative GitHub Actions context contract could not be inspected from this review environment.

Before merge

  • Resolve security concern: Verify the workflow revision context - Credential, cache, and publication authority now depend on github.workflow_sha; merge requires confidence that this context identifies the intended trusted workflow revision for both trigger modes.
  • Resolve merge risk (P1) - The privileged decision relies on the exact GitHub Actions contract for github.workflow_sha; direct upstream contract inspection was unavailable.
  • Resolve merge risk (P1) - The workflow grows by 63 net production lines, justified by the new explicit trust boundary and trusted nested-action staging rather than a downstream guard.
  • Complete next step (P2) - A maintainer needs to resolve the remaining GitHub Actions contract-proof question before merge.

Findings

  • [medium] Verify the workflow revision context — .github/workflows/openclaw-performance.yml:187
Agent review details

Security

Needs attention: The patch narrows the security boundary, but the external Actions context contract that underpins the new gate remains unverified.

PR surface

Tests +194, Config +63. Total +257 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 203 9 +194
Docs 0 0 0 0
Config 1 76 13 +63
Generated 0 0 0 0
Other 0 0 0 0
Total 2 279 22 +257

Review metrics

Metric Value Why it matters
Production and test delta workflow +63 net, tests +194 net The production growth implements the trust boundary and trusted helper staging; the tests cover classification and replacement of candidate-owned nested actions.

Merge-risk options

Maintainer options:

  1. Confirm the workflow context contract (recommended)
    Verify that the chosen GitHub Actions context has the assumed immutable workflow-revision semantics before it gates cache, secret, and publication authority.
  2. Accept the tested boundary
    Maintainership may accept the exact-head test and CI evidence if it already has authoritative confirmation of that context contract.

Technical review

Best possible solution:

Retain one canonical trust decision, after confirming that github.workflow_sha identifies the intended immutable default-branch workflow revision for scheduled and manual runs.

Do we have a high-confidence way to reproduce the issue?

No live GitHub Actions reproduction was established; source tests directly execute trusted and noncanonical classifier inputs and the nested-action replacement path.

Is this the best way to solve the issue?

Likely yes: a single producer-owned trust fact propagated to every privileged consumer is preferable to separate downstream checks, pending confirmation of the Actions context contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 03d4b8a9c331.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.

Label justifications:

  • P1: The workflow controls live provider credentials and report-publishing authority for performance runs.
  • merge-risk: 🚨 automation: The patch changes CI job gates, helper checkout sources, and cache behavior.
  • merge-risk: 🚨 security-boundary: The new trust fact determines when live credentials and an app token may be exposed.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored CI hardening change has focused workflow tests and exact-head hosted checks; the external-contributor real-setup proof gate does not apply.

Evidence

Security concerns:

  • [medium] Verify the workflow revision context — .github/workflows/openclaw-performance.yml:187
    Credential, cache, and publication authority now depend on github.workflow_sha; merge requires confidence that this context identifies the intended trusted workflow revision for both trigger modes.
    Confidence: 0.84

What I checked:

Likely related people:

  • Vincent Koc: Authored the current PR and the merged cache-authority work that recently changed this workflow surface. (role: recent workflow contributor; confidence: high; commits: 100d9974cd49, 225aa5a17823; files: .github/workflows/openclaw-performance.yml, .github/actions/setup-node-env/action.yml, .github/actions/setup-pnpm-store-cache/action.yml)
  • Peter Steinberger: Recent history attributes prior performance-workflow maintenance to this contributor. (role: recent adjacent workflow contributor; confidence: medium; commits: c7b216edef00; files: .github/workflows/openclaw-performance.yml, test/scripts/openclaw-performance-workflow.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the github.workflow_sha contract for scheduled and manual default-branch dispatches.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-21T11:16:15.738Z sha d0bbce3 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T11:48:59.098Z sha d0bbce3 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-21T13:21:10.973Z sha 5d16daa :: found issues before merge. :: [P1] Keep nested setup actions in the trusted checkout
  • reviewed 2026-08-21T14:23:32.954Z sha 100d997 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the security/performance-candidate-trust branch from d0bbce3 to 133f52d Compare August 21, 2026 13:07
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc
vincentkoc force-pushed the security/performance-candidate-trust branch from 133f52d to 5d16daa Compare August 21, 2026 13:13
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 21, 2026
@vincentkoc
vincentkoc force-pushed the security/performance-candidate-trust branch from 5d16daa to 100d997 Compare August 21, 2026 14:16
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. label Aug 21, 2026
@clawsweeper clawsweeper Bot removed the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label Aug 21, 2026
@vincentkoc
vincentkoc merged commit 7833e24 into main Aug 21, 2026
166 of 168 checks passed
@vincentkoc
vincentkoc deleted the security/performance-candidate-trust branch August 21, 2026 14:55
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant