← Back to slim.io
Detection · Scoring + LLM Assist

Context-aware scoring
with LLM Assist

Each match is scored by a format validator and the words around it. A bare SSN-shaped number scores 0.55, just under the line. Near "social security" the same number scores 0.83 and is flagged; near "product" it drops to 0.25 and is skipped. Threshold: 0.6 minimum to flag. An optional LLM Assist pass then reviews the findings the detection rules kept, in groups, and hides false positives before any action fires.

Overview

The confidence score

Every potential detection is assigned a score from 0.0 to 1.0. Only detections that meet or exceed the minimum threshold of 0.6 are flagged. Actions (masking, tokenizing, blocking) only trigger above this line.

Score range
0.0
0.6 threshold
1.0
Below threshold: ignored
Score < 0.6. No action taken, no log entry produced.
At or above threshold: flagged
Score ≥ 0.6. Policy is evaluated and the configured action fires.
Step 1

Base confidence

Every match is first scored by the validator for its pattern. For an SSN, the bare number pattern starts at 0.35 and has to earn its way up; the pattern that carries its own label, such as SSN:, starts at 0.60. A passing format check then adds to the score and a failing one subtracts: a valid SSN area, group and serial adds 0.20, and a published test number such as 078-05-1120 loses 0.50.

Match Score before context How it is reached
234-56-7890 0.55 Bare number: 0.35 start, +0.20 valid SSN format
SSN: 234-56-7890 0.80 Labelled: 0.60 start, +0.20 valid SSN format
Step 2

Context scoring

Two passes then read the words around the match. The first looks 50 characters either side: a supporting term such as "social security" adds 0.20, and a term that points to a non-sensitive number, such as "product", subtracts 0.30. The second looks 32 characters either side and adds 0.08 or subtracts 0.10. Each pass applies at most one boost and one penalty. A match that fails validation with a score below 0.3 is discarded before the second pass.

Example A: Boosted
"Please update the patient's
social security record with 234-56-7890
today."
Bare number, valid SSN format · 0.55
50-character pass + +0.20 ("social security")
32-character pass + +0.08 ("social security")
Final score 0.83 ✓ FLAGGED
Example B: Penalized
"Use product code 234-56-7890
when ordering."
Bare number, valid SSN format · 0.55
50-character pass − −0.30 ("product")
Final score 0.25 ✗ SKIPPED (discarded before the 32-character pass)

With no words around it, the same number scores 0.55 and is not flagged. Context is what lifts Example A over the line and what removes Example B. Each entity type has its own supporting and non-sensitive terms; the ones above come from the SSN lists.

Step 3

Format validation

For entity types where the data format has mathematically verifiable properties, slim.io runs deterministic validators in addition to pattern matching. These validators confirm structural integrity and substantially reduce false positives from random digit sequences.

Luhn algorithm
Credit Cards & SINs
Validates the trailing check digit against a weighted sum of the preceding digits. Eliminates roughly 90% of false positives from random number sequences that happen to match a card number pattern.
BIN range matching
Credit Cards
Cross-references the Bank Identification Number (first 6 digits) against known issuer ranges. Visa starts with 4, Mastercard 51–55, Amex 34 or 37, Discover 6011 / 65.
IBAN check digits
IBANs
Validates the two-digit check code using mod-97 arithmetic as specified in ISO 13616. Country-specific length rules are also enforced: a DE IBAN is always 22 characters, a GB IBAN 22, and so on.
SIN Luhn
Canadian SINs
Canadian Social Insurance Numbers pass through the same Luhn check digit validation applied to credit cards, providing format-level verification independent of pattern matching alone.
Outcome

What happens at the threshold

Once a final score is computed, the outcome is binary: the entity is either flagged and routed through your policy, or it is silently dropped with no side effects.

✓
Flagged
Score ≥ 0.6
  • Entity is identified and its position is recorded
  • Configured policy rules are evaluated against the entity type
  • Action fires: mask, hash, tokenize, redact, or block
  • Detection is written to the audit log
×
Skipped
Score < 0.6
  • Entity is discarded with no action taken
  • No policy evaluation occurs
  • No log entry is written
  • Original data passes through unchanged
Optional · Step 4

LLM Assist review

When enabled, LLM Assist reviews the findings the detection rules kept, in groups. Each finding comes back confirmed, hidden as a false positive, or marked for a person to review.

How it works
1
The detection rules run first. A finding the rules settle on their own needs no AI review.
2
The findings the detection rules kept are grouped, and the model reviews each group together.
3
Before anything leaves slim.io, the text around each value is scrubbed: other people’s names, dates and other sensitive values are replaced with placeholders. The model sees only the one value it is judging.
4
If a finding cannot be reviewed, it is kept and counted, and the scan says how many findings were not reviewed.
Outcomes
Outcome What happens
Confirmed The finding stays and proceeds to policy and action.
Hidden The finding is hidden as a false positive. It stays on record and can be shown again.
Needs review The model was not sure. The finding stays and is marked for a person to decide.
Privacy: Everything around the value under review is scrubbed before it reaches the model.
Bring Your Own LLM BYOLLM

Reviews can run on an OpenAI-compatible endpoint of your own — a self-hosted model, a regional deployment, or a private cloud instance. It is configured with our team.

opt-in LLM Assist is off by default. Turn it on for the data sources you choose.