PolarisGet Your Polaris
Menu

POLARIS FIELD GUIDE / 3 MIN READ

Building hard-negative tests for redaction systems

A hard-negative redaction test contains clean material that resembles a sensitive pattern. Its purpose is to verify that the system preserves the information. Useful cases include harmless product codes, version numbers and public business terms placed in realistic context. Keep these controls separate from sensitive-span tests, document why each is clean, and inspect the specific changes made by the detector.

Choose ambiguity that occurs in the workflow

Start with harmless values the application genuinely needs. Include version strings used in software investigations, public catalog identifiers used in order reviews and ordinary business words that resemble personal names. These examples are more informative than arbitrary sentences with no resemblance to sensitive data.

Write the expected action beside each item. Explain why preserving it is correct under the chosen policy and include the surrounding context that establishes its meaning.

Pair each clean case with a sensitive counterpart

Create a related sensitive example requiring transformation. Pair a benign product identifier with an account reference that shares its format and appears in a different field. The pair tests whether a proposed fix preserves clean content without suppressing the sensitive class entirely.

Keep the pair linked in the fixture manifest. When an engineer changes a recognizer or decision rule, run both sides together. A local improvement is valuable when it resolves the false alarm and preserves the intended handling of the sensitive counterpart.

Clean controlSensitive counterpart to evaluate
Public release versionPrivate account identifier with similar punctuation
Catalog item codeCredential-shaped value in an authentication field
Ordinary project descriptionConfidential transaction codename in a deal note
Public office contactPersonal contact in a protected case record

Define the measurement unit

Choose whether the test records changed spans, changed fields or clean samples wrongly flagged. Keep that unit visible in the result. If a sample contains several clean fields, one false alarm can mark the whole sample as failed while the field-level register still explains exactly what changed.

Polaris-Mist's public clean-data measurement uses samples. All 29 clean samples are correctly preserved, with zero false alarms. The comparison tools use 28 samples each, with counts of 19, 13 and 21 wrongly flagged. These exact counts make the test outcome inspectable.

Review the detected span and final transformation

Inspect the transformed text for each failed control. Compare the detector's labeled span with the full region changed by the application operator. That difference matters when the downstream model loses an entire clause or field. Record both the detected span and the final changed text in your private evaluation workspace.

Add a practical question for controls with clear business meaning. For a workflow investigating a release-related error, verify that the output names the release correctly. This ties the preservation test to the actual usefulness of the content.

Maintain a focused regression collection

Keep the original clean examples after a fix and add newly discovered ambiguities as distinct cases. Record which application change introduced the need for each addition. Retain the original cases alongside new examples to track progress across the same reference set.

Periodically inspect whether the collection is still representative of current work. A product catalog update or new market can introduce different naming conventions. Add those patterns with explicit classification decisions and paired sensitive examples, then compare the updated set by category.

QUESTIONS & ANSWERS

Details that matter.

Why separate hard negatives from ordinary detection tests?

The expected result for a clean control is preservation. A separate set makes unnecessary changes visible without mixing them into the count of sensitive spans found.

Can an allowlist solve every false alarm?

Use allowlists only where the policy supports them, and test a sensitive counterpart. The same surface string can have a different meaning in another context.

How does Mist report this test?

The benchmark lists exact counts of clean samples wrongly flagged. Polaris-Mist has 0 / 29; the comparison tools have 19 / 28, 13 / 28 and 21 / 28.

Sources & further reading

Related Polaris work