Skip to content

Run ClawScan security classification through Codex - #2290

Merged
steipete merged 1 commit into
mainfrom
security/codex-scan-worker
May 18, 2026
Merged

steipete merged 1 commit into
mainfrom
security/codex-scan-worker

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • route skill and package upload ClawScan classification through a queued GitHub Actions Codex worker
  • make VirusTotal telemetry-only: Codex sees it, but VT alone does not hide or block downloads, and VT waits are capped at 10 minutes
  • trust verified @openclaw/* plugin packages by default and align UI/API/download status with Codex/static/manual decisions

Tests

  • bunx convex codegen
  • bunx vitest run convex/securityScan.test.ts convex/clawScanNoteUpdates.test.ts convex/lib/moderationEngine.test.ts convex/lib/packageSecurity.test.ts convex/vt.test.ts src/components/artifacts/artifactStatus.test.ts src/routes/-dashboard.test.tsx
  • VITE_CONVEX_URL=https://example.invalid bun run coverage -- --reporter=dot
  • bunx tsc --noEmit --pretty false
  • bun run ci:static
  • /Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode local

Notes

  • Production needs SECURITY_SCAN_WORKER_TOKEN in Convex env and GitHub Production secrets, plus OPENAI_API_KEY in GitHub Production.
  • Live GitHub Actions worker was not exercised locally because it requires production secrets.

@steipete
steipete requested review from a team and Patrick-Erichsen as code owners May 18, 2026 00:29
@vercel

vercel Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
clawhub Ready Ready Preview, Comment May 18, 2026 0:29am

@clawsweeper

clawsweeper Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

Workflow note: Future ClawSweeper reviews update this same comment in place.

How this review workflow works
  • 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 maintainer comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors can comment @clawsweeper re-review or @clawsweeper re-run on their own 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.

Summary
Adds a scheduled/dispatch GitHub Actions Codex worker and Convex securityScan queue for skill/package ClawScan classification, makes VirusTotal telemetry-only, trusts verified @openclaw/* plugin packages by default, and updates API/UI status tests and specs.

Reproducibility: yes. Source inspection is enough for the PR defects: the workflow installs @openai/codex@latest in Production, and terminal failures are recorded only on the job row rather than the artifact scan result.

Real behavior proof
Needs real behavior proof before merge: Only tests/static checks are listed, and the PR body says the live GitHub Actions worker was not exercised; add redacted terminal/live-output proof from a real worker run and update the PR body for a fresh review.

Next step before merge
A maintainer/contributor needs to address the production toolchain and failure-state blockers and add real worker proof; automation cannot supply the author’s live setup evidence.

Security
Needs attention: Needs attention: the scheduled Production workflow installs a floating Codex CLI before running with production worker/OpenAI secrets.

Review findings

  • [P1] Pin the Codex CLI used by the Production worker — .github/workflows/security-scan-codex.yml:47
  • [P2] Record terminal scan failures on the artifact — convex/securityScan.ts:375-381
Review details

Best possible solution:

Land a pinned, reproducible production worker that records terminal scan failures on the target artifact and includes redacted live worker proof for fresh publish, successful classification, and failure paths.

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

Yes. Source inspection is enough for the PR defects: the workflow installs @openai/codex@latest in Production, and terminal failures are recorded only on the job row rather than the artifact scan result.

Is this the best way to solve the issue?

No. The worker direction is plausible, but this patch should pin the production Codex install, surface terminal worker failures on the target artifact, and provide live worker proof before merge.

Full review comments:

  • [P1] Pin the Codex CLI used by the Production worker — .github/workflows/security-scan-codex.yml:47
    This scheduled Production job installs @openai/codex@latest and then runs with the worker token and OpenAI key. A new npm release could change the code executed with those secrets without review; use a pinned version or repo-managed, reproducible install path.
    Confidence: 0.88
  • [P2] Record terminal scan failures on the artifact — convex/securityScan.ts:375-381
    After the final retry this only marks the queue job as failed; the skill version or package release never gets an llmAnalysis error. Public API/UI status can stay pending forever after a worker failure, unlike the existing evaluator error path.
    Confidence: 0.8

Overall correctness: patch is incorrect
Overall confidence: 0.84

Security concerns:

  • [high] Floating Codex CLI in secret-bearing workflow — .github/workflows/security-scan-codex.yml:47
    npm install -g @openai/codex@latest allows an unreviewed future package version to execute in the Production environment with SECURITY_SCAN_WORKER_TOKEN and OPENAI_API_KEY; pin or otherwise make the install reproducible.
    Confidence: 0.88

What I checked:

  • PR proof note: The PR body lists unit/static/type checks and explicitly says the live GitHub Actions worker was not exercised locally because it requires production secrets. (30ff43e52570)
  • Production workflow installs floating CLI: The new scheduled Production workflow runs with SECURITY_SCAN_WORKER_TOKEN and OPENAI_API_KEY, then installs @openai/codex@latest before executing the worker. (.github/workflows/security-scan-codex.yml:47, 30ff43e52570)
  • Terminal worker failures are job-only: failJobInternal marks the scan job failed after max attempts, but does not write an llmAnalysis error to the skill version or package release, so public status can remain pending indefinitely. (convex/securityScan.ts:375, 30ff43e52570)
  • Current main records scan errors on artifacts: The existing LLM evaluator's storeError path writes llmAnalysis.status: "error" onto the version, which is the behavior the queued worker should preserve for terminal failures. (convex/llmEval.ts:217, 636750fbf826)
  • Feature history provenance: Current main's security moderation, package security, LLM eval, VirusTotal, skills, packages, and workflow surfaces are largely present from commit cccef81, which added the current scan/moderation implementation. (convex/lib/moderationEngine.ts:1278, cccef81a3e96)

Likely related people:

  • Patrick Erichsen: Blame and history show the current security moderation, package security, LLM eval, VirusTotal, skills, packages, and workflow surfaces were introduced in commit cccef81. (role: current scan/moderation feature owner; confidence: high; commits: cccef81a3e96, 636750fbf826; files: convex/lib/moderationEngine.ts, convex/lib/packageSecurity.ts, convex/llmEval.ts)
  • Vyctor H. Brzezowski: Authored a recent merged security hardening commit that also updated security-moderation intent, making them relevant for adjacent policy and moderation routing. (role: recent adjacent security contributor; confidence: medium; commits: 8bbc66868d63; files: convex/skillTransfers.ts, specs/security-moderation.md)
  • steipete: The current PR author also appears in prior merged security hardening provenance as a co-author, so they are relevant beyond only opening this PR. (role: adjacent security co-author and PR proposer; confidence: medium; commits: 8bbc66868d63, 30ff43e52570; files: specs/security-moderation.md, convex/securityScan.ts, .github/workflows/security-scan-codex.yml)

Remaining risk / open question:

  • Live Production worker behavior, secret wiring, and Codex CLI compatibility remain unproven by real run evidence.
  • The policy shift to make VirusTotal telemetry-only and trust verified @openclaw/* plugins by default is broad and security-sensitive.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 636750fbf826.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. impact:security Security boundary, credential, authz, sandbox, or sensitive-data risk. labels May 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30ff43e525

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 352 to 355
if (staticStatus) statuses.push(staticStatus);
if (vtStatus) statuses.push(vtStatus);
if (llmStatus) statuses.push(llmStatus);
if (statuses.length === 0 && sha256hash) statuses.push("pending");
const status = mergeSecurityStatuses(statuses);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Drop static malicious status after clean Codex verdict

This merge still treats staticScan.status === "malicious" as authoritative even when ClawScan/Codex has already returned a clean verdict, so security.status remains malicious for artifacts that moderation has explicitly cleared. In practice, a skill with static-malicious findings plus llmStatus=clean will be reported as malicious by the API, which can cause downstream clients to continue blocking or warning on a release that should be visible per the new moderation policy.

Useful? React with 👍 / 👎.

This branch was successfully deployed

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

Labels

impact:security Security boundary, credential, authz, sandbox, or sensitive-data risk. P1 High-priority user-facing bug, regression, or broken workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant