Documentation home

Java SDK

Use the Java SDK for JVM services and enterprise backends.

Install

First-party Java SDK
Status: Preview
Group/artifact: ai.haltstate:haltstate-sdk
Version: 0.2.0
Local verification status: source present; Java 17 toolchain verification pending on this host.

Do not assume registry publication until external verification passes. Use the repository source for preview evaluation.

Guard shape

HaltStateConfig config = HaltStateConfig.builder(
    System.getenv("HALTSTATE_TENANT_ID"),
    System.getenv("HALTSTATE_API_KEY")
).agentId("retail-refund-agent").build();

try (HaltStateClient client = new HaltStateClient(config);
     GuardContext guard = client.guard("refund.create", Map.of("amount", 126, "currency", "USD"), "refund:lge_123")) {
    executeRefundOnce();
}

HTTP guard fallback

GuardRequest request = GuardRequest.builder()
    .agentId("retail-refund-agent")
    .action("refund.create")
    .idempotencyKey("refund:" + ledgerEntryId)
    .context(Map.of("amount", 126, "currency", "USD"))
    .build();
// POST request before executing the refund.

Implementation notes

Keep the HaltState call as close as possible to the side effect. The agent may plan and draft freely, but the wrapper around the actual action should be the place where authority is checked. That wrapper should send only the context required for policy evaluation: safe identifiers, normalized amounts, action names, risk flags, schedule windows, and redaction status. Raw customer payloads and secrets should stay in the business system or protected operator tooling.

Operational evidence

For each action, preserve the decision, the worker outcome, the idempotency key, safe resource references, latency, proof status, and redaction status. This evidence supports incident response and control narratives because it shows what the system did at runtime rather than only describing what the policy document intended. HaltState supports alignment work; it is not a substitute for legal advice or a compliance certification.