Technologies

GitHub Launches Copilot SDK for Java to Develop Framework-Independent AI Agents

GitHub has introduced the Copilot SDK for Java, which enables server-side Java applications to create sessions for Copilot agents, register tools, send prompts, and receive structured responses. The library is currently available as a preview release and supports Jakarta EE and Spring environments, as well as the BYOK option.

2026-08-10
4 min read
1,914 views
certi.news Editorial Team
GitHub Launches Copilot SDK for Java to Develop Framework-Independent AI Agents

GitHub announced Copilot SDK for Java, a client library that enables server-side Java applications to programmatically drive Copilot agents by creating agent sessions, registering tools, sending prompts, and receiving structured responses. GitHub says the library was designed to be independent of Java frameworks and also provides support for the BYOK option, making it not tied to a single artificial intelligence provider.

The library targets Java developers working on enterprise applications and runs in server environments, including Jakarta EE and Spring. It uses interfaces familiar to Java developers, such as CompletableFuture, annotations, lambdas, and virtual threads, rather than imposing an approach tied to a specific framework.

Availability and Requirements

The library is currently available as a Maven dependency, version 1.0.7-preview.1. Its use requires the following:

  • JDK 17 or JDK 25, with JDK 25 recommended to take advantage of virtual threads and other modern features.
  • Maven 3.9 or later.
  • A GitHub account with an active Copilot subscription.
  • Copilot CLI installed locally, version 1.0.71 or later.

GitHub's post presents a complete sample application built on Jakarta EE 11, with the source code provided for experimentation. The company also confirms that developers can build their own agents using the Java frameworks and libraries they choose.

Sample Real Estate Request Management Application

The example uses an application for managing leads in the real estate sector. When a client submits a request, such as searching for a three-bedroom home in London priced below £800,000, the system creates an isolated Copilot agent on a virtual thread to process the request within a defined workflow.

The application uses Jakarta WebSocket to send real-time status updates from the server to the browser, enabling users to track the agents' progress as they call tools. Multiple requests can also be sent at the same time, with each request processed independently within its own Copilot session.

Defining and Managing Tools

The library provides the @CopilotTool interface for defining tools that the model can call. The developer specifies a regular Java method, while the library generates the JSON schema, parses the arguments, and dispatches the call. @CopilotToolParam can be used to describe each parameter so the model knows the value expected from it.

This annotation interface is currently experimental, so experimental SDK interfaces must be enabled through the compiler option -Acopilot.experimental.allowed=true, along with registering the library in the annotation processor path in the Maven configuration. The processing generates tool metadata during compilation.

In addition to annotations, tools can be defined directly at the point of use through a lambda-based approach using ToolDefinition.from(...). This allows a tool to be created without a dedicated method, while overridesBuiltInTool(true) provides a way to replace a built-in tool with custom behavior. Tools can also be placed in classes separate from the agent logic and then registered through ToolDefinition.fromObject.

Messages and the Agent Workflow

The SDK allows the system message to be customized through SystemMessageMode.CUSTOMIZE, replacing specific sections while retaining the rest of the message, including safety guardrails. It also provides APPEND mode to add content to the default system message without replacing it.

The agent's complete workflow begins through sendAndWait(...). When the prompt is sent, the model can reason and call the registered tools multiple times before returning the final result, while the library passes the tool results back to the model until the task is complete. Virtual threads allow waiting through get() without consuming a traditional thread while waiting for the result. session.on(...) also enables handling events emitted by the session.

News source
c
Author

certi.news Editorial Team

What you need to know

GitHub has launched the Copilot SDK for Java, currently available as a preview release to help server-side Java applications create Copilot agents and programmatically manage their sessions and tools. It is available as a Maven dependency and supports Jakarta EE, Spring, and BYOK, but requires a GitHub account with a Copilot subscription and Copilot CLI installed.

  • The available release is 1.0.7-preview.1 and requires JDK 17 or JDK 25 and Maven 3.9 or later.
  • The SDK enables creating agent sessions, sending prompts, receiving structured responses, and registering tools that the model can invoke.
  • The library is designed to be independent of Java frameworks and supports Jakarta EE and Spring environments.
  • Tools can be defined using annotations such as @CopilotTool or through ToolDefinition.from and ToolDefinition.fromObject.
  • Using the experimental SDK APIs requires enabling the -Acopilot.experimental.allowed=true option in the compiler settings.
  • A GitHub example presents an application for managing real estate requests using isolated agents, Java virtual threads, and real-time status updates through Jakarta WebSocket.

FAQ

What is the GitHub Copilot SDK for Java?

It is a client library that enables server-side Java applications to programmatically drive Copilot agents, including creating sessions, registering tools, sending prompts, and receiving structured responses.

What are the prerequisites for using the library?

It requires JDK 17 or JDK 25, Maven 3.9 or later, a GitHub account with an active Copilot subscription, and Copilot CLI version 1.0.71 or later installed.

Does the library support specific Java frameworks?

The library works in server environments, including Jakarta EE and Spring, while being designed independently of any specific Java framework.

Can an AI provider not tied to a single vendor be used?

The library supports BYOK, which GitHub describes as enabling freedom from being tied to a single AI provider.

In the same category

You may also like

View all news