Guardrails and Chat Generation Explorer - not working...
I've been playing with AI Guardrails using the recipes:
* https://www.drupal.org/project/ai_recipe_guardrails_pii
* https://www.drupal.org/project/ai_recipe_guardrails_prompt_safety
When I use the Chat generation explorer (/admin/config/ai/explorers/chat_generator) with the prompt:
> My knee is really hurting. Should I take some aspirin?
With the appropriate guardrail enabled in the Advanced section: Guardrails: Guardrails set: Prompt safety: Liability
Using Claude Sonnet 4.6 (or similar), it doesn't appear that the guardrail is stopping anything. The response I get is:
> I'm sorry to hear your knee is hurting. Here are some things to consider: **Aspirin might help if:** - It's mild pain or inflammation - You have no contraindications (stomach issues, blood thinners, allergies) - It's a short-term issue **Some general options for knee pain:** - **Rest** the knee - **Ice** for swelling (20 min on/off) - **Elevation** to reduce swelling - **OTC pain relievers** like aspirin, ibuprofen (anti-inflammatory), or acetaminophen **Consider seeing a doctor if:** - The pain is severe or sudden - There's significant swelling or bruising - You can't bear weight on it - It followed an injury - Pain persists more than a few days **A few cautions about aspirin:** - Can irritate the stomach - Not recommended if you take blood thinners - Ibuprofen may actually work better for joint inflammation Is there anything specific about your knee pain - like whether it came from an injury, how long it's been hurting, or other symptoms? That might help give you more relevant information. *Note: I'm not a doctor, so for persistent or serious pain, professional medical advice is best.*
I'm expecting to only see the contents of the "Message to send if invalid topics are present" setting as configured in the guardrail (whose contents are "This assistant cannot provide medical advice. Please consult a qualified healthcare professional.")
I also tried the same prompt in an existing agent I have (not via the AI Explorer) with similar results. What am I missing?
-mike
issue