Class AntsGuardrailsClient

java.lang.Object
com.ants.platform.guardrails.AntsGuardrailsClient

public class AntsGuardrailsClient extends Object
HTTP client for the ANTS guardrail ML-check API.

Guardrails are only active when an agentId is provided AND the agent has a guardrail policy configured on the platform. If no policy exists, the client caches that fact and skips HTTP calls on subsequent requests.


 var guardrails = AntsGuardrailsClient.builder()
     .antsApiKey("pk:sk")
     .agentId("agent_123")
     .build();

 GuardrailResult result = guardrails.checkInput("My SSN is 123-45-6789");
 if (result.getResult() == GuardrailResult.Result.BLOCKED) {
     throw new GuardrailViolationException("input", result);
 }