Security
Security model
How the review sandbox, egress policy and GitHub permissions limit what a compromised agent or scanner can do, and what OpenVScan stores.
Security
How the review sandbox, egress policy and GitHub permissions limit what a compromised agent or scanner can do, and what OpenVScan stores.
The coding agent reads input an attacker controls: the pull request's code, its description and its comments. OpenVScan assumes a prompt injection will eventually succeed, and is built so that a compromised agent has little it can reach. The same limits apply to the scanners, which also parse untrusted files.
Each review gets its own Linux container, managed by a Durable Object named after the review. The container starts with internet access disabled. Every HTTP and HTTPS request it makes is intercepted and handed to Outbound, an egress proxy that allows or refuses each request based on the current phase of the review. Plain HTTP is always refused.
The container is destroyed when the review finishes, fails or is cancelled. It also shuts down after 20 minutes without activity.
This page describes Cloudflare containers. A deployment can run sandboxes on Daytona instead, where Daytona's network rules and secrets take the place of Outbound. See Run sandboxes on Daytona for how that differs.
The engine switches the egress policy as the review moves between steps. Each phase allows only what that step needs.
| Phase | Used during | Allowed |
|---|---|---|
locked | Between steps, and while OpenGrep, Gitleaks, Trivy, zizmor, poutine and Spectral run | Nothing |
checkout | Fetching the head commit | git fetch of the one repository under review: GET /info/refs?service=git-upload-pack and POST /git-upload-pack on github.com. Push and every other repository are refused. |
scan | The OSV-Scanner step only | On api.osv.dev: POST /v1/querybatch and /v1/query (package names, versions and ecosystems) and GET /v1/vulns/<id>. No source code. |
agent | The AI review | Claude Code: on api.anthropic.com, POST /v1/messages, POST /v1/messages/count_tokens, GET /v1/models and read-only account lookups under /api/. Codex with an API key: on api.openai.com, creating responses and chat completions and listing models. Codex with a ChatGPT login or access token: the Codex backend on chatgpt.com. Cursor: *.cursor.sh, except its sign-in endpoints. Nothing else. |
Refused requests get a 403 response and are logged by the engine.
The phases do not overlap. While the agent runs, it cannot reach GitHub, package registries or any other host it could use to send out code or tokens. Its only reachable endpoint is the model API on the account whose credential you supplied. Anything the agent reads may be sent there as part of its normal work.
On that API, the agent can only call the model. Endpoints that hold your other data are refused: stored files, batches, stored responses, skills, fine-tunes and admin APIs. So are endpoints that mint keys or tokens. A prompt-injected agent therefore cannot read your account's data and copy it into the public review. The proxy also removes any OpenAI-Organization or OpenAI-Project header the agent sets.
No secret is ever placed in the container's environment, its files or Durable Object storage. Secrets exist only in the in-memory egress policy for the phase that needs them, and the policy is reset to locked as soon as that phase ends.
contents: read and metadata: read. The proxy adds it to the git fetch request. Git inside the container never sees it.The agent runs with no GitHub token at all.
The AI review spends the repository owner's credential, so it does not start on its own for pull requests from people without write access (outside contributors, forks, bots). The scanners still run. Someone with write access can start the AI review with an @<app> review comment.
Inside the sandbox, the agent can read the checked-out code and run shell commands. Its only effect on the outside world is the file it writes, /workspace/.openvscan/review.json. The engine treats that file as untrusted:
MAL- id) stays in the gate whatever the agent says. The agent may re-rate severity, but cannot lower a finding from at or above the fail threshold to below it.@ mentions, and stops images, links, bare URLs and issue references from rendering. See Results on GitHub.Scanner output is handled the same way. It is parsed by fixed parsers in the engine and sanitized before it is posted. The scanners also ignore every config file, ignore file and suppression comment the pull request could use to switch them off; see Scanners.
OpenVScan stores data in Cloudflare D1 and R2.
| Store | Contents |
|---|---|
| D1 | Accounts (a copy of the WorkOS profile: name, email, picture), linked GitHub accounts (login and encrypted user token), GitHub App installations, connected repositories and their review policy, encrypted agent credentials (with the last four characters for display), pull request metadata (number, title, author, branches and commit SHAs), reviews (status, conclusion, settings snapshot, AI summary and risk, counts), findings (title, description, file, lines, severity, remediation, suggested fix, AI verdict and reasoning) and run logs |
| R2 | Per-review artifacts under runs/<review id>/: diff.json (the changed-line map), pr.diff (the pull request's unified diff), the raw JSON output of each scanner, and the agent's review.json |
Some things are never stored:
These are the repository permissions the App needs. If you self-host, GitHub App covers registering your own.
| Permission | Access | Why |
|---|---|---|
| Checks | Read and write | Create the OpenVScan Security Review check run, complete it and add annotations |
| Pull requests | Read and write | Read the pull request and its changed files, post the inline review and the summary comment |
| Contents | Read | Fetch the head commit for scanning |
| Metadata | Read | Required by GitHub for every App |
The App subscribes to these webhook events:
| Event | Used for |
|---|---|
| Pull request | Start a review on open, push, reopen and ready for review. Cancel reviews when the pull request closes. |
| Check run | Start a new review when you click Re-run on the check |
| Installation | Remove an installation and its repositories when the App is uninstalled |
| Installation repositories | Remove repositories you take away from the App |
Every webhook is verified against its X-Hub-Signature-256 signature before it is processed.
When you install the App, GitHub redirects you back to OpenVScan with an installation id. Before linking that installation to your account, OpenVScan checks with GitHub, using your linked GitHub account, that you are the personal account it was installed on or an admin of the organization. This stops someone from claiming another account's installation by editing the redirect URL.
The sign-in, sign-up and password reset pages are OpenVScan's, and the web Worker passes what you type straight to WorkOS's API. WorkOS checks the password, emails verification codes and reset links, and enforces the password rules. OpenVScan stores no passwords and logs none.
Rate limits. Sign-in, sign-up, code and reset attempts are limited to 5 a minute per email address and 20 a minute per IP, with Cloudflare rate limiting bindings. WorkOS itself does not lock accounts.
No account probing. A wrong email and a wrong password get the same message, and Forgot password reports success whether or not the email has an account. Sign-up does say when an email is already taken.
Email verification. When WorkOS needs the email verified, it holds the sign-in and emails a 6-digit code. The pending sign-in token stays in a sealed httpOnly cookie, ovs_pending, for ten minutes, so page scripts never see it.
Session cookie. After sign-in, OpenVScan sets one cookie, ovs_session. It is httpOnly, Secure in production and SameSite=Lax, and holds your WorkOS access and refresh tokens sealed with AES-256-GCM under CREDENTIALS_KEY.
Short-lived access. The access token is a JWT that lives about five minutes. Every request checks its signature against WorkOS's keys, and an expired token is refreshed with WorkOS. A session you sign out of or revoke stops working within minutes.
Sessions in Settings. Settings → Sessions lists your active WorkOS sessions and can sign out any of them, or all but the current one.
Sign-out is a POST, so a link on another site cannot sign you out. It clears the cookie and ends the session at WorkOS.
Deleting your account needs a sign-in within the last 24 hours. It cancels running reviews, deletes your WorkOS user and deletes your OpenVScan data.
Linking GitHub is separate from sign-in. It gives OpenVScan a GitHub App user token, sealed the same way, that is used only to check installation access. See Linking GitHub.
The MCP server at /mcp accepts OAuth bearer tokens issued by the deployment's AuthKit domain. Each request's token is checked for its signature, its issuer and its audience. The audience must be the deployment's own /mcp URL (when it is a resource indicator in WorkOS) or the environment's WORKOS_CLIENT_ID, so a token from another WorkOS environment is refused. Dashboard session tokens have a different issuer and are refused too. Tokens issued to a WorkOS AI agent identity rather than a user are also refused.
A valid token acts as you, with the same permissions as the dashboard: it can read your reviews, start, re-run and cancel reviews, pause pull requests and change repository settings. It cannot read agent credentials or change your account. Only connect clients you trust with that access.