On this page
01
What you'll set up
You will add a regional personal-data template and your own rules to a guardrail profile, test them against sample text, and tune them until they catch what you intend.
- A regional personal-data template
- Custom rules of your own: terms, a pattern, or a labeled value
- A redact-or-block choice for each rule
- A tuning loop that keeps false matches low
You need a guardrail profile first. If you do not have one, start with the guide on creating your first guardrail profile.
02
Templates and your own rules
Cloptima templates cover credentials and the common personal-data formats of each region. What else counts as sensitive depends on your business, and custom rules cover it.
Cloptima templates
- Credentials, personal data by region, financial, healthcare, and infrastructure identifiers
- Maintained by Cloptima
Your rules
- Customer identifiers, employee IDs, internal codenames
- Defined by you, tuned to your data
03
Start from a regional template
Open the profile in AI → Guardrails and choose Edit. Under Protect sensitive data, switch on the template for each region you serve, and choose Redact or Block for it. Each template lists its rules, so you can see exactly what it finds.
| Template | What it finds |
|---|---|
| US personal data | Email addresses, Social Security numbers, US phone numbers, card numbers, and labeled passport, driver's license, and date-of-birth values |
| European personal data | Email addresses, IBANs, international phone numbers, and card numbers |
| UK personal data | Email addresses, National Insurance numbers, NHS numbers, UK phone numbers, postcodes, sort codes, IBANs, and card numbers |
| Canadian personal data | Email addresses, Social Insurance Numbers, phone numbers, postal codes, health card numbers, and card numbers |
| Indian personal data | Email addresses, Aadhaar numbers, PAN and GSTIN identifiers, mobile numbers, IFSC codes, and card numbers |
| Australian personal data | Email addresses, Tax File Numbers, Medicare numbers, ABNs, BSBs, phone numbers, and card numbers |
04
Terms, a pattern, or a labeled value
A custom rule matches a list of terms, one regular expression, or a value next to its label. Choose by what you are looking for.
| Use | When | Behaves like |
|---|---|---|
| Term list | Fixed words and names, such as codenames | Each term matches as whole words, in any letter case. |
| Regular expression (RE2) | Formats, such as IDs and host names | Case-sensitive. Add (?i) to match any letter case. No lookaround or backreferences. |
| Labeled value (RE2) | A number that means something only next to its label, such as Employee ID: E123456 | Finds the value on the label's line, or alone on the next line. Only the value is replaced. |
05
Add a rule
In the profile editor, under Protect sensitive data, choose Add custom rule.
- 1
Give the rule an ID
Use lowercase letters, digits, and underscores, such as project_codenames. Each ID is unique in the profile, and it names the rule's placeholder.
- 2
Choose how it matches
Pick Term list, Regular expression (RE2), or Labeled value (RE2).
- 3
Choose On match
Redact replaces the match with a placeholder. Block refuses a request whose new message matches.
- 4
Enter what to find
Terms go one per line. A pattern goes in the Pattern field. A labeled value takes a Label and a Value.
- 5
Save
The rule is live as soon as the profile is saved.
- 1Rule ID
- project_codenames
- 2Match
- Term list
- 3On match
- Block
- 4Terms (one per line)
- project falcon internal-only
Each term matches as whole words, in any letter case.
06
Examples you can adapt
These cover the patterns teams ask for most.
| Goal | Match | Rule | On match |
|---|---|---|---|
| Keep a project codename out of prompts | Term list | Project Falcon | Block |
| Mask internal host names | Regular expression | \b[a-z0-9-]+\.corp\.example\.com\b | Redact |
| Mask employee IDs like EMP-123456 | Regular expression | \bEMP-\d{6}\b | Redact |
| Catch customer account numbers | Regular expression | \bACCT-\d{8}\b | Redact |
| Mask badge numbers that follow a label | Labeled value | Label (?i:employee id|badge), value E\d{6} | Redact |
Before: Email [email protected] about account ACCT-20481977.
After: Email [EMAIL_ADDRESS_K7Q2M4XAB3CD] about account [ACCOUNT_NUMBER_R5T2WQ6ZHJ3N].The same value gets the same placeholder on every turn, so the model can still reason about it. When the answer repeats a placeholder, your app gets the original value back.
07
Limits that keep traffic fast
Rules run on a linear-time matcher, so no pattern can slow your traffic or stall other requests. To keep that guarantee, rules have bounds.
| Item | Limit | Why |
|---|---|---|
| Terms per rule | Up to 10 | Keeps each rule focused |
| Length of a term | Up to 64 characters | Keeps matching predictable |
| Length of a pattern, label, or value | Up to 128 characters | Keeps matching predictable |
| Pattern features | No look-ahead and no back-references | These are what make matching unpredictable |
| Rules per profile | Depends on your plan | See pricing |
08
Test and tune
Attach the profile to a policy in Monitor only and send sample prompts through a test key. The profile records what it would redact or block, and requests it would have blocked appear in Audit, under Policy violations.
- Too many matches: tighten the pattern, or use a labeled value so a number matches only next to its label
- Missed matches: add a second rule for the other format, rather than one complex rule
- A format that varies by country: add one rule per format, with clear IDs
- Names and addresses in free text: add a provider safety scan, because pattern rules cannot understand meaning
09
As code
Teams that manage infrastructure in Terraform can keep guardrail profiles there.
resource "cloptima_llm_guardrail_profile" "customer_data" {
name = "Customer data protection"
definition = {
protect = [
{ template = "secrets", action = "redact" },
{ template = "us_personal_data", action = "redact" },
{ rule = "employee_id", match = { regex = "\\bEMP-\\d{6}\\b" }, action = "redact" },
{ rule = "codename", match = { terms = ["Project Falcon"] }, action = "block" },
]
}
}