
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.
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.
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.
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.
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.
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.
AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.
Free · takes 30 seconds · unsubscribe anytime
Ask AI anything about this article. Q&As are published on this page for other readers too.
Amazon and Google are intensifying competitive efforts against The Trade Desk (TTD), a major digital advertisi…
HireRoad, an HR software company, scrapped its 18-month legacy product rewrite plan and instead reorganized it…

OpenAI introduced Premium Seats for ChatGPT Business, priced at $125 per user per month ($100 with annual bill…

Computer scientists at University of Tübingen, Max Planck Institute, MATS Research, and Snyk discovered a meth…

Researchers at A Security disclosed vulnerabilities in Zoom's screen-sharing annotation protocol on Tuesday th…

Anthropic pledged to embed machine-readable watermarks in Claude-generated text and digitally signed provenanc…

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