LLM guardrails catch known violations. They don’t catch when your model gives different verdicts on the same input. Semantic entropy measures output consistency by sampling the model multiple times, clustering similar responses, and computing Shannon entropy. Low entropy means the model agrees with itself. High entropy means it doesn’t. Flag it. Built with Python and AWS Bedrock Converse API.
