Lesson 3 of 5 · 8 min
Tutorial: write a guardrail policy in plain language
Walk through the planned Guardrino assistant turning a sentence such as “anonymise driving licence numbers” into a precise rule at the right layer, checked against examples and tested before it goes live.
The people who know what a company’s AI should and should not do are rarely the people who write detection rules: a compliance officer, a head of customer service, a product owner. Guardrino’s policy assistant is designed for them. You describe a rule in your own words, in Arabic, English or French, and the assistant proposes rules at the right layer. Nothing changes until you add them to a draft, test them and deploy.
Step 1: say what you want
Write the outcome, not the technique. For example:
- “Anonymise driving licence numbers.”
- “أخفِ أرقام رخص القيادة.”
- “Masque les numéros de permis de conduire.”
Step 2: answer the assistant’s questions
A good assistant asks before it guesses. An Emirates ID or an IBAN has a published structure and check digits, so a rule can recognise it precisely. A driving licence number does not: formats differ by country and emirate, and there is no public check digit. So the assistant is designed not to invent a format. It asks for a few real-looking examples (you can type made-up ones in the right shape), and it proposes a cautious rule that only fires when a context word is nearby, such as “licence”, “رخصة” or “permis”.
That one question is the difference between a rule that protects your customers and one that masks every eight-digit order number in your support chats.
Step 3: the assistant picks the layer
| What you asked for | Where it lands | Why |
|---|---|---|
| A value with a recognisable shape: a licence number, a staff ID, a contract reference | Layer 1, fast rules | A pattern with context words is precise and runs on every message. |
| A word or a name: “block the competitor name Example Rival Bank” | Layer 1, your block list | An exact term needs no model. |
| A value that is always fine: “allow our support number” | Layer 1, your allow list | So it is never masked by mistake. |
| Named things in free text, such as people’s names and addresses | Entity recognition (planned for a later stage) | Names have no fixed shape; they need a model that reads language. |
| A meaning: “don’t discuss our pricing negotiations” | Layer 3, a meaning-based rule | Only a review of what is really being said can apply it. |
Step 4: check it against examples
Before you add anything, the assistant runs the proposed rule on the examples you gave and on a set of ordinary messages:
- Should match: the licence numbers you supplied are found.
- Should not match: the order numbers and dates you supplied are left alone.
- Ordinary messages: how many clean messages the rule would flag. Any number above zero deserves a look before you continue.
Here is a sketch of what the resulting rule could look like in the policy file. It is illustrative; the final format may differ.
app: customer-support
rules:
- id: driving-licence
layer: fast-rules
find: pattern learned from your examples
only_near: ["driving licence", "رخصة قيادة", "permis de conduire"]
action: mask # the model sees [DRIVING_LICENCE_1]
tests:
should_match: ["My driving licence number is <example>"]
should_pass: ["Order <example> was delivered yesterday"]Step 5: draft, test, deploy
- Add to draft. The live policy has not changed; the assistant only ever edits the draft.
- Run the rule tests. The draft and the live policy run side by side on every must-catch and must-pass case.
- Deploy through the gate. It opens only when the tests pass on exactly this draft, or when a failing case is acknowledged with a written reason that goes to the audit log.
- Start in watch-only mode if you like: see what the rule would have done on real traffic before it acts.
Writing requests that work
- One rule per request. “Mask licence numbers” and “block competitor names” are two requests.
- Name the action: mask, warn, ask to rephrase or block. Masking keeps the conversation going and is often the best choice for personal data.
- Give examples in every language and script your customers use, including Arabizi if they write it.
- Say who it is for when it matters: a rule for an anonymous website chat can be stricter than one for an internal staff tool.
Key takeaways
- Describe the outcome in your own words; the planned assistant turns it into rules at the right layer.
- A good assistant asks for examples and context words instead of inventing a format.
- Shapes go to fast rules, names in free text to entity recognition, meanings to the deeper review.
- Every rule is checked on examples and ordinary messages, then drafted, tested and deployed through the gate.
Check yourself
1. Why does the assistant ask for examples of a driving licence number?
- To store real licences
- Licence formats differ by country and emirate and have no public check digit, so it will not invent one — Right.
- Because it cannot read Arabic
- To slow you down
Examples and context words make the rule precise without guessing.
2. Where should “don’t discuss our pricing negotiations” be enforced?
- A block list
- An allow list
- A meaning-based rule in the deeper review — Right.
- Nowhere
A topic is about meaning, which only a review of what is said can judge.
3. What happens when you click “Add to draft”?
- The rule is live at once
- Nothing changes in the live policy until the draft is tested and deployed — Right.
- The rule is emailed to users
- The policy is deleted
The assistant only edits the draft; deployment goes through the tests and the gate.
Sources
- Guardrino, HisnLabs (in development)
- Data masking (Wikipedia)
- International Bank Account Number (IBAN), check digits (Wikipedia)
Put it into practice on your Mac
Try every feature free for 17 days, no card needed.