GitHub Copilot SDK: Build AI Agents Into Your Apps With Multi-Language Support
GitHub Copilot SDK is an official multi-platform toolkit that lets developers embed AI agent capabilities into applications across TypeScript, Python, Go, .NET, Java, and Rust.
Building AI-powered applications just got significantly easier. GitHub has released the Copilot SDK, a comprehensive multi-platform development kit that brings the same powerful agent runtime behind Copilot CLI directly into your applications. Whether you're building a code editor, IDE plugin, or custom development tool, this SDK gives you production-ready AI agent capabilities across six major programming languages.
What makes this release particularly exciting is its breadth of language support and the fact that it's backed by GitHub itself. With over 10,000 GitHub stars and 1,300+ forks, the Copilot SDK is rapidly becoming the standard for developers who want to integrate intelligent coding assistance without reinventing the wheel.
What Is GitHub Copilot SDK?
The GitHub Copilot SDK is a collection of language-specific libraries that expose the same engine powering Copilot CLI. Instead of building your own orchestration layer for AI agents, you define agent behavior and let Copilot handle the heavy lifting: planning, tool invocation, file edits, code generation, and more.
The architecture is straightforward:
Your Application
↓
SDK Client
↓ JSON-RPC
Copilot CLI (server mode)
The SDK manages the CLI process lifecycle automatically, so you don't need to worry about spawning processes or managing connections. You can also connect to an external CLI server if you need more control over deployment.
Multi-Language Support: One SDK, Six Platforms
Unlike many AI toolkits that focus on a single language ecosystem, the Copilot SDK provides first-class support for six major programming languages:
- TypeScript/Node.js -
npm install @github/copilot-sdk - Python -
pip install github-copilot-sdk - Go -
go get github.com/github/copilot-sdk/go - .NET -
dotnet add package GitHub.Copilot.SDK - Java - Maven coordinates
com.github:copilot-sdk-java - Rust -
cargo add github-copilot-sdk
Each SDK provides idiomatic APIs for its language while maintaining feature parity. Whether you're building a Node.js web service, a Python data pipeline, or a Rust desktop application, you get the same powerful agent capabilities.
Quick Start Example (TypeScript)
import { CopilotClient, approveAll } from "@github/copilot-sdk";
const client = new CopilotClient();
await client.start();
const session = await client.createSession({
model: "gpt-4o",
onPermissionRequest: approveAll,
});
const done = new Promise<void>((resolve) => {
session.on("assistant.message", (event) => {
console.log(event.data.content);
});
session.on("session.idle", () => resolve());
});
await session.send({ prompt: "Write a function to calculate fibonacci numbers" });
await done;
await session.disconnect();
await client.stop();
Quick Start Example (Python)
import asyncio
from copilot import CopilotClient
from copilot.session_events import AssistantMessageData, SessionIdleData
from copilot.session import PermissionHandler
async def main():
async with CopilotClient() as client:
async with await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4o",
) as session:
done = asyncio.Event()
def on_event(event):
match event.data:
case AssistantMessageData() as data:
print(data.content)
case SessionIdleData():
done.set()
session.on(on_event)
await session.send("Generate a REST API with FastAPI")
await done.wait()
asyncio.run(main())
Key Features That Set It Apart
1. Production-Tested Agent Runtime
The SDK exposes the same battle-tested runtime that powers Copilot CLI. This means you're not experimenting with unproven technology—you're leveraging infrastructure that millions of developers already use daily.
2. Flexible Authentication
The SDK supports multiple authentication methods:
- GitHub signed-in user - Uses stored OAuth credentials
- OAuth GitHub App - Pass user tokens from your GitHub OAuth app
- Environment variables -
COPILOT_GITHUB_TOKEN,GH_TOKEN,GITHUB_TOKEN - BYOK (Bring Your Own Key) - Use your own API keys from OpenAI, Anthropic, or other providers
The BYOK option is particularly interesting: you can use the SDK without GitHub authentication by configuring your own LLM provider keys. This gives you flexibility in how you integrate AI into your applications.
3. Custom Agents and Tools
You're not limited to Copilot's default capabilities. The SDK allows you to define custom agents, skills, and tools. You can extend functionality with your own logic and integrate additional tools as needed.
4. Permission Handling
Tool execution is governed by permission handlers, giving you fine-grained control over what the agent can do. You can approve, deny, or customize tool calls based on your application's security requirements.
Real-World Use Cases
Building a Custom Code Review Tool
Imagine you're building a code review platform. With the Copilot SDK, you can:
- Accept pull request diffs as input
- Send them to a Copilot agent session
- Get intelligent code review comments
- Integrate the feedback directly into your UI
const reviewSession = await client.createSession({
model: "gpt-4o",
systemMessage: "You are a senior code reviewer. Focus on security, performance, and maintainability."
});
await reviewSession.send({
prompt: `Review this code diff:
${pullRequestDiff}`
});
Creating an AI-Powered IDE Plugin
Plugin developers can use the SDK to add Copilot-like features to custom IDEs or code editors. The session-based architecture makes it easy to maintain context across multiple interactions.
Automating Development Workflows
DevOps teams can build agents that:
- Generate boilerplate code for new projects
- Automate documentation generation
- Create test suites from specifications
- Refactor legacy codebases
Key Benefits
- Multi-language support - Build AI agents in TypeScript, Python, Go, .NET, Java, or Rust
- Production-ready - Leverages the same runtime as Copilot CLI
- Flexible authentication - GitHub OAuth, environment variables, or BYOK
- Custom tools and agents - Extend functionality with your own logic
- Permission control - Fine-grained control over agent capabilities
- MIT licensed - Open source and free to use
- Automatic lifecycle management - SDK handles process spawning and cleanup
- Real-time streaming - Get responses as they're generated
Getting Started
To start using the GitHub Copilot SDK:
- Choose your preferred language SDK
- Install via your package manager (npm, pip, go get, etc.)
- For Node.js, Python, and .NET, the Copilot CLI is bundled automatically
- For Go, Java, and Rust, install the CLI manually or ensure it's in your PATH
- Authenticate using your preferred method
- Start building!
Check out the official repository for detailed documentation, examples, and cookbook recipes for each language.
Frequently Asked Questions
Do I need a GitHub Copilot subscription to use the SDK?
Yes, a GitHub Copilot subscription is required for standard usage. However, you can use BYOK (Bring Your Own Key) to access the SDK without GitHub authentication by configuring your own API keys from supported LLM providers like OpenAI or Anthropic.
Is the Copilot CLI required to be installed separately?
For Node.js, Python, and .NET SDKs, the Copilot CLI is bundled automatically as a dependency. For Go, Java, and Rust SDKs, you need to install the CLI manually or ensure it's available in your PATH.
Can I use my own LLM provider instead of GitHub's?
Yes! The SDK supports BYOK (Bring Your Own Key), allowing you to use your own API keys from providers like OpenAI, Anthropic, or Microsoft Foundry. This gives you flexibility in model selection and billing.
What models are supported?
All models available via Copilot CLI are supported in the SDK, including GPT-4o, Claude Sonnet, and others. The SDK also exposes a method to query available models at runtime.
Can I define custom tools for the agent to use?
Yes, you can define custom agents, skills, and tools. The SDK allows you to extend functionality with your own logic and integrate additional tools as needed. Tool execution is still governed by permission handlers for security.
Is the SDK open source?
Yes, the GitHub Copilot SDK is released under the MIT License, making it free to use in both open source and commercial projects.
How is billing handled?
Billing follows the same model as Copilot CLI, with each prompt counting toward your usage allowance. If you use BYOK, billing is handled directly with your chosen LLM provider.
Ready to build AI-powered applications? Check out the CoddyKit courses to level up your development skills and start building with modern AI tools.