AIToday
Large Language ModelsAI Coding AssistantsGitHub Blog (AI)Published: Aug 11, 2026, 06:01 JST5 min read

GitHub Copilot SDK for Java now available—framework and vendor agnostic

GitHub Copilot SDK for Java now available—framework and vendor agnostic

Key takeaway

  • GitHub has released the Copilot SDK for Java, a framework-agnostic, vendor-neutral client library that lets Java developers build AI agents without being locked into a specific framework or AI provider.

  • The SDK supports any model provider via bring-your-own-key configuration and uses standard Java patterns familiar to enterprise developers.

  • It is available as a Maven dependency and works with both Jakarta EE and Spring environments.

3 Key Points

  1. What happened

    GitHub released the Copilot SDK for Java (version 1.0.7-preview.1), a client library that lets Java developers build AI agents without depending on a specific framework or AI vendor. The SDK works with any model provider—OpenAI, Azure, Anthropic, or custom endpoints—via BYOK (bring-your-own-key) support and requires no Copilot subscription to use with third-party models.

  2. Why it matters

    Until now, Java developers had to choose between Langchain4j (which tied them to that library) or Spring AI (which tied them to Spring's design choices). The new SDK is the first truly framework-agnostic approach for enterprise Java, supporting both Jakarta EE and Spring, and uses familiar Java patterns (CompletableFuture, annotations, lambdas, virtual threads) so existing Java teams can adopt it without learning a new paradigm.

  3. What to watch

    The SDK is available as a Maven dependency and requires JDK 17 or later (JDK 25 recommended for virtual threads). The annotation-based tool API (@CopilotTool) is marked experimental and requires passing the compiler flag -Acopilot.experimental.allowed=true. A complete sample app (real-estate lead-management agent) is available on GitHub running on Open Liberty 26.0.0.5 with Jakarta EE 11.

In Depth

Read the full story

The GitHub Copilot SDK for Java is a client library designed to let Java developers build AI agents without vendor lock-in or framework coupling. It is available as a Maven dependency (com.github:copilot-sdk-java:1.0.7-preview.1) and requires JDK 17 or 25 (with 25 recommended for virtual threads), Maven 3.9 or later, a GitHub account with an active Copilot subscription, and the Copilot CLI version 1.0.71 or later.

The SDK can use any AI model provider—OpenAI, Azure, Anthropic, or any OpenAI-compatible endpoint—by passing a provider configuration with a custom baseUrl and apiKey or bearer token. No Copilot subscription is required if you provide your own model credentials. The core capability is creating Copilot agent sessions, registering tools, sending prompts, and receiving structured responses, all from server-side Java code. The SDK works in both Jakarta EE and Spring environments and uses standard Java patterns: CompletableFuture for async operations, annotations for declarative tool definition, lambdas for inline tool handlers, and virtual threads for scalable concurrency.

The article includes a complete sample application: a real-estate lead-management agent built on Open Liberty 26.0.0.5 (the platform runtime), Jakarta EE 11 (with Faces 4.1, CDI 4.1, WebSocket 2.2, Data 1.0, and Persistence 3.2), PrimeFaces 15.0.16 (for the UI), and an H2 in-memory database with 10 seed property listings. The application accepts customer enquiries (e.g., "I'm looking for a 3-bedroom house in London under £800,000") and spins up an isolated agent on a virtual thread to process each one through a pipeline: validating the request, searching the database for matching properties, and writing a report. Status updates are pushed to the browser in real time via Jakarta WebSocket so users can watch agents progress through phases as the model calls tools.

The SDK exposes tools in two ways. The headline API uses the @CopilotTool annotation on a method, which feels familiar to JAX-RS endpoint authors: @CopilotTool declares the method as callable by the model, and @CopilotToolParam describes each parameter so the model knows what to pass. The SDK generates JSON Schema, argument parsing, and dispatch automatically. Using annotations requires two Maven build steps: passing -Acopilot.experimental.allowed=true to the compiler (because the annotation API is experimental) and registering the SDK as an annotationProcessorPath so the compiler can generate $$CopilotToolMeta classes at compile time. Alternatively, developers can define tools inline using lambda-style ToolDefinition.from(...), useful for tools defined at the call site; this approach also supports .overridesBuiltInTool(true) to replace a built-in tool with custom behavior. Tools can be scattered across multiple classes and registered via ToolDefinition.fromObject(...).

The SDK lets developers customize the system message using SystemMessageConfig with SystemMessageMode.CUSTOMIZE, which lets you replace specific sections (e.g., IDENTITY) while keeping safety guardrails intact, or SystemMessageMode.APPEND to add content after the default message. The agent loop itself is simple: session.sendAndWait(enquiry).get() launches the full agentic loop—the model reasons, calls registered tools (potentially multiple times), and returns its final response. On a virtual thread, .get() is non-blocking and does not consume a platform thread while waiting. Developers can subscribe to real-time session events (session.on(...)) to build responsive UIs; events include tool calls, results, and assistant messages, and can be handled using pattern matching (e.g., if (event instanceof AssistantMessageEvent msg)).

For server-side operation, the client is configured in headless mode (CopilotClientMode.EMPTY) so it talks directly to the Copilot CLI without IDE integration. A custom Executor ensures tool callbacks run with container context. Permission handling uses a sessionConfig.setOnPermissionRequest(...) callback; the sample uses PermissionHandler.APPROVE_ALL for development, but production systems should implement a real permission policy. Jakarta EE integration is central: the SDK composes naturally with Jakarta Concurrency, using a ManagedThreadFactory (configured in server.xml with the virtual attribute) so the container can track threads, apply concurrency policies, and propagate context automatically without manual work.

Context & Analysis

The release addresses a real pain point in Java enterprise development: until now, building AI-driven applications required developers to accept a dependency on a middleware library (Langchain4j) or a specific framework ecosystem (Spring AI). The GitHub Copilot SDK for Java breaks that lock-in by providing a framework-agnostic, vendor-neutral foundation. The BYOK (bring-your-own-key) support means teams can swap AI providers without rewriting their application code, and the lack of a mandatory Copilot subscription requirement signals that this is positioned as a general-purpose agent orchestration library, not just a Copilot-consumption tool.

The SDK's design philosophy aligns with the article's stated belief in open standards: it uses familiar Java primitives (annotations, CompletableFuture, CDI beans, virtual threads) rather than forcing developers into a new model or API shape. The sample application—a Jakarta EE 11 real-estate agent using Open Liberty 26.0.0.5—demonstrates production-grade integration patterns, including proper use of managed thread factories to respect container lifecycle and context propagation. The experimental status of the @CopilotTool annotation API suggests the core agent session and tool registration mechanism is considered stable, but the declarative tool definition surface is still subject to change.

FAQ

Can I use the GitHub Copilot SDK for Java with AI providers other than GitHub Copilot?
Yes. Even though it is called GitHub Copilot SDK, you can use it with any direct model provider such as OpenAI, Azure, Anthropic, or OpenAI-compatible endpoints by passing a provider/ProviderConfig with your own baseUrl and apiKey (or bearer token). No Copilot subscription is required.
What are the system requirements to use the SDK?
You need JDK 17 or 25 (25 is recommended to unlock virtual threads and other modern features), Maven 3.9 or later, a GitHub account with an active Copilot subscription, and the Copilot CLI installed locally at version 1.0.71 or later.
What Java frameworks does the SDK support?
The SDK is framework-agnostic and works in server environments including Jakarta EE and Spring. Developers can build their own agent harness using any well-known Java framework or library of their choice.
GitHub Blog (AI)Read Original Article

Get the latest Large Language Models news every morning

AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.

Free · takes 30 seconds · unsubscribe anytime

Ask AI

Ask AI anything about this article. Q&As are published on this page for other readers too.

Related Articles

Next articleAWS embeds security tool into rivals' AI coding platforms

The AI news that matters, in one minute each morning.

Sign up free