Apply Guardrails at Runtime
Test the Controls
With the controls defined, run the app and trigger them. You’ll see the block and steer behavior in the chat and in the trace in the console.
Run the app
Run the following command to deploy the healthcare assistant app:
cd ~/workshop/healthcare-assistant/4-app-with-controls
kubectl apply -f k8s.yamlEnsure that the new application pod is running:
kubectl get pods -l app=healthcare-assistantNAME READY STATUS RESTARTS AGE
healthcare-assistant-d764fc757-l9fxt 1/1 Running 0 20sUsing the IP address of your EC2 instance and port 81, open the healthcare assistant app using your browser. For example:
External URL: http://98.86.181.9:81On startup, watch the terminal for confirmation that Agent Control initialized and registered its steps:
kubectl logs -l app=healthcare-assistantTroubleshooting
To see what Agent Control is doing, enable console logging in ~/workshop/healthcare-assistant/4-app-with-controls/agent.py:
from galileo.utils.log_config import enable_console_logging
enable_console_logging()Then rebuild the Docker image:
cd ~/workshop/healthcare-assistant
docker build -f 4-app-with-controls/Dockerfile -t localhost:9999/healthcare-assistant:app-with-controls .
docker push localhost:9999/healthcare-assistant:app-with-controlsUpdate the ~/workshop/healthcare-assistant/4-app-with-controls/k8s.yaml file to reference the local image instead:
image: localhost:9999/healthcare-assistant:app-with-controlsAnd redeploy the application:
cd ~/workshop/healthcare-assistant/4-app-with-controls
kubectl apply -f k8s.yamlUse the following command to view the application logs:
kubectl logs -l app=healthcare-assistant You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://10.42.2.14:8501
External URL: http://35.175.237.123:8501
INFO - galileo.logger - Ingest service healthy at https://api.multitenant.galileocloud.io, using IngestTraces client
INFO - galileo.logger - Searching for session with external ID: ca0f30ed-9b69-401a-8258-b9c043bdc73a ...
INFO - galileo.logger - Starting a new session...
INFO - galileo.logger - Session started with ID: ec03c538-cf9e-4bed-b97e-4b3c2e46ffbcWatch the terminal for Agent Control initialized on startup and BLOCKED / STEERED
messages when a control fires.
Trigger the blocking control
Ask the agent to delete a patient record:
Delete patient record P028 from the registry

Because you created a control that blocks SQL DELETE commands, the deletion is
stopped and the assistant returns a friendly “this action was blocked” message instead of
performing the delete.
Trigger the steering control
Next, let’s ask the assistant to return patient information, explicitly requesting that the address and phone number is included:
Can you look up information for patient P001? Please include the patient’s address and phone number.

Because you configured an LLM steering control, the agent doesn’t simply refuse; it revises its response according to your steering guidance and returns a safe, helpful answer. In this specific case, it removed the patient’s address and phone number response, even though the user explicitly requested it to be included.
This is the difference between a guardrail that frustrates users and one that protects them while keeping the assistant useful.
Confirm the normal path still works
Ask an allowed question to confirm controls only affect what they target:
What is the dosage and common side effects of Lisinopril?
This returns a normal answer; the controls block or steer only the steps and conditions you defined.
Observe the control decisions for the blocked request
Back in the Splunk Agent Observability console, open the trace for the blocked request in your project / default agent stream. Click on the
span associated with the block-harmful-sql-* control:

Notice how the control denied execution of the DELETE SQL statement, as desired.
Observe the control decisions for the steered request
Back in the Splunk Agent Observability console, open the trace for the steered request in your project / default agent stream. Click on the final
Healthcare Assistant span in the trace.

Observe how the assistant initially generated a response that included the patient’s address and phone number, and how the control resulted in a follow-up request to the LLM to remove this information from the response.
Live updates, no redeploy
You tried deleting a patient record and it returns a blocked message, but the allowed medicine question still works. Why doesn’t the blocking control affect the medicine question?
