Java SDK
A Jackson-based Java REST client on java.net.http.HttpClient, requiring Java 17+.
A Jackson-only REST client published as ai.vibrantcapital:autopil-java:0.1.0. Uses java.net.http.HttpClient (no external HTTP library). Requires Java 17+.
Set AUTOPIL_BASE_URL and AUTOPIL_API_KEY as environment variables. Get your key from the dashboard under Settings → API Keys (evaluate scope for agent code).
Install
<dependency>
<groupId>ai.vibrantcapital</groupId>
<artifactId>autopil-java</artifactId>
<version>0.1.0</version>
</dependency>
Usage
AutoPILClient client = AutoPILClient.builder()
.baseUrl(System.getenv("AUTOPIL_BASE_URL")) // https://your-app.onrender.com
.apiKey(System.getenv("AUTOPIL_API_KEY"))
.build();
// Evaluate a retrieval request
EvaluateResponse resp = client.context().evaluate(
EvaluateRequest.builder()
.agentRole("loan_underwriter")
.userId("user_001")
.sourceId("credit_scores")
.sensitivityLevel("high")
.sessionId(sessionId)
.build()
);
if ("DENY".equals(resp.getDecision())) {
throw new SecurityException(resp.getReason());
}
// Query audit events
AuditTrail trail = client.audit().getSession(sessionId);
List<AuditEvent> events = client.audit().listEvents("loan_underwriter", "DENY", 50);
Client resources
Client resources:
| Resource | Methods |
|---|---|
client.context() | evaluate(EvaluateRequest) |
client.audit() | getSession(), listEvents(), getStats(), recordLineage() |
client.sessions() | list(), get(), revoke() |
client.policies() | list(), create(), update(), delete(), reload() |
client.health() | — no auth required |
AutoPILException (unchecked) carries getStatusCode() and getDetail(). All request types use builder pattern. JUnit 5 test suite included.
Was this page helpful?