Bring your own key gives an AI code reviewer permission to call a model provider through your account. You control the provider account and pay the model bill directly. The review service may still fetch your repository, build the prompt, send it to that provider and store the result.
BYOK is useful for model choice, spend control and provider governance. Source code can still pass through the review service and an external model provider.
The privacy review should answer four separate questions:
- Who runs the code-review application?
- Who owns the model API account and key?
- Where does model inference run?
- Which systems store prompts, responses, logs or repository context?
A product can give you your own key while remaining a cloud service in every other respect.
What BYOK means in AI code review
A hosted AI reviewer normally pays its model providers and includes that cost in a subscription or usage plan. With BYOK, you enter a key for a supported provider or AI gateway. Reviews then consume usage from your provider account.
A typical path looks like this:
GitHub repository
↓
hosted AI review service
↓
model provider called with your API key
↓
hosted reviewer filters and posts findingsYour key changes the commercial relationship with the model provider. It may also let you choose a model or apply provider-side controls. The review vendor still handles repository access, prompt construction and review output unless you self-host it.
What BYOK improves
Direct model billing
Usage appears in the provider or gateway account you control. You can set budgets, monitor token spend and compare model costs without relying only on the review vendor's usage report.
This is useful when review volume varies by repository or when per-seat pricing does not match actual use. It also makes model spend visible to the same platform team that manages other AI workloads.
Provider and model choice
A good BYOK implementation lets you choose among supported models instead of accepting one hidden default. Teams can route lower-risk repositories to a cheaper model and reserve a stronger model for sensitive or complicated changes.
Choice also makes migration easier when pricing, availability or internal policy changes. Check whether configuration accepts any model available through the provider or only a vendor-approved list.
Provider-side governance
Your organization may already have an approved account with retention settings, regional processing, access controls, spend alerts and a negotiated agreement. BYOK can keep AI code review inside that existing vendor relationship instead of adding a second model contract chosen by the review tool.
This benefit depends on the provider and account configuration. Owning a key does not guarantee zero retention, no training or a particular processing region.
Separation between product credits and model usage
Some tools let a workspace use its own key instead of consuming included review credits. This can make costs easier to attribute and avoids paying a markup on model usage. It may also move rate limits and outages into your provider account.
What BYOK does not protect
The review vendor still sees repository data
A hosted reviewer usually needs the pull-request diff and surrounding files to build a useful prompt. Even if the final model call uses your key, the vendor's application may process or temporarily store that code first.
Ask what repository content is fetched, where workspaces are created, how long they survive and whether support staff can access them. Include summaries, embeddings, caches and debug artifacts. Derived data can reveal as much as a raw file.
The model provider still receives the prompt
Your API key authenticates the request, while the provider still receives source code, pull-request descriptions, repository rules and any other context included in the prompt.
Review the provider's production API terms, training policy, retention, subprocessors and regional controls. Do this for every model the reviewer may route to, including fallback models.
Logs and telemetry may create another copy
Prompts and model responses often appear in traces during debugging. File paths, function names and review findings can also reach error reporting, analytics or support systems.
Ask whether sensitive payload logging is disabled by default, which metadata remains, how access is audited and whether retention can be shortened. A strict model-provider policy does not help if the review service writes full prompts into an ordinary log platform.
A cloud dashboard remains a cloud dashboard
BYOK does not move the web application, database, queue or worker into your account. If your requirement says repository processing must happen inside a particular VPC or region, BYOK alone cannot satisfy it.
The self-hosted versus cloud comparison covers the operational trade-off when application control matters as much as model choice.
BYOK, self-hosting and local models solve different problems
| Setup | Review application | Model inference | Model account | Does prompt leave your network? |
|---|---|---|---|---|
| Hosted with vendor models | Vendor | External provider | Vendor | Usually yes |
| Hosted with BYOK | Vendor | External provider | You | Usually yes |
| Self-hosted with cloud key | You | External provider | You | Yes |
| Self-hosted with local model | You | Your infrastructure | You | Not for model inference |
Self-hosting controls the review application. BYOK controls the model account. A local model controls where inference runs. Teams often need two or all three, but buying one should not be described as buying the others.
Map the full repository data path
Draw the review as a sequence rather than asking a vendor whether the product is “private.”
1. GitHub access
Check which repositories the app can access and which GitHub permissions it requests. Prefer selecting only the repositories that need review. Confirm how installation tokens are stored and rotated.
2. Repository retrieval
Identify whether the service fetches only the diff, selected files or a working checkout. Repository-aware review is more useful than diff-only review, but it also means more source code enters the processing environment.
The answer should include temporary disks, object storage, caches and backup systems.
3. Prompt construction
Ask which code and metadata enter the prompt. Review rules, issue descriptions, dependency files and nearby tests may all be included. Check whether secrets or unsupported file types are excluded before inference.
4. Model routing
Document the primary model, verification model, fallback model and any gateway between the reviewer and provider. A review pipeline can call several models for one pull request. Your privacy review must cover all of them.
5. Findings and retention
Find out where candidate findings and final comments are stored. Check retention after a repository is disabled or a workspace is deleted. Ask whether human support access is possible and logged.
6. Observability and support
Include logs, traces, analytics, crash reports and support tooling. These systems often receive metadata even when prompt bodies are redacted.
Questions to ask a BYOK code-review vendor
Use direct questions that produce architectural answers:
- Does repository content pass through your infrastructure before the model call?
- Which exact services receive pull-request code or prompts?
- Can you switch models or providers without notice?
- Are fallback and verification models billed through my key too?
- Where are API keys encrypted, decrypted and used?
- Can support staff access repository content, prompts or findings?
- Are prompts or responses written to logs, traces or backups?
- How long do review workspaces and derived data remain?
- Can processing be pinned to a region?
- What happens when my key is invalid, rate-limited or out of budget?
- Can I use separate keys by workspace or repository?
- Can the reviewer run without external model access?
A clear answer names systems, locations, retention and owners. “Enterprise-grade privacy” is not an architecture.
How Scopy handles BYOK
Scopy Cloud lets a workspace add an OpenRouter or Vercel AI Gateway key. Reviews using that key are billed to the provider account instead of Scopy workspace credits, and the model choice can be overridden per repository. Scopy encrypts stored keys at rest.
The hosted Scopy application still processes the pull request and sends repository context to the selected gateway or model provider. BYOK therefore changes model billing and routing, not the fact that hosted Scopy participates in the data path.
Self-hosted Scopy moves the web app, API, worker, database and review workspaces into infrastructure you control. The current open-source configuration still uses OpenRouter or Vercel AI Gateway for model calls. Teams that require fully local inference need to add and maintain a compatible provider path or internal gateway.
Store and scope model keys carefully
Treat a model key like any production credential:
- encrypt it at rest with a separately managed key
- decrypt it only in the worker that makes model calls
- avoid putting it in client code or pull-request environments
- use separate keys for environments or business units where practical
- apply provider budgets and rate limits
- rotate keys after staff changes or suspected exposure
- redact keys from logs and errors
- record which workspace or repository selected the key without logging the key itself
Repository-level overrides need clear inheritance. A workspace default should not silently replace a repository's stricter provider choice.
Evaluate cost without losing the privacy question
BYOK often makes model cost easier to see, but a lower token bill can distract from the systems still processing code. Compare:
- model usage
- review-vendor subscription
- gateway fees
- storage and observability
- engineering time for key management
- security and compliance review
- failed reviews caused by provider limits
For a rough usage comparison, the AI code review cost calculator can model PR volume and provider spend. Keep the data-flow review separate from the price calculation.
When BYOK is enough
BYOK is often sufficient when your organization already approves the hosted review service, wants direct control over model accounts and accepts the provider's data terms. It works well for teams optimizing model choice and cost without taking on application operations.
If your requirements keep source code inside your network, place the review application in your cloud account or prohibit external model providers, you need self-hosting, local inference or both.
Frequently asked questions
Does BYOK mean my code stays private? It gives you control of the model account and key. The hosted review service and model provider may still process repository data. Privacy depends on the complete data path, contracts, retention and access controls.
Is BYOK the same as self-hosting? No. BYOK changes which credential pays for model inference. Self-hosting changes where the review application runs.
Can BYOK prevent vendors from training on my code? Only if the applicable provider and review-vendor terms say so. Owning the key does not set the training or retention policy by itself.
Is a local model more private than BYOK? A local model can keep inference inside your infrastructure. The rest of the review pipeline still needs inspection, including GitHub access, storage, logs and telemetry.
Can different repositories use different keys? Some reviewers support repository-level provider overrides. Check inheritance, encryption, access control and what happens when a repository key fails.
Write down every system that receives repository content, then decide whether BYOK removes the party you care about. If it only changes the invoice, treat it as a billing feature rather than a privacy boundary.