Configure
Agent credentials
Connect Claude Code or Codex with your own token or API key, and how OpenVScan stores and uses it.
Configure
Connect Claude Code or Codex with your own token or API key, and how OpenVScan stores and uses it.
The AI review runs on your own model credential. OpenVScan never supplies one. You save it once under Settings in the AI agents section, and every repository you connect can use it.
| Agent | Credential | How to get it |
|---|---|---|
| Claude Code | Claude subscription token | Run claude setup-token and paste the token. Uses your Claude Pro or Max plan. |
| Claude Code | Anthropic API key | Create a key at console.anthropic.com. Billed by usage. |
| Codex | ChatGPT login | Sign in with codex login --device-auth and paste its auth.json. Uses your ChatGPT Plus, Pro or other plan's Codex limits. |
| Codex | Codex access token | A ChatGPT Business or Enterprise access token (at-…) for Codex automation. |
| Codex | OpenAI API key | Create a key at platform.openai.com. Billed by usage. |
| Cursor | Cursor API key | Create a user API key under Cursor Dashboard → API Keys. Usage counts against your Cursor plan. |
To create a Claude subscription token, run this on a machine where you are logged in to Claude Code:
claude setup-tokenCodex keeps a ChatGPT login in an auth.json file. Create one just for OpenVScan, in a fresh Codex home:
export CODEX_HOME="$(mktemp -d)"
codex login --device-auth
cat "$CODEX_HOME/auth.json"Paste the whole file into auth.json on the Codex card. OpenVScan keeps only the tokens and shows your plan name on the card.
Use a separate login rather than your laptop's ~/.codex/auth.json. ChatGPT refresh tokens can be used only once, so two copies of one login sign each other out: whichever refreshes second gets an error. A separate login has its own tokens.
OpenVScan refreshes the login itself when the access token has less than an hour left, and saves the new tokens. If the login is revoked or expires, the review records an error asking you to sign in again.
The card then shows Connected, the credential type, its last four characters (the plan name for a ChatGPT login) and when it was last used ("Not used yet" until the first review).
A saved credential is not used until a repository asks for it. Set AI reviewer to the matching agent on each repository you want reviewed. See Repository settings.
OpenVScan rejects tokens shorter than 20 or longer than 4,000 characters, and tokens containing spaces or line breaks. An auth.json must contain a ChatGPT login, not an API key. It also catches the common mix-up of pasting one type as another, for example an sk-ant-api key into the subscription token field.
You can hold one credential per agent. Each slot holds one type: a subscription token or an API key for Claude Code; a ChatGPT login, an access token or an API key for Codex.
To change a credential, click Replace on its card and save a new value. It overwrites the old one. To remove it, click the trash icon. Repositories set to that agent then run scanners only, and the summary comment says the AI review did not complete because no credential is configured.
A review uses the credential of the OpenVScan user who connected the repository. It does not use the pull request author's credential.
Every review spends that user's quota or API budget. Pull requests from people without write access to the repository (outside contributors, forks, bots such as Dependabot) do not start the AI review on their own: the scanners run, and the summary comment says the AI review was not started. Someone with write access can comment @<app> review to run it on the current commit. Each new push goes back to scanners only.
Credentials are encrypted at rest with AES-256-GCM. The key is CREDENTIALS_KEY, a secret configured on the deployment. Each credential gets a random 12-byte IV, and its database row id is bound in as additional authenticated data, so an encrypted value cannot be copied to another row and still decrypt.
The plaintext is never sent back to your browser. The dashboard only receives the type, the last four characters (or plan name) and timestamps.
The credential never enters the sandbox where the agent runs.
openvscan-injected-at-egress) in place of the real token or key.api.anthropic.com (Claude Code), api.openai.com (Codex with an API key) the Codex backend on chatgpt.com (Codex with a ChatGPT login or access token) or *.cursor.sh (Cursor), and blocks every other host.The secret is never written to the container's environment, its files or Durable Object storage. For a ChatGPT login, Codex gets an auth.json with unsigned placeholder tokens: it holds the plan type and workspace account id, but no token and no email. The engine refreshes the real login before the agent starts, so the sandbox never needs to reach the OpenAI sign-in service.
Cursor's CLI normally trades its API key for an access token when it starts. OpenVScan makes that trade in the engine for each review instead, and gives the CLI a placeholder token. The proxy blocks Cursor's sign-in endpoints, so the sandbox can't get a token of its own. See Security model.
Saving credentials requires CREDENTIALS_KEY to be set on both the web and engine Workers, with the same value. Without it, the AI agents section shows a warning and the save button is disabled. See Self-hosting.