BoundaryDesk: Using Shieldstral to Enforce LLM Guardrail Policies in Java

A developer built BoundaryDesk, a Java example that tests how an LLM application decides between conflicting policies, such as an internal security-research assistant versus a public support bot. The system uses Shieldstral, a classifier that scores inputs and outputs against a supplied policy, with Quarkus LangChain4j connecting it to the answering model. The article explains how classifier scores translate into application decisions and how to tell a rejected request apart from a classifier outage. It also covers evaluating thresholds, with deterministic tests for the request path and a separate real-model evaluation for the classifier. The project pins Java 21, Quarkus 3.38.1, and LangChain4j, and runs Shieldstral via vLLM behind an OpenAI-compatible API, which requires a Linux host with an NVIDIA GPU for the real-model path.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in