feat(copilot-sdk): support BYOK (Bring Your Own Key)#956
Merged
Conversation
…target
Add optional `byok` block to copilot-sdk target config, allowing users to
route requests through their own Azure OpenAI, OpenAI, or Anthropic endpoints
instead of GitHub's Copilot infrastructure.
Supported BYOK fields: type, base_url, api_key, bearer_token, api_version,
wire_api. Secrets (api_key, bearer_token) require ${{ ENV_VAR }} syntax.
Closes #955
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Make explicit that manual e2e verification is a prerequisite for the code review step, not a parallel activity. If e2e fails, fix it before investing time in review. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents false "Unknown setting" warning when validating targets with a byok block. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
Author
Red/Green UAT EvidenceRED (on
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ase_url
When byok.type is "azure" and base_url is a bare resource name (no
https:// prefix), automatically construct the full URL as
https://{name}.openai.azure.com. This lets users reuse AZURE_OPENAI_ENDPOINT
directly without a separate env var.
Also reverts the AZURE_OPENAI_BYOK_URL env var — no longer needed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
byokblock tocopilot-sdktarget config, allowing users to route requests through their own Azure OpenAI, OpenAI, or Anthropic endpoints instead of GitHub's Copilot infrastructureprovideroption tocreateSession()when BYOK fields are presentmy-resource→https://my-resource.openai.azure.com)api_key,bearer_token) require${{ ENV_VAR }}syntax — no plaintext literals allowedExample config
Changes
packages/core/src/evaluation/providers/types.ts— addbyokfield toTargetDefinitionpackages/core/src/evaluation/providers/targets.ts— add BYOK fields toCopilotSdkResolvedConfig, parsebyokblock inresolveCopilotSdkConfig()packages/core/src/evaluation/providers/copilot-sdk.ts— build and passproviderblock tocreateSession(), normalize bare Azure resource namespackages/core/src/evaluation/validation/targets-validator.ts— addbyokto known copilot-sdk settings.agentv/targets.yaml— addcopilot-sdk-azuretarget usingAZURE_OPENAI_ENDPOINTTest plan
Closes #955
🤖 Generated with Claude Code