Quickly secure your app from Prompt Injection, Sensitive Topics, and Topic Restriction
All
guardrail, which checks for all three aspects at once, using openlit.guard
. Additionally, we’ll show you how to collect OpenTelemetry metrics during the guardrail process.
Initialize Guardrails in Your Application
openlit.guard.PromptInjection()
, openlit.guard.SensitiveTopics()
, or openlit.guard.TopicRestriction()
.For details on how it works, and to see the supported providers, models, and parameters to pass, check our Guardrails Guide.Collecting Guardrail Metrics
openlit.guard
module integrates with OpenTelemetry to track guardrail metrics as a counter, including score details and validation metadata. To enable metric collection, initialize OpenLIT with metrics tracking: