Skip to content

feat(security): add Endor evidence to plugin ClawScan profiles - #3896

Merged
jesse-merhi merged 23 commits into
mainfrom
codex/endor-plugin-scan-main-20261001
Oct 13, 2026
Merged

jesse-merhi merged 23 commits into
mainfrom
codex/endor-plugin-scan-main-20261001

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Plugin scans now run Endor's reachable-function analysis alongside bundled SkillSpector, then supply both results and static evidence to one ClawScan judge through a ClawHub-owned custom profile. Publication queues background work. Reachable dependency vulnerabilities are advisory; the existing AI verdict still controls quarantine.

  • Save a bounded Endor summary on the exact release and expose it in the audit page, version/security APIs and report download. Older results and workers that omit optional scanners remain supported.
  • Isolate dependency resolution in a separately credentialed, read-only Docker container, block private/special-use destinations, suppress dependency scripts and drop privileges before analysis.
  • Retain redacted last-phase diagnostics on timeouts. Unconfirmed container cleanup fails that job, suppresses its judge, stops further claims and preserves its workspace; already-leased jobs drain.
  • Add a local tarball runner using the same profile without backend/moderation writes.
  • Provide an exact-revision, 1–3-job Test path on this branch for Patrick. Hosted production Endor defaults off. The existing staging relay remains until its separate cleanup.

Review and validation

One simplification pass removed 56 net lines. Two independent reviews covered the full intended diff. The standards review reproduced a concurrent fatal-result/refill race; it is fixed and the caller regression fails before/passes after. Correctness probes verified legacy stored results, persistence, API/schema readers and downloaded ZIP contents.

  • Final locked CI: static, full unit coverage (7,700 passed; three skipped), type/build, packages, HTTP, OpenClaw contract and browser journeys passed. Secret scanning and CodeQL passed; the PR preview built successfully.
  • All three changed workflows pass installed actionlint. Fixed GitHub's rejected worker guard by adding its missing closing parenthesis. Three inherited Markdown files received formatting-only corrections for main's native formatter; no instruction permissions or dependency versions changed.
  • Changed pool/shell scopes: 51 tests passed, plus a fault probe proving an in-flight transient claim cannot restart claims after fatal settlement.
  • Reused applicable worker/scanner/redaction, four backend runtime and two UI test results; fresh native timeout and local CLI probes retained redacted diagnostics and confirmed owned-container removal.
  • Package source/artifact checks: 615 passed; schema build and both package type/build checks passed. npm uses a command-scoped local cache because the sandbox cannot write the global cache.
  • Local full-unit execution was interrupted and local app type/build was blocked by the older installed dependency tree. The final locked CI above supplies the complete proof; no dependency or lockfile changes were made to hide those local limitations.

The full intended diff against main is 52 files, 4,063 lines added / 611 removed, including generated schemas, tests and scanner isolation fixtures.

The earlier real trial completed 94 official and 13 additional community full profiles. It found 14 reachable dependency findings, separate from AI moderation. That trial predates the latest lifecycle repairs. The large Google OAuth artifact resolved 622 dependencies before a bounded diagnostic timeout; this is not completed reachability proof.

Test rollout remaining

No exact-head hosted Test scan or production enablement has occurred. GitHub's Test environment must first allow codex/endor-plugin-scan-main-20261001. Patrick can then deploy reviewed head 62479122ef178d82c464d6e60b214fade1401fda and run three explicitly assigned Test plugin jobs: Discord, Codex and Google OAuth. Pause Test's automatic scan dispatch while preparing/running that bounded batch, then restore its previous setting. Require completed Endor and judge results from that exact workflow, saved audit/download evidence, and a successful large-plugin Linux run before enabling production. Access to the configured openclaw-nfr.clawhub namespace must be proved there; local corpus scans used openclaw-nfr. Production Endor remains disabled throughout this Test trial.

@Patrick-Erichsen
Patrick-Erichsen requested a review from a team as a code owner October 2, 2026 01:02
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vercel

vercel Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clawhub Ready Ready Preview Oct 13, 2026 4:15am UTC

Request Review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed October 1, 2026, 11:30 PM ET / October 2, 2026, 03:30 UTC (Revision 2).

ClawSweeper review

What this changes

Adds Endor dependency-reachability evidence to plugin security reviews, saved reports, and audit pages, with isolated scanner containers and guarded Test dispatch.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep open: both previously reported P2 defects remain, and the new container authority boundary still lacks final-effect proof. Current main does not implement the Endor integration.

Priority: P2
Reviewed head: bc8780a21a757de9161cea7c0417f0c085b94cd2

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful integration and compatibility coverage remain limited by two unresolved defects and missing proof for the changed security boundary.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Authority-chain proof required: supplied evidence does not exercise the new credential-bearing container through allowed dependency resolution and rejected script, credential, and private-address I/O after privilege drop; rule/UID checks and earlier scanner runs do not establish those final effects. Existing-state compatibility is source-verified through optional fields, unchanged LLM shape, preservation logic, and focused compatibility coverage. Attach redacted terminal traces, logs, or diagnostic recordings; redact keys, private endpoints, and other private data, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Authority-chain proof required: supplied evidence does not exercise the new credential-bearing container through allowed dependency resolution and rejected script, credential, and private-address I/O after privilege drop; rule/UID checks and earlier scanner runs do not establish those final effects. Existing-state compatibility is source-verified through optional fields, unchanged LLM shape, preservation logic, and focused compatibility coverage. Attach redacted terminal traces, logs, or diagnostic recordings; redact keys, private endpoints, and other private data, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.
Evidence reviewed 11 items Pinned ownership and merge result: Reviewed merge-base 9333703 through original head bc8780a. The test merge records the exact fetched main followed by this head and preserves the unrelated main-only work.
Cleanup exhaustion remains nonfatal: The late-create polling loop falls through without throwing. Its caller subsequently rethrows the ordinary create timeout, which processJob converts into supplemental failed analysis before judging and deleting the workspace.
Test admission differs from actual claims: Test admission checks target kind and plugin family, whereas assigned claims require queued, ready, ungated bulk-rescan jobs. The workflow has no post-worker assertion that each assigned job completed in this run.
Findings 2 actionable findings [P2] Fail closed when late-create cleanup polling expires
[P2] Reject unclaimable Test assignments and verify their completion
Security Needs attention Unconfirmed cleanup bypasses the fatal isolation path: Polling exhaustion can leave a daemon-owned container with credentials and a workspace mount while the worker proceeds to judging and workspace deletion; cleanup uncertainty must stop further processing.

How this fits together

ClawHub’s security workers consume queued plugin releases and combine scanner evidence into one moderation verdict. Stored results feed plugin audit pages, APIs, and downloadable reports.

flowchart LR
  A[Plugin release] --> B[Scan queue and lease]
  B --> C[Isolated Endor scanner]
  B --> D[Other scanner evidence]
  C --> E[Single security judge]
  D --> E
  E --> F[Atomic release completion]
  F --> G[Moderation and audit reports]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Authority-chain proof required: supplied evidence does not exercise the new credential-bearing container through allowed dependency resolution and rejected script, credential, and private-address I/O after privilege drop; rule/UID checks and earlier scanner runs do not establish those final effects. Existing-state compatibility is source-verified through optional fields, unchanged LLM shape, preservation logic, and focused compatibility coverage. Attach redacted terminal traces, logs, or diagnostic recordings; redact keys, private endpoints, and other private data, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.
  • Fail closed when late-create cleanup polling expires (P2) - If Docker create times out and the daemon does not expose the container within the cleanup window, this loop returns normally without confirming removal. The caller then throws the ordinary create timeout, which processJob treats as supplemental Endor failure: it runs the judge, removes the mounted workspace, and permits further claims. Throw on polling exhaustion so the existing fatal-cleanup path preserves the workspace and stops the worker. This prior finding remains unresolved.
  • Reject unclaimable Test assignments and verify their completion (P2) - A publication job, already-completed job, delayed retry, or rollout-gated plugin job passes this check, but assigned claims only accept ready, ungated, queued bulk-rescan jobs. The worker can therefore claim zero jobs and exit successfully; the workflow also never verifies that accepted jobs produced Endor and judge results in this run. Match admission to the claim predicate and assert stored completion, run identity, and cleared leases afterward. This prior finding remains unresolved.
  • Resolve security concern: Unconfirmed cleanup bypasses the fatal isolation path - Polling exhaustion can leave a daemon-owned container with credentials and a workspace mount while the worker proceeds to judging and workspace deletion; cleanup uncertainty must stop further processing.
  • Resolve merge risk (P1) - The credential-bearing container’s isolation remains unproven at final I/O: available evidence does not demonstrate successful allowed dependency resolution alongside rejection of malicious scripts, credential disclosure, and private-address access after privilege drop.
  • Complete next step (P2) - Repair the two retained findings and provide final-effect evidence for the container authority boundary before merge.

