Write your own pattern¶
Purpose: no built-in pattern knows your staff numbers or your clients' project codes. A pattern of your own is a regular expression in a category; try it on sample text, then use it in a policy, and it's checked on every call like the 232 built in.
In the demo world, Grachtwerk's staff numbers look like GWS-12345. The pattern \bGWS-[0-9]{5}\b finds them, in the
organisation's own category people_data, and the organisation watches for a month before blocking.
Before you start¶
- You're an organisation admin.
Steps¶
- Open Policies › Guardrails and the Patterns tab.
- Choose New pattern.
- Give it a name ("Grachtwerk staff number"), a category, its Severity (Low, Medium, High or Critical) and the expression.
- Optionally:
- What it finds, in VidaiGuard's words (for example
emailoriban), so VidaiGuard for the same thing works beside it; - a Check digit (Luhn for card numbers, mod 97 for IBANs, ABA for US routing numbers, Verhoeff for Aadhaar): a match whose check digit is wrong isn't a match.
- Try it on a sample. It decides with the check digit, as the gateway would.
- Save. Use … in a policy opens for it:
- choose the level and the Action (watch, mask, pseudonymise or block);
- optionally choose Part of a policy, or None: a rule of its own;
- Turn it on.

Check it worked¶
On Patterns, your pattern says where it's on: its own rule, at which level, and Reach (how many keys carry it). On Rules at that level it has its own row, decided by a single-pattern rule, with its action. When it finds something, the call's findings in Request logs name your pattern.

Your own categories¶
Under Categories, add your own (lower-case letters, digits and underscores). Rename… on one of yours changes its name everywhere it's used, and says what it rewrote ("Rewritten in 3 patterns, 2 rules and 1 packs"); past findings keep the old name.
Related¶
- Make a policy with New policy: Add your own pattern… works there too.
- Add a pack to a level: put your patterns in a pack of your own.
- Review findings: tune a pattern that matches too much.
Good to know¶
- The gateway can't run look-arounds, back-references or atomic groups; write the expression without them.
- A pattern too large to try is refused on the field: "This pattern is too large to try here (a repeat count over 1000, for example). Simplify it."
- Built-in patterns are read-only, and say whether they're exact, broad (catch more than they should) or noisy (often match harmless text).
- Built-in categories can't be renamed.
- If adding a pattern to a policy fails, the rule is on as a rule of its own: Try adding it again, or Leave it on its own and add it later with Adopt existing parts… on the policy.