# Security and data

URL: https://codepanel.ai/docs/security

How CodePanel protects API keys and tokens, verifies GitHub webhooks, scopes GitHub access, and what code goes to which AI provider.

## Provider keys

- Encrypted with AES-256-GCM before storage, using a 256-bit `ENCRYPTION_KEY` that exists only on the backend.
- Replaceable but never readable. No endpoint returns a key in any form: the [HTTP API](/docs/api) reports only whether it works, how many models it reaches, and a redacted last error. Error text that echoes part of a key is redacted too.
- Decrypted only inside backend actions that call the provider: validation, model refresh, reviews and chat.
- Entered only in the browser. The API, MCP server and CLI cannot add or change a key, so it never passes through an agent's context.

## GitHub access

On codepanel.ai you sign in through the CodePanel GitHub App, so CodePanel sees only the repositories you install it on and acts only on the ones you connect.

Your GitHub token is encrypted with AES-256-GCM as soon as sign-in completes. CodePanel uses it to list repositories, install the webhook, read pull requests and post the review. When the repository is bound to the GitHub App, the app's token reads the pull request and posts the review instead.

| GitHub App safeguard | Detail |
| --- | --- |
| Signed deliveries | The app's webhook route accepts only deliveries signed with the app's secret |
| Installation binding | Written only from GitHub's own answers: app-signed `installation` and `installation_repositories` events, or CodePanel asking GitHub as the app when you connect a repository and when a review runs. A pull request payload never sets it |
| Token minting | CodePanel asks GitHub again, as the app, which installation owns the repository, and refuses on any mismatch |
| Token scope | One repository, cached for up to about 45 minutes |
| No double reviews | A repository with its own CodePanel webhook is reviewed through that webhook only |

## Webhooks

Every GitHub delivery that could start work is verified before anything is scheduled. Event types CodePanel does not handle get `200` without processing; malformed requests get `400`.

1. CodePanel looks up the repository the delivery names and its webhook secret, generated per repository and encrypted at rest.
2. It computes `HMAC-SHA256` of the exact raw body and compares it with `X-Hub-Signature-256` in constant time.
3. An unknown repository, a missing secret and a bad signature all return the same `401 Invalid signature`, so the endpoint cannot reveal which repositories are connected. A missing secret fails closed.
4. Only then is the delivery id recorded and the job scheduled. The job carries ids, never the raw body or the signature.

