Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to the AxonFlow Java SDK will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.1.0] - 2026-04-06

### Added

- **`GovernedTool` adapter** — framework-agnostic tool governance wrapper. Wraps any `Tool` interface with input/output policy enforcement (`mcpCheckInput` before execution, `mcpCheckOutput` after). Factory: `GovernedTool.wrap(tool, client)`, builder pattern, batch helper: `GovernedTool.governTools(tools, client)`.
- **`checkToolInput()` / `checkToolOutput()`** — generic aliases for tool governance. Existing `mcpCheckInput()` / `mcpCheckOutput()` remain supported. Async variants included.

### Changed

- Anonymous telemetry is now enabled by default for all endpoints, including localhost/self-hosted evaluation. Opt out with `DO_NOT_TRACK=1` or `AXONFLOW_TELEMETRY=off`.

---

## [5.0.0] - 2026-04-05

### BREAKING CHANGES
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.getaxonflow</groupId>
<artifactId>axonflow-sdk</artifactId>
<version>5.0.0</version>
<version>5.1.0</version>
<packaging>jar</packaging>

<name>AxonFlow Java SDK</name>
Expand Down
124 changes: 118 additions & 6 deletions src/main/java/com/getaxonflow/sdk/AxonFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,17 @@ public HealthStatus healthCheck() {
},
"healthCheck");

if (status.getSdkCompatibility() != null
&& status.getSdkCompatibility().getMinSdkVersion() != null
String minJavaVersion =
status.getSdkCompatibility() != null
? status.getSdkCompatibility().getMinSdkVersionFor("java")
: null;
if (minJavaVersion != null
&& !"unknown".equals(AxonFlowConfig.SDK_VERSION)
&& compareSemver(
AxonFlowConfig.SDK_VERSION, status.getSdkCompatibility().getMinSdkVersion())
< 0) {
&& compareSemver(AxonFlowConfig.SDK_VERSION, minJavaVersion) < 0) {
logger.warn(
"SDK version {} is below minimum supported version {}. Please upgrade.",
AxonFlowConfig.SDK_VERSION,
status.getSdkCompatibility().getMinSdkVersion());
minJavaVersion);
}

return status;
Expand Down Expand Up @@ -2225,6 +2226,117 @@ public CompletableFuture<MCPCheckOutputResponse> mcpCheckOutputAsync(
() -> mcpCheckOutput(connectorType, responseData, options), asyncExecutor);
}

// ========================================================================
// Tool Input/Output Check Aliases
// ========================================================================

/**
* Alias for {@link #mcpCheckInput(String, String)}. Validates tool input against configured
* policies.
*
* @param connectorType name of the MCP connector type (e.g., "postgres")
* @param statement the statement to validate
* @return MCPCheckInputResponse with allowed status, block reason, and policy info
* @throws ConnectorException if the request fails (note: 403 is not an error, it means blocked)
*/
public MCPCheckInputResponse checkToolInput(String connectorType, String statement) {
return mcpCheckInput(connectorType, statement);
}

/**
* Alias for {@link #mcpCheckInput(String, String, Map)}. Validates tool input against configured
* policies.
*
* @param connectorType name of the MCP connector type (e.g., "postgres")
* @param statement the statement to validate
* @param options optional parameters: "operation" (String), "parameters" (Map)
* @return MCPCheckInputResponse with allowed status, block reason, and policy info
* @throws ConnectorException if the request fails (note: 403 is not an error, it means blocked)
*/
public MCPCheckInputResponse checkToolInput(
String connectorType, String statement, Map<String, Object> options) {
return mcpCheckInput(connectorType, statement, options);
}

/**
* Asynchronous alias for {@link #mcpCheckInputAsync(String, String)}.
*
* @param connectorType name of the MCP connector type
* @param statement the statement to validate
* @return a future containing the check result
*/
public CompletableFuture<MCPCheckInputResponse> checkToolInputAsync(
String connectorType, String statement) {
return mcpCheckInputAsync(connectorType, statement);
}

/**
* Asynchronous alias for {@link #mcpCheckInputAsync(String, String, Map)}.
*
* @param connectorType name of the MCP connector type
* @param statement the statement to validate
* @param options optional parameters
* @return a future containing the check result
*/
public CompletableFuture<MCPCheckInputResponse> checkToolInputAsync(
String connectorType, String statement, Map<String, Object> options) {
return mcpCheckInputAsync(connectorType, statement, options);
}

/**
* Alias for {@link #mcpCheckOutput(String, List)}. Validates tool output against configured
* policies.
*
* @param connectorType name of the MCP connector type (e.g., "postgres")
* @param responseData the response data rows to validate
* @return MCPCheckOutputResponse with allowed status, redacted data, and policy info
* @throws ConnectorException if the request fails (note: 403 is not an error, it means blocked)
*/
public MCPCheckOutputResponse checkToolOutput(
String connectorType, List<Map<String, Object>> responseData) {
return mcpCheckOutput(connectorType, responseData);
}

/**
* Alias for {@link #mcpCheckOutput(String, List, Map)}. Validates tool output against configured
* policies.
*
* @param connectorType name of the MCP connector type (e.g., "postgres")
* @param responseData the response data rows to validate
* @param options optional parameters: "message" (String), "metadata" (Map), "row_count" (int)
* @return MCPCheckOutputResponse with allowed status, redacted data, and policy info
* @throws ConnectorException if the request fails (note: 403 is not an error, it means blocked)
*/
public MCPCheckOutputResponse checkToolOutput(
String connectorType, List<Map<String, Object>> responseData, Map<String, Object> options) {
return mcpCheckOutput(connectorType, responseData, options);
}

/**
* Asynchronous alias for {@link #mcpCheckOutputAsync(String, List)}.
*
* @param connectorType name of the MCP connector type
* @param responseData the response data rows to validate
* @return a future containing the check result
*/
public CompletableFuture<MCPCheckOutputResponse> checkToolOutputAsync(
String connectorType, List<Map<String, Object>> responseData) {
return mcpCheckOutputAsync(connectorType, responseData);
}

/**
* Asynchronous alias for {@link #mcpCheckOutputAsync(String, List, Map)}.
*
* @param connectorType name of the MCP connector type
* @param responseData the response data rows to validate
* @param options optional parameters
* @return a future containing the check result
*/
public CompletableFuture<MCPCheckOutputResponse> checkToolOutputAsync(
String connectorType, List<Map<String, Object>> responseData, Map<String, Object> options) {
return mcpCheckOutputAsync(connectorType, responseData, options);
}

// ========================================================================
// Policy CRUD - Static Policies
// ========================================================================
Expand Down
Loading
Loading