Findings

  • [P2] Fail closed when late-create cleanup polling expires — scripts/security/run-endor-plugin-scan.ts:253-257
  • [P2] Reject unclaimable Test assignments and verify their completion — .github/workflows/security-scan-codex.yml:156-158
  • [medium] Unconfirmed cleanup bypasses the fatal isolation path — scripts/security/run-endor-plugin-scan.ts:257
Agent review details

Security

Needs attention: Pinned image inputs and restricted environments are positive safeguards, but unconfirmed cleanup and unproven resolver isolation prevent clearance.

Review metrics

Metric Value Why it matters
Introduced scope +4307/-358 across 47 files The change spans scanner execution, workflows, stored results, public APIs, and audit presentation.
Production versus test growth production +1594/-325; tests and fixtures +2502/-32 Excluding generated files and specs, production growth is justified by the scanner integration and isolation machinery.

Root-cause cluster

Relationship: canonical
Canonical: #3896
Summary: This PR explicitly replaces the closed, unmerged Endor proposal; Staging retirement is separate adjacent work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Prove container isolation before rollout (recommended)
    Provide redacted final-effect traces through the production container entrypoint showing allowed resolution and rejection of credential leakage, dependency scripts, and blocked destinations.
  2. Pause the scanner rollout
    Keep this PR unmerged until the new container boundary can be exercised and its isolation claims verified.

Technical review

Best possible solution:

Keep the single-judge pipeline and additive result contract, with fatal unconfirmed cleanup, truthful Test acceptance, and demonstrated resolver isolation.

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

Yes, the two patch defects have clear source paths: exhaust late-create polling, or assign a publication/completed plugin job that the bulk worker cannot claim. Neither scenario was executed during this read-only review.

Is this the best way to solve the issue?

The single-judge integration is a reasonable approach using ClawScan’s existing custom-profile API, but the submitted implementation is not yet correct. A separate queue or competing verdict engine would add unnecessary policy drift.

Full review comments:

  • [P2] Fail closed when late-create cleanup polling expires — scripts/security/run-endor-plugin-scan.ts:253-257
    If Docker create times out and the daemon does not expose the container within the cleanup window, this loop returns normally without confirming removal. The caller then throws the ordinary create timeout, which processJob treats as supplemental Endor failure: it runs the judge, removes the mounted workspace, and permits further claims. Throw on polling exhaustion so the existing fatal-cleanup path preserves the workspace and stops the worker. This prior finding remains unresolved.
    Confidence: 0.99
  • [P2] Reject unclaimable Test assignments and verify their completion — .github/workflows/security-scan-codex.yml:156-158
    A publication job, already-completed job, delayed retry, or rollout-gated plugin job passes this check, but assigned claims only accept ready, ungated, queued bulk-rescan jobs. The worker can therefore claim zero jobs and exit successfully; the workflow also never verifies that accepted jobs produced Endor and judge results in this run. Match admission to the claim predicate and assert stored completion, run identity, and cleared leases afterward. This prior finding remains unresolved.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 01839ac5814a.

Labels

