为应用与服务接入 GitHub Copilot Agent 而做的多平台 SDK,语言标注为 Java,仓库挂在 microsoft 组织下。文档指出它正更名为 Microsoft Copilot SDK,角色换成 Microsoft Copilot harness 的可编程接口——这套 harness 是微软与 GitHub 多条产品线共用的 agent 基础层,口号写作「Agents for every app」,面向应用与服务两类宿主,而不是独立的对话客户端。迁移分阶段推进:过渡期内包名、命名空间和部分文档仍可能沿用 GitHub Copilot SDK 的旧称,现有接入方不必立刻改动,支持流程照旧并在 SUPPORT.md 中单列,代码里的引用暂时不用改,查资料时最好新旧两套称呼都试一遍。MIT 许可。适合把 agent 能力挂进已有产品或内部服务、又不想自建运行时与集成链路的团队。
[!IMPORTANT] GitHub Copilot SDK is becoming Microsoft Copilot SDK, the programmable interface for the Microsoft Copilot harness, the shared agent foundation used across Microsoft and GitHub products.
The SDK repository will move to the Microsoft organization as part of a phased transition. Existing package names, namespaces, and some documentation may continue to reference GitHub Copilot SDK during the transition. No immediate changes are required for existing users. Learn more about the transition.
Support for the Copilot SDK remains the same. For more information: SUPPORT.md
Agents for every app.
Embed Copilot's agentic workflows in your application with the Microsoft Copilot SDK for Python, TypeScript, Go, .NET, Java, and Rust.
The Microsoft Copilot SDK exposes the same engine behind Copilot CLI: a production-tested agent runtime you can invoke programmatically. No need to build your own orchestration—you define agent behavior, Copilot handles planning, tool invocation, file edits, and more.
| SDK | Location | Cookbook | Installation | API docs |
|---|---|---|---|---|
| Node.js / TypeScript | nodejs/ |
Cookbook | npm install @microsoft/copilot-sdk |
|
| Python | python/ |
Cookbook | pip install microsoft-copilot-sdk |
|
| Go | go/ |
Cookbook | go get github.com/microsoft/copilot-sdk/go/v2 |
API docs |
| .NET | dotnet/ |
Cookbook | dotnet add package Microsoft.Copilot.SDK |
|
| Rust | rust/ |
— | cargo add copilot-sdk |
API docs |
| Java | java/ |
Cookbook | Maven coordinatescom.microsoft:copilot-sdkSee instructions for Maven and Gradle |
API docs |
See the individual SDK READMEs for installation, usage examples, and API reference.
For a complete walkthrough, see the Getting Started Guide.
Quick steps:
A separate CLI installation is not required. Node.js and .NET include platform runtime artifacts, Python downloads them, and Rust bundles them with its default features. Go applications must run the bundler or provide a compatible runtime package; Java applications must add their platform runtime classifier. Follow the language README before starting a client.
Install your preferred SDK using the commands above.
See the SDK README for usage examples and API documentation.
All SDKs drive the Copilot agent runtime over protocol-4 JSON-RPC. The runtime is a standalone component, separate from the Copilot CLI. By default, SDK v2 loads the native Rust runtime into your application through a C ABI and carries framed JSON-RPC messages over an in-memory connection. It does not embed a Node.js interpreter or start a separate runtime process:
Your Application
↓
SDK Client
↓ JSON-RPC (in memory, C ABI)
Native Copilot runtime
The SDK manages its runtime host, but the native library remains loaded for the application process lifetime. In-process hosting provides neither crash isolation nor a sandbox. See Run the Copilot runtime in process for requirements and v2 migration options.
You can also run the runtime outside your application process:
RuntimeConnection.forSpawnedStdio() or RuntimeConnection.forSpawnedTcp() in TypeScript and Java; each SDK has an equivalent). The SDK starts the runtime as a child process and manages its lifecycle. Use it when you need crash isolation or per-client process configuration.copilot-runtime --server yourself and attach to it over TCP with RuntimeConnection.forTcp(host, port). One multi-tenant runtime server can serve many SDK clients and concurrent sessions. See Connecting to a standalone runtime server.For form elicitation callbacks, the portable schema contract is an object form
with modeled properties and optional required fields (type: "object" on
the wire; an SDK may represent the object type implicitly). Applications that
support multiple SDK languages must use the modeled property definitions and
must not depend on additional schema metadata (such as a top-level title) or
on the insertion order of properties.
Node.js and Rust pass through the wire schema, including additional metadata and property order. Python, Go, .NET, and Java reconstruct the callback schema from the modeled fields and do not offer that same preservation guarantee. Treat wire-schema preservation as a language-specific capability, not a cross-language requirement.
Runtimes that grant skill-confirmed-installation expose
skills.planInstall, skills.applyInstall, skills.planUninstall,
skills.applyUninstall, skills.installations.list/recover/status/cancel,
and skills.installations.setEnabled. Skill install reviews include the full
verified SKILL.md content up to 256 KiB, catalogue identity, file manifest,
and non-absolute personal target location. Summaries report ownershipState,
configuredEnabled, sessionState, retained catalogue identity and
installedAt.
Yes, a GitHub Copilot subscription is required to use the Microsoft Copilot SDK, unless you are using BYOK (Bring Your Own Key). With BYOK, you can use the SDK without GitHub authentication by configuring your own API keys from supported LLM providers. For standard usage (non-BYOK), refer to the GitHub Copilot pricing page, which includes a free tier with limited usage.
Billing for the Microsoft Copilot SDK is based on the same model as the Copilot CLI, with each prompt being counted towards your usage allowance. For more information on Copilot usage billing, see Usage in GitHub Copilot.
Yes, the Microsoft Copilot SDK supports BYOK (Bring Your Own Key). You can configure the SDK to use your own API keys from supported LLM providers (e.g. OpenAI, Microsoft Foundry, Anthropic) to access models through those providers. See the BYOK documentation for setup instructions and examples.
Note: BYOK uses key-based authentication only. Microsoft Entra ID (Azure AD), managed identities, and third-party identity providers are not supported.
The SDK supports multiple authentication methods:
copilot CLI loginCOPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKENSee the Authentication documentation for details on each method.
No. The default needs a compatible native runtime, not a separately running CLI. Node.js, .NET, Python, and Rust provide acquisition or bundling; Go needs application-level bundling or an explicit runtime package, and Java needs the platform classifier dependency.
Advanced: You can run a runtime binary you supply as a child process, or connect to a standalone runtime server. See the individual SDK README for language-specific options.
By default, the SDK exposes the Copilot CLI's first-party tools, similar to running the CLI with --allow-all. Tool execution is still governed by each SDK's permission handler, so applications can approve, deny, or customize tool calls. You can customize tool availability by configuring the SDK client options to enable and disable specific tools. Refer to the individual SDK documentation for details on tool configuration and to the Copilot CLI documentation for the list of available tools.
Yes, the Microsoft Copilot SDK allows you to define custom agents, skills, and tools. You can extend the functionality of the agents by implementing your own logic and integrating additional tools as needed. Refer to the SDK documentation of your preferred language for more details.
Yes, check out the custom instructions and SDK-specific guidance:
All models available via Copilot CLI are supported in the SDK. The SDK also exposes a method which will return the models available so they can be accessed at runtime.
The Microsoft Copilot SDK is generally available and follows semantic versioning. See CHANGELOG.md for release notes.
Please use the GitHub Issues page to report bugs or request new features. We welcome your feedback to help improve the SDK.
⚠️ Disclaimer: These are unofficial, community-driven SDKs and they are not supported by GitHub. Use at your own risk.
| SDK | Location |
|---|---|
| Clojure | copilot-community-sdk/copilot-sdk-clojure |
| C++ | 0xeb/copilot-sdk-cpp |
MIT
| 日期 | 榜单 | 排名 | 周期新增 | 总 STAR |
|---|