GitHub Copilot SDK — Build AI Coding Agents

The engine behind Copilot CLI, now as a programmable SDK. GA since June 2, 2026.

Supports Python, Node.js, Go, .NET, Rust & Java. Embed autonomous coding into your own apps, CI/CD pipelines, and developer tools.

⚡ TL;DR

  • What: Programmable SDK exposing the same agentic AI engine behind GitHub Copilot CLI
  • When: Went GA at Microsoft Build on June 2, 2026
  • Languages: Python, TypeScript/Node.js, Go, .NET, Rust, Java
  • Pricing: SDK is free; requires Copilot subscription (Free tier available, Pro $10/mo, Pro+ $39/mo)
  • Use case: Build custom AI coding agents, automate dev workflows, create developer tools
  • Key differentiator: Same engine as Copilot CLI — multi-file edits, terminal commands, tool orchestration, auto-correction

🧠 What Is the GitHub Copilot SDK?

Think of a traditional coding tool as a smart keyboard that predicts the next word. An AI agent is more like a dedicated assistant — you set a goal, it figures out the steps, uses the right tools, and gets the job done.

The GitHub Copilot SDK exposes the same agentic engine behind Copilot CLI as a programmable library. Instead of typing commands in a terminal, you embed AI coding capabilities directly into your own applications.

Aspect Traditional Chat Agentic SDK
Interaction Single-turn Q&A Multi-turn, goal-oriented
Capability Answers questions, suggests code Plans, executes, edits files, runs tests
Integration External tool or IDE plugin Embedded in your Python/Node/Go apps
Context Single file or snippet Full repo, tools, and permissions

🐍 Quick Start: Python Example

Get started with the Copilot SDK in Python in under 5 minutes.

1. Install

pip install copilot-sdk

2. Authenticate

# Login via GitHub CLI (recommended)
gh auth login

# Or set token directly
export GITHUB_TOKEN=ghp_your_token_here

3. Create Your First Agent

from copilot_sdk import CopilotAgent

agent = CopilotAgent(
    model="claude-sonnet-4",   # or gpt-4.1, gemini-2.5-pro
    workspace="/path/to/your/project"
)

# Ask the agent to do something
result = agent.run(
    "Add a /health endpoint to the Flask app that returns "
    "JSON with status, uptime, and version. Add tests."
)

print(result.summary)
print(f"Files modified: {result.files_changed}")
print(f"Tests passed: {result.tests_passed}")

4. Advanced: Custom Tools

from copilot_sdk import CopilotAgent, Tool

# Register custom tools the agent can use
agent = CopilotAgent(
    model="claude-sonnet-4",
    workspace="/path/to/project",
    tools=[
        Tool(name="deploy", fn=lambda ctx: deploy_to_staging()),
        Tool(name="test", fn=lambda ctx: run_pytest()),
    ],
    permissions={"file_write": True, "terminal": True}
)

# Agent autonomously uses tools as needed
result = agent.run("Refactor the auth module, run tests, deploy to staging")

📦 Quick Start: Node.js / TypeScript

npm install @github/copilot-sdk
import { CopilotAgent } from "@github/copilot-sdk";

const agent = new CopilotAgent({
  model: "gpt-4.1",
  workspace: process.cwd(),
});

const result = await agent.run(
  "Add rate limiting middleware to all API routes. " +
  "Use Redis for distributed rate limiting. " +
  "Add unit tests for the middleware."
);

console.log(result.summary);
console.log(`Modified ${result.filesChanged.length} files`);

🐹 Quick Start: Go

go get github.com/github/copilot-sdk-go
package main

import (
    "fmt"
    copilot "github.com/github/copilot-sdk-go"
)

func main() {
    agent := copilot.NewAgent(copilot.Config{
        Model:     "claude-sonnet-4",
        Workspace: ".",
    })

    result, err := agent.Run(
        "Convert all database queries from raw SQL to use sqlx. " +
        "Add connection pooling. Write migration scripts.",
    )
    if err != nil {
        panic(err)
    }

    fmt.Println(result.Summary)
    fmt.Printf("Files changed: %d\n", len(result.FilesChanged))
}

🌐 Supported Languages (6)

🐍
Python
pip install copilot-sdk
📦
Node.js / TS
npm i @github/copilot-sdk
🐹
Go
go get copilot-sdk-go
🔷
.NET (C#)
dotnet add package
🦀
Rust
cargo add copilot-sdk
Java
Maven / Gradle

⚖️ Copilot SDK vs CLI vs App vs VS Code

Feature VS Code CLI App SDK
Type IDE extension Terminal tool Desktop app Programmable library
Multi-file edits ✅ (Agent Mode)
Terminal commands
Parallel sessions
Embeddable
Custom tools MCP only MCP only MCP + SDK Full API
Rubber Duck
Voice input
Best for Individual devs Terminal power users Team orchestration Platform builders

💰 Copilot SDK Pricing (June 2026)

The SDK itself is free. You need a GitHub Copilot subscription to use it.

Plan Price Premium Requests Overage Best For
Free $0 50/mo N/A Trying the SDK
Pro $10/mo 300/mo $0.04/req Individual developers
Pro+ $39/mo 1,500/mo $0.04/req Heavy SDK users
Business $19/seat/mo 300/seat/mo $0.04/req Teams
Enterprise $39/seat/mo 1,000/seat/mo $0.04/req Large organizations

⚠️ Important: GitHub Copilot switched to token/request-based billing in June 2026. Heavy SDK users on agent loops should monitor usage carefully — overages at $0.04/request can add up fast.

🔑 BYOK: Use Your Own API Keys

BYOK (Bring Your Own Key) lets you use the Copilot SDK with your own API keys from model providers, bypassing GitHub's billing entirely. Great for heavy usage or enterprise deployments.

Anthropic Claude
claude-opus-4-7, claude-sonnet-4-6
Get API Key →
OpenAI GPT
gpt-4.1, o3, o4-mini
Get API Key →
Google Gemini
gemini-2.5-pro, gemini-2.5-flash
Get API Key →

🚀 What Can You Build with the Copilot SDK?

🤖 Custom CI/CD Agent

Auto-fix failing tests in PRs. The agent reads the test output, understands the failure, edits the code, and pushes a fix — all in your CI pipeline.

📱 Slack/Teams Bot

Build a dev assistant bot that takes natural language requests in Slack and creates PRs. "Add dark mode to the settings page" → PR ready for review.

🔄 Automated Refactoring

Schedule SDK sessions to modernize legacy code. Migrate from Express to Fastify, convert callbacks to async/await, upgrade dependencies.

📊 Code Review Agent

Use the Rubber Duck and security review capabilities programmatically. Auto-review every PR for security issues, performance problems, and style violations.

🧪 Test Generation

Point the SDK at untested code and ask it to generate comprehensive test suites. It reads the codebase context, writes tests, and runs them.

📚 Documentation Bot

Auto-generate and update documentation. The SDK reads your code, generates docs, and creates a PR. Keep docs in sync with code automatically.

⚔️ Copilot SDK vs Alternatives for Building AI Agents

Platform Type Price Key Advantage
Copilot SDK Agentic coding SDK $0-39/mo GitHub ecosystem integration
Anthropic Claude API Raw LLM API Pay per token Best coding model (Opus 4.7)
OpenAI Codex Cloud agent $20-200/mo Async PR generation
Vercel AI SDK App framework Free (open source) Best for web app integration
LangChain Agent framework Free (open source) Most flexible, any LLM

🆕 New in Copilot CLI (June 2, 2026)

These CLI features are also available through the SDK:

  • NEW
    /rubber-duck — Second-opinion agent that reviews your plans before Copilot acts. Catches blind spots, design flaws, and edge cases. GA.
  • NEW
    /security-review — Dedicated security evaluation path. Checks for vulnerabilities in the current implementation. GA.
  • NEW
    Voice Input — Hands-free coding with on-device audio processing. Privacy-first: no audio leaves your machine. GA.
  • NEW
    Prompt Scheduler — Run prompts on a cron-like timer. Schedule recurring tasks like code reviews, dependency updates, or test runs. Experimental.
  • NEW
    Terminal UI — New experimental rich terminal interface for the CLI. Improved session management and output formatting. Experimental.

❓ Frequently Asked Questions

Do I need a Copilot subscription to use the SDK?

Yes. The SDK is free but requires authentication via a GitHub Copilot subscription. The Free tier gives you 50 premium requests/month — enough to experiment. For production use, Pro ($10/mo) or Pro+ ($39/mo) is recommended.

Can I use the SDK in production?

Yes. The SDK went GA (Generally Available) on June 2, 2026. It's designed for production use in CI/CD pipelines, developer tools, and enterprise workflows. The Cloud Sessions feature lets you run SDK sessions on GitHub-hosted compute.

How is this different from using the Claude API directly?

The Claude API gives you raw model access — you build everything yourself (tool calling, file editing, terminal access, error handling). The Copilot SDK provides a complete agentic runtime with built-in file operations, terminal commands, git integration, and the Rubber Duck review system. It's higher-level and more opinionated.

Can I switch models mid-session?

Yes. You can configure the model per session and even use BYOK to route through your own API keys. Some developers use Claude Opus for complex reasoning and GPT-4.1 for faster, cheaper tasks — switching models based on complexity.

What about rate limits?

Free tier: 50 premium requests/month. Pro: 300/month. Pro+: 1,500/month. Overage is $0.04/request. BYOK users are limited only by their model provider's rate limits. Heavy SDK agent loops can burn through requests fast — monitor usage in your GitHub settings.

📊 Track AI & Developer Trends in Real-Time

TrendPulse tracks 50+ stocks, 20+ crypto, HN, Reddit, ProductHunt, and market sentiment — all in one dashboard. Get the signals before the crowd.