Overview
- Set up a project with Splunk Agent Observability
- Create your AI application
- Configure Luna-3 evaluators
- Run your app again to evaluate these evaluators
- Adjust your prompt to increase toxicity and add a prompt injection
Before you start
To complete this how-to, you will need:- An OpenAI API key
- A Splunk Agent Observability project configured to use the Luna-3 model
- Your Splunk Agent Observability API key
Install dependencies
To use Splunk Agent Observability, you need to install some package dependencies, and configure environment variables.Install Required Dependencies
Create a .env file, and add the following values
Create your AI application
Create a file for your app called app.py or app.ts.
Add the following code to this file
Run the app to ensure everything is working
View the app in the Splunk Agent Observability UI
Configure Luna-3 evaluators
Now you can configure evaluators using Luna-3. You will be adding evaluators to look for toxicity and prompt injection attacks in the input.Configure Evaluators for the Agent Stream

Turn on the Luna-3 input toxicity and prompt injection Evaluators


Save and close the evaluator configuration tab
Run your app again to use these evaluators
Run your app again
View the traces for your app in the Splunk Agent Observability UI

Adjust your prompt to increase toxicity and add a prompt injection
Now that your app is measuring evaluators using Luna-3, you will change the prompt to see them in action.Update the prompt
Run your app again
View the traces for your app in the Splunk Agent Observability UI