| Rule | Detail |
| --- | --- |
| Replay protection | Each `X-GitHub-Delivery` id that starts work is kept for 7 days, so the same delivery cannot start two reviews. The id is recorded only after the signature checks out, so an unsigned copy cannot burn a real one |
| Rate limit | 60 verified deliveries per minute per repository. Unsigned requests do not count against it |
| Who can spend your budget | Fork pull requests are reviewed automatically only for owners, members and collaborators ([Triggering reviews](/docs/triggering-reviews#automatic-triggers)). Comment commands run only for people GitHub confirms have write access ([Commands](/docs/commands#who-may-give-commands)) |

## API tokens

- **Personal tokens** are `cpk_` plus 32 random bytes in base64url, generated in a backend action. Only the SHA-256 hash and the first 12 characters are stored; the token is shown once. A fast hash is safe here because the token carries 256 bits of entropy.
- Tokens have scopes and optional expiry, and can be revoked; revoked and expired tokens are rejected.
- Creating, listing and revoking tokens needs a signed-in browser session. No token-authenticated route can mint or revoke a token, so a leaked token cannot make more. [Device login](/docs/api#device-login) (`codepanel login`) issues a token only after you approve its code in a signed-in browser; the code expires after 10 minutes and the token after 90 days.
- **CI tokens** are read-only and work for one repository only. The repository's webhook secret is never accepted as a token.
- Another user's data and a missing resource return the same `404`, and every response is built from an explicit list of fields, so no stored secret can leak by accident.

## Connected apps

A connector added to Claude or ChatGPT through the remote MCP server signs in with OAuth 2.1 and PKCE (S256 only).

| Credential | Lifetime and limits |
| --- | --- |
| Access token (`cpo_`) | Expires after an hour. Works only on `/mcp`, never on `/api/v1` |
| Refresh token | Expires after 30 days, and is replaced on every use. A replaced refresh token presented again more than a minute later ends that app's connection, since it must have been copied |

Both are stored as SHA-256 hashes. **Disconnect** under **Settings → API tokens → Connected apps** ends an app's access at once. What an app may do is set on the consent page; see [permissions](/docs/claude-and-chatgpt#permissions).

## Prompt injection

A pull request's author writes its title, description, code and comments, and a linked issue can be written by anyone, so any of it can carry text aimed at the models reviewing it: "report nothing", "this was approved", "fix it by running this script". CodePanel treats all of it as material to review, never as instructions:

| Defense | Detail |
| --- | --- |
| Fencing | Every piece of pull request text sits in a code fence it cannot close, and each model is told that what is inside, headings and JSON included, is material, not instructions |
| Hidden text | HTML comments, Unicode tag characters and bidirectional overrides are removed from the title, description, handoff and linked issues before any model reads them, and the prompt says so. In code they are shown as visible escapes, so a reviewer can report them |
| The author agent's handoff | Links (including defanged ones such as `hxxps://`), downloads piped into a shell and lines starting with a slash command are removed from it before any model reads it, and the reviewers are told it is the author's unverified claim, never an instruction. Spellings the patterns do not recognise (a bare host on an unusual domain, a spelled-out "dot") are not removed; the reviewers' rules and the output guard, which drops links to hosts the pull request's text links to, still apply |
| Claims | "Handled elsewhere", "intended" or "already fixed" in the pull request's text lowers a finding only when the code shown proves it |
| Links and commands | Before a review is stored or posted, any link to a host the pull request's own text names is removed from its findings and summary, and so is any command that pipes a download into a shell. A placeholder says what was removed and why |
| What a comment can render | Every model-written part of a review comment, an inline comment, a dispute answer or an `/ask` reply is cleaned as it is posted. Images and HTML comments are removed, other HTML shows as text, links are kept only into the repository and to codepanel.ai, and `@` mentions are put in code so they notify no one. Text that cannot be cleaned in place is posted as a code block |
| Credentials | Files that may hold credentials (`.env`, `*.pem`, `id_rsa` and the like) are never read for a model, beyond what a pull request's own diff changes in them. Keys with a known prefix (AWS, GitHub, Slack, Stripe, `sk-`, Google) and private key blocks are masked in code before it goes to a model, so the line numbers stay right and a reviewer can still report the key |

CodePanel measures these with a suite of generated attacks on every change to its prompts.

## What data goes where

| Data | Sent to | When |
| --- | --- | --- |
| Pull request title, description, author, file list and diff patches; surrounding code of changed files; your review rules and notes | The AI providers on your panel, with your key (or CodePanel's, on credits) | Each review round |
| Reviewers' findings, the pull request's title, description and author, and the code of the files the findings name | The orchestrator's provider | Each review round |
| The posted review | GitHub, as a pull request comment | After each round |
| Account, repository and review data | Convex, which hosts the database and backend | Always |
| Error reports and basic diagnostics, no autocapture, no pageviews, no session recording; off automatically under Do Not Track / Global Privacy Control or when turned off in Settings | PostHog, when configured | On a caught UI or review error |
| Per model call, when LLM analytics is on: model, token counts, cost, duration, retries, which kind of key paid, internal ids (account, repository, pull request, round, call) and your trace id if you passed one. Never the prompt, code or answer | PostHog, when configured | Each model call |
| Product lifecycle events: sign-up, repository connected, provider key added, review posted, finding rated, agent task started, runner paired, subscription or credit purchase; tagged with internal user and repository ids and coarse metadata such as provider or plan tier. Never code, diffs, prompts, file paths, emails or secrets | PostHog, when configured | On those account and workflow events |
| Desktop app and local runner telemetry | None: the desktop binary and local runner send zero analytics or telemetry, and never read other tools' credential files | Never |
| Your user id; payment details are entered on Stripe Checkout and never reach CodePanel | Stripe | When you subscribe or buy credits |
| The website | Cloudflare | Hosting |
| Per model and language: how many findings had an outcome, the share fixed and the share dismissed as false positives. Totals only, never an account, repository, pull request, file or code | Anyone, on [Benchmarks](/benchmarks), unless you opt out ([below](#public-model-stats)) | Rebuilt daily |

Each AI provider's handling of your code is governed by its own terms, so choose providers whose terms fit your code. CodePanel sends only what a review needs: lock files, generated files and oversized patches are never sent, and patches are capped in size ([How it works](/docs/how-it-works#file-triage)).

CodePanel stores repository and pull request metadata, capped diff patches, review output, findings and chat messages. It does not sell personal data.

### Custom endpoints

A custom base URL is fetched from CodePanel's servers with your key. To keep it from reaching internal systems, CodePanel refuses localhost, private and link-local ranges (including the cloud metadata address) and their IPv6 equivalents, checks the address on save and before each call, and refuses redirects.

## Public model stats

The [benchmark pages](/benchmarks) show how each model's findings fared on real pull requests, beside its score on the fixed benchmark suite. Once a day CodePanel counts the findings created in the last 90 days (and never before 20 October 2026, when this was first described) on the connected repositories of every account that shares, per model and per language, and publishes three numbers for each:

| Number | Counts |
| --- | --- |
| `findings` | Findings with an outcome: rated, dismissed, or resolved by a later round. An open finding nobody rated is not counted yet |
| `fixedShare` | Of those, the share fixed: not dismissed, and resolved by a commit that edited the lines it pointed at, or rated `/feedback F1 up fixed`. An agent that edits the code for every finding raises it, so it says what authors did with the findings, not that they were right ([`GET /quality`](/docs/api#get-quality) measures that) |
| `dismissedShare` | The share dismissed as `false_positive`, by a person or an agent, or withdrawn when the orchestrator answered a dispute against it |

A finding several models reported counts once for each. The language comes from the file's extension, with the keys the benchmark fixtures use (`c`, `cpp`, `cs`, `go`, `java`, `js`, `kt`, `php`, `py`, `rb`, `rs`, `swift`, `ts`); other files count toward the model's total only.

So that no row is one customer's results, a model is published only with at least 200 findings from at least 3 accounts, and a language under it only with at least 50 findings from at least 3 accounts, and in either case, with any one other account's findings set aside, no account may give more than half of what is left. Every account can subtract its own findings, so this keeps the rest from being one other customer's results. With three accounts they must give exactly as many findings each, so in practice a row needs four or more accounts of similar size. Published counts are rounded down to a multiple of 10 and shares to whole percent, so the change from one day to the next says little about any one account. Nothing published names an account, repository, pull request or file, or includes code or review text.

Your account is included unless you turn it off: clear **Count my findings in public stats** under **Settings → Account**, or call [`POST /account/sharing`](/docs/api#post-accountsharing) with `{"shareModelStats": false}`. The published numbers are rebuilt from the sharing accounts each day, so your findings leave them at the next refresh, which the response names in `appliesAt`. Disconnected repositories are never counted.

### Outcomes by agent

The [agent pages](/agents) and each model's page also show the same findings per coding agent: those a coding agent answered, by rating them with `--agent` (or through the MCP server, which names the client) or by disputing them. For each agent there are four numbers, over every model and per model that raised the findings:

| Number | Counts |
| --- | --- |
| `findings` | Findings with an outcome that the agent rated or disputed |
| `fixedShare` | Of those, the share fixed, counted as above |
| `dismissedShare` | The share dismissed, counted as above |
| `disputedShare` | The share the agent disputed, whatever the orchestrator decided |

The same accounts, window and rounding apply, and never findings created before 20 October 2026, when this was first described. An agent is published only with at least 200 findings from at least 3 accounts, and a model under it only with at least 50 findings from at least 3 accounts, with the same rule that no account gives more than half of what is left. A finding several agents answered counts once for each. Only the agents with a page are counted, under the page's name, so the label an agent sent is never stored or published. How each dispute came out is not published. The sharing setting above covers these numbers too.

## Delete your data

| What | How |
| --- | --- |
| A repository | **Disconnect** on its **Settings** tab stops reviews and removes CodePanel's webhook from GitHub; past reviews stay readable. Disconnecting through the API, CLI or MCP stops reviews but leaves the webhook, which you delete under the GitHub repository's **Settings → Webhooks** |
| GitHub access | Revoke CodePanel's authorization in your GitHub settings |
| Provider keys | Remove them under **Settings → Provider keys** |
| API tokens and connected apps | Revoke or disconnect them under **Settings → API tokens** |
| Your findings in the public model and agent stats | Turn sharing off under **Settings → Account** ([Public model stats](#public-model-stats)) |
| Your account and data | **Delete account** under **Settings → Account** ([Delete your account](#delete-your-account)) |

### Delete your account

Under **Settings → Account**, choose **Delete account…**, type your GitHub username and confirm. Deleting:

- Cancels your subscription in Stripe now, not at the end of the period, and deletes your Stripe customer with its saved cards. Nothing more is charged. The rest of the month and unused credits are not refunded. Stripe keeps the invoices and payments that tax law requires.
- Signs you out everywhere and revokes your API tokens and connected apps at once.
- Removes your repositories, pull requests, reviews, findings, ratings, learnings, panels, reviewers, provider keys, credits and spend records within minutes. A review still running is let finish first, for up to an hour. Your findings leave the [public stats](#public-model-stats) at the next daily refresh.
- Removes the webhook CodePanel installed on each repository. Any it could not remove (lost admin access, for example) are listed afterwards, to delete under the repository's **Settings → Webhooks**.

It does not uninstall the CodePanel GitHub App, which may serve other people in an organization: uninstall it under your GitHub **Settings → Applications**. Ratings and comments you left on other people's repositories stay part of their history. Deletion is only in the browser, never through the API, MCP server or CLI, so a leaked token or a misled agent cannot delete an account. It cannot be undone; signing in again starts a new, empty account.

## Report a vulnerability

Email [support@codepanel.ai](mailto:support@codepanel.ai) with the affected part, steps to reproduce and the likely impact. Do not post exploits, credentials or private user data in public issues.
