athina.guard()
is a simple function that allows you to run evals as guardrails around your AI application.
It’s a simple function that takes in a suite (list) of evals to run, and an input text
.
guard
will run all the evals in parallel on the given input. If any eval fails, it will raise an AthinaGuardException
which you can catch and handle in your application.
PromptInjection
eval to detect prompt injection attacks in the user query.
If the eval fails, we catch the AthinaGuardException
and handle it by using a fallback message.
athina.guard()
to guard LLM responses. Here’s an example:
AthinaGuardException
and handle it by using a fallback message.
athina.guard()
impact latency?athina.guard()
Guard will run evaluations in parallel to minimize latency impact.