Label changes:

  • add P2: This is a bounded security-scanner improvement with unresolved correctness and validation blockers, without evidence of an active emergency.
  • add merge-risk: 🚨 security-boundary: The PR introduces credential-bearing dependency analysis with setup capabilities, and its final-effect isolation remains unverified.
  • add merge-risk: 🚨 automation: The new Test workflow can report success for assignments that were never claimable or completed.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: supplied evidence does not exercise the new credential-bearing container through allowed dependency resolution and rejected script, credential, and private-address I/O after privilege drop; rule/UID checks and earlier scanner runs do not establish those final effects. Existing-state compatibility is source-verified through optional fields, unchanged LLM shape, preservation logic, and focused compatibility coverage. Attach redacted terminal traces, logs, or diagnostic recordings; redact keys, private endpoints, and other private data, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded security-scanner improvement with unresolved correctness and validation blockers, without evidence of an active emergency.
  • merge-risk: 🚨 security-boundary: The PR introduces credential-bearing dependency analysis with setup capabilities, and its final-effect isolation remains unverified.
  • merge-risk: 🚨 automation: The new Test workflow can report success for assignments that were never claimable or completed.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: supplied evidence does not exercise the new credential-bearing container through allowed dependency resolution and rejected script, credential, and private-address I/O after privilege drop; rule/UID checks and earlier scanner runs do not establish those final effects. Existing-state compatibility is source-verified through optional fields, unchanged LLM shape, preservation logic, and focused compatibility coverage. Attach redacted terminal traces, logs, or diagnostic recordings; redact keys, private endpoints, and other private data, then update the PR body for automatic re-review or ask a maintainer to comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] Unconfirmed cleanup bypasses the fatal isolation path — scripts/security/run-endor-plugin-scan.ts:257
    Polling exhaustion can leave a daemon-owned container with credentials and a workspace mount while the worker proceeds to judging and workspace deletion; cleanup uncertainty must stop further processing.
    Confidence: 0.98

What I checked:

  • Pinned ownership and merge result: Reviewed merge-base 9333703 through original head bc8780a. The test merge records the exact fetched main followed by this head and preserves the unrelated main-only work. (b178f5b9a772)
  • Cleanup exhaustion remains nonfatal: The late-create polling loop falls through without throwing. Its caller subsequently rethrows the ordinary create timeout, which processJob converts into supplemental failed analysis before judging and deleting the workspace. (scripts/security/run-endor-plugin-scan.ts:253, bc8780a21a75)
  • Test admission differs from actual claims: Test admission checks target kind and plugin family, whereas assigned claims require queued, ready, ungated bulk-rescan jobs. The workflow has no post-worker assertion that each assigned job completed in this run. (.github/workflows/security-scan-codex.yml:156, bc8780a21a75)
  • Re-review continuity: The previous completed review inspected this exact head and reported the same two defects. Comparison against HEAD is empty; these are unresolved prior findings, not newly discovered late findings. (bc8780a21a75)
  • Authority boundary and proof coverage: The new container receives Endor credentials and setup capabilities before dropping privileges. Workflow checks inspect firewall rules and UID/write permissions; the supplied body explicitly reports no live Test deployment or plugin scan. The resolver fixture and mocked tests do not supply an observed run through the new final-I/O boundary. (scripts/security/run-endor-plugin-scan.ts:342, bc8780a21a75)
  • Existing-state compatibility: Endor storage is optional, the shared LLM validator preserves the previous shape, and completion only patches optional scanner results when supplied. Focused compatibility tests cover older workers omitting stored Endor and SkillSpector results, rejected stale leases, and bounded validation before writes; these tests were inspected, not executed. (convex/packageSecurityScan.runtime.test.ts:176, bc8780a21a75)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

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

  • Make late-create polling exhaustion fatal and cover skipped judging, stopped claims, and preserved workspace.
  • Reject unclaimable Test assignments and verify every accepted job completes in the current run.
  • Add final-effect container proof for allowed resolution and the nearest forbidden dependency behaviors, including credential isolation and private-address rejection.

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 (1 earlier review cycle)
  • reviewed 2026-10-02T01:07:24.409Z sha bc8780a :: needs real behavior proof before merge. :: [P2] Fail closed when late-create cleanup polling expires | [P2] Reject unclaimable Test assignments and verify their completion

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 2, 2026
@clawsweeper clawsweeper Bot added the status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. label Oct 2, 2026
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to inactivity.
Please update it or it will be closed.

@github-actions github-actions Bot added the stale label Oct 9, 2026

This branch was successfully deployed

1 active deployment
Preview – clawhub — 62479122 Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. stale status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants