Why legal says no
Most AI features stall in review for the same reason: nobody can explain what the model will and won't do. Guardrails are how you turn "it's probably fine" into something a lawyer can read.
Write the policy before the prompt
List what the feature must never do (give legal or medical advice, quote prices, promise delivery dates), what it must always do (cite sources, hand off to a human on request), and what data it may see. That list becomes your tests.
Layer the defences
- Input checks: strip personal data you don't need and block obvious prompt-injection patterns.
- Scoped tools: the model can only call the actions it needs, with the permissions of the user, never more.
- Output checks: a second pass that rejects answers breaking the policy list.
- Human hand-off: a clear path to a person when confidence is low or the topic is sensitive.
What we show legal
A one-page policy, the eval results against it, and a log of refused requests from testing.
Test the guardrails like features
We keep an adversarial test set (jailbreak attempts, off-topic requests, edge cases from real users) and run it on every change. A guardrail that isn't tested is a hope, not a control.
Keep it useful
Over-tight guardrails make a product nobody uses. Measure refusals as well as violations, and review both every week.
Sumudu Jayasinghe, AI Native Solution Architect
architecture, AI system design, code review