Reference
Upgrading
Move to a new version, apply migrations in order, redeploy, rotate keys, and the licenses that apply.
Reference
Move to a new version, apply migrations in order, redeploy, rotate keys, and the licenses that apply.
An upgrade has three parts: apply any new database migrations, deploy the engine, then deploy the web Worker. This page also covers rotating secrets and the licensing terms that apply to a self-hosted deployment.
Check what changed, and whether the new version adds migrations:
git fetch origin
git log --oneline HEAD..origin/main
git diff --stat HEAD origin/main -- packages/db/migrationsIf there are new migrations, back up the database first:
pnpm --filter openvscan-web exec wrangler d1 export openvscan --remote --output openvscan-backup.sqlD1 also keeps point-in-time history (Time Travel), which you can restore with wrangler d1 time-travel restore.
Check whether any reviews are in progress under Reviews in the dashboard. A review that is running while you deploy the engine can fail. You can start it again with Re-run on the PR's check, or from the dashboard.
Pull the new version
git pull
pnpm installIf you deploy from a fork, merge upstream into it. Keep your database_id, your variables and any routes in both wrangler.jsonc files.
Apply migrations
pnpm db:migrateWrangler applies the pending files in packages/db/migrations in filename order and records each one in the database's d1_migrations table. Migrations that were already applied are skipped, so the command is safe to run on every upgrade.
Apply migrations before you deploy, so the new code never runs against the old schema.
Deploy the engine
pnpm --filter openvscan-engine run deployDocker must be running. If the Dockerfile changed, Wrangler rebuilds and pushes the container image.
Deploy the web Worker
pnpm --filter openvscan-web run deployThis builds the web app and deploys it. Secrets carry over from the previous deploy, and variables are taken from web/wrangler.jsonc.
Verify
Open a pull request on a connected repository, or use Re-run on an existing OpenVScan check, and confirm the review completes.
Always deploy the engine before the web Worker. The web Worker calls the engine's EngineApi over a service binding, and a new web Worker can depend on engine changes from the same release.
Tool versions and rule packs are pinned in engine/container/Dockerfile, with a SHA-256 checksum for every binary, so they change only when a release changes the Dockerfile. Vulnerability data is always current: OSV-Scanner queries OSV.dev during each run, so you do not need to rebuild the image to get new advisories.
OSV-Scanner replaces Trivy for dependencies, Trivy now checks infrastructure-as-code only, and zizmor, poutine and Spectral are new. Migration 0009_scanner_suite turns on OSV-Scanner for every repository that had Trivy on, and zizmor, poutine and Spectral for every repository. Turn any of them off under Scanners in a repository's settings.
Versions before the pull request review pipeline had projects and ad-hoc scans. Migration 0002_pr_review_pipeline drops the project, scan, finding and scan_log tables and rebuilds repository. Connected repositories are kept. Export anything you need before you apply it.
The old openvscan-scanner Worker and openvscan-scans queue are no longer used. Delete them from your Cloudflare account after the upgrade.
Earlier versions signed users in with Better Auth: email and password, or GitHub through the App's OAuth client, with email sent through Cloudflare Email Service. Sign-in now uses WorkOS AuthKit, and user ids are WorkOS user ids.
Set up WorkOS
Follow the Set up WorkOS AuthKit step in Deploy to Cloudflare. It registers <origin>/api/auth/callback as a redirect URI and gives you the client ID and API key.
Update the GitHub App
Replace the callback URL <origin>/api/auth/callback/github with <origin>/api/github/link/callback. If users will sign in with GitHub through WorkOS, also add the GitHub redirect URI WorkOS shows. Keep the Email addresses account permission. See Linking GitHub.
Change the configuration
In web/wrangler.jsonc, remove BETTER_AUTH_URL, EMAIL_FROM and the send_email binding EMAIL, add WORKOS_AUTHKIT_DOMAIN for the MCP server, and add the ratelimits bindings AUTH_IP_LIMITER and AUTH_EMAIL_LIMITER that limit sign-in attempts. Then set the new secrets and delete the old one:
pnpm --filter openvscan-web exec wrangler secret put WORKOS_CLIENT_ID
pnpm --filter openvscan-web exec wrangler secret put WORKOS_API_KEY
pnpm --filter openvscan-web exec wrangler secret delete BETTER_AUTH_SECRETCREDENTIALS_KEY is now required on the web Worker, because it seals the session cookie.
Migrate and deploy
Apply the migrations and deploy as in Upgrade. Everyone signs up again, links GitHub, installs or reconnects the App, connects their repositories and saves their agent credentials.
The App stays installed on GitHub after its OpenVScan user is deleted. To reconnect an existing installation, a user clicks Install GitHub App under Repositories, picks the account and saves its settings on GitHub. With Redirect on update checked, GitHub sends them back through the setup URL with the installation id.
Review artifacts in R2 are not deleted by the migration. Remove the objects under runs/ in the openvscan-artifacts bucket if you don't want to keep them.
If you change the schema in a fork, generate the migration with pnpm db:generate and commit it. When you merge a later upstream release that also adds migrations, check the migration numbers and the files in packages/db/migrations/meta for conflicts before you apply anything.
Agent credentials are encrypted with AES-256-GCM using CREDENTIALS_KEY, with each row's id bound in as additional data. There is no re-encryption path. After you change the key, the engine cannot decrypt any credential saved under the old one, and every user has to save their credential again.
Until they do, a run with an agent fails at the AI review step and its check concludes neutral. If you delete the old credentials instead, runs skip the AI review and log that no credential is configured. Scanner results are still published.
The same key seals session cookies and linked GitHub tokens. Changing it signs everyone out, and users have to link GitHub again before they connect another organization installation.
Generate a new key
openssl rand -base64 32Set it on both Workers
pnpm --filter openvscan-engine exec wrangler secret put CREDENTIALS_KEY
pnpm --filter openvscan-web exec wrangler secret put CREDENTIALS_KEYEnter the same value both times. Each command deploys a new version immediately.
Delete the old credentials (recommended)
pnpm --filter openvscan-web exec wrangler d1 execute openvscan --remote --command "DELETE FROM agent_credential"
pnpm --filter openvscan-web exec wrangler d1 execute openvscan --remote --command "DELETE FROM github_account"Ask users to save their credentials again
Each user signs in again, opens Settings → AI agents and saves their credential, and links GitHub under Settings → GitHub account. Both are sealed with the new key.
A GitHub App can have more than one active private key. Generate a new key on the App, set GITHUB_APP_PRIVATE_KEY on both Workers with wrangler secret put, confirm a review still publishes, then delete the old key on GitHub.
Change the secret on the App and set GITHUB_WEBHOOK_SECRET on the web Worker. Deliveries in between are rejected with 401. You can redeliver them from the App's Advanced tab.
Generate a new client secret on the App, set GITHUB_CLIENT_SECRET on the web Worker, then delete the old secret on GitHub. If WorkOS's GitHub connection uses the same App, update the secret there too.
Create a new API key in the WorkOS dashboard, set WORKOS_API_KEY on the web Worker, then revoke the old key in WorkOS. Sessions are not affected.
OpenVScan is licensed under the GNU Affero General Public License v3.0 only (AGPL-3.0-only). If you modify it and let others use your modified version over a network, the AGPL requires you to offer them the source code of that version.
The container image bundles third-party tools under their own licenses:
| Component | License |
|---|---|
| OpenGrep | LGPL-2.1 |
| OSV-Scanner | Apache-2.0 |
| Gitleaks | MIT |
| Trivy | Apache-2.0 |
| zizmor | MIT |
| poutine | Apache-2.0 |
| Spectral and its OWASP ruleset | Apache-2.0 and MIT |
| opengrep-rules | LGPL-2.1 with the Commons Clause |
| GitLab sast-rules | MIT; rules/lgpl LGPL-3.0 |
| Trail of Bits semgrep-rules | AGPL-3.0 |
| 0xdea semgrep-rules | MIT |
| mobsfscan rules | LGPL-3.0 |
| Claude Code, Codex, Cursor CLI | Their vendors' terms |
The Commons Clause restricts selling a product or service whose value derives substantially from the software. Review it before you sell a hosted service built on the bundled rules. To leave a pack out, remove it from the curate.py call in engine/container/Dockerfile. Each pack's license is copied next to its rules in the image, under /opt/opengrep-rules.
Semgrep's registry rules are not included, because their license does not permit this kind of use. Do not add them to the image.
If you run OpenVScan for other people, check each model provider's terms before you let users connect subscription tokens, such as a Claude subscription token, to a service you operate. API keys are the safer default for a multi-user deployment.