The YAML on this page is excerpted to illustrate structure. For real authoring, start from the policy type template
/aim provides, and treat the template’s schema as the authority on fields and validation. Templates support both JSON and YAML; the policy model is defined in YAML.Before you start — Taxonomy first
Every grade reference in a Rule Package comes from the Taxonomy. Before writing, finalize the project’s Taxonomy (grade set, ranks, verdict methods, thresholds) and decide which version the Rule Package will reference. Every detector’s grade attribution and every grade a classification rule emits must be a grade that exists in that Taxonomy version.Layer A — detectors: what to detect
A detector is the smallest unit that detects a specific signal, and each one carries a grade attribution — which grade it contributes to. Their character differs by pipeline stage:- Get the grade attribution right on every detector. The grade a detector contributes to is the starting point for Layer B combinations and Layer C aggregation.
- Build pattern detectors in three tiers: format + validation + context. Anchor digit boundaries in the regex (
(?<!\d),(?!\d)); use avalidator— a checksum or validity check, such as rejecting SSN areas and groups the SSA never issues — as reinforcement that raises confidence; and usecontext_words+proximity_charsas a confidence ladder (confidence_tiers) that steps up when a context word is nearby. Distinguishing a format-only match from one that also passed context and validation, at different confidences, is what lets Layer B set threshold conditions. actiondecides a detection’s masking treatment. Set items whose risk masking removes tomask, so they take part in re-grading the masked copy. Set items that stay risky even when redacted — credentials and the like — or signals that are merely evidence for a judgment, toreview_only— a document left with non-maskable items keeps its grade, and external transfer stays blocked.- Fingerprint detectors reference registered forms. The fingerprint template
template_idpoints at must be registered in the project, and reference validity is verified when the Rule Package is activated.
Layer B — classification rules: signals into grade candidates
Classification rules combine detector signals and emit grade candidates:- Reserve
terminalfor evidence with near-certain confidence. Fingerprint matches and exact matches — signals with almost no false-positive room — are the candidates. Overusing terminal robs the later stages (semantic classification, clause judgment) and the label policy of their chance to correct. - Set thresholds with
compare. The same detector yields different confidences for a format-only match versus one that also passed validation, so tighten a rule’s firing condition by comparingfield: confidenceorfield: count. - Encode counter-evidence with negative conditions. As above: mask artifacts present and no live PII means a redacted derivative — emit General while voiding the Confidential candidate via
suppresses. L4’s counter-evidence clauses (already disclosed, confirmed public) can likewise be excluded from Confidential clause verdicts with anotcondition. - Order
priorityby strength of evidence. Put the confirm-class rules high; leave weak signals that can’t stand alone as low-priority secondary candidates, useful for converging on the gray zone.
Layer C — label policy: conflict resolution and external-transfer routing
The label policy finalizes the grade candidates Layer B emitted and decides external-transfer routing:taxonomy_ref— the specific Taxonomy version this Rule Package references.conflict_resolution: highest_rank— when one document yields multiple grade candidates, finalize at the highest grade. A single sensitive section pulls the whole document’s grade up, preventing under-classification.manual_label_precedence— a manually assigned grade is never silently overwritten by automatic classification.routing— per-grade confidence thresholds. At or abovehigh, the verdict auto-finalizes; betweenlowandhigh, it routes to the gray zone and on to human secondary review. Verdicts ineligible for external transfer are blocked.
Taxonomy referential integrity
- The Taxonomy version a Rule Package references is pinned by
taxonomy_ref. Publishing a revised Taxonomy doesn’t move existing Rule Packages — they keep running against the version they reference. To adopt the new grading scheme, publish a new Rule Package version with an updatedtaxonomy_refand pin it. - Whether every detector’s grade attribution and every emitted grade exist in the referenced Taxonomy’s grade set — and whether the fingerprint templates and versions that fingerprint detectors reference exist — is subject to schema validation and activation-time verification.
Checklist
- Did you finalize the Taxonomy version first and pin it with
taxonomy_ref? - Does every detector carry a grade attribution, and does every emitted grade exist in that Taxonomy?
- Do your pattern detectors have digit boundaries, a
validator, and a context-word confidence ladder? - Did you avoid setting
maskon items whose risk masking doesn’t remove (credentials and the like)? - Is
terminalreserved for high-confidence evidence like fingerprints and exact matches? - Is counter-evidence (redacted derivatives, prior disclosure) reflected via negative conditions and
suppresses? - Do the
routinglow/highthresholds draw the auto-finalize/gray-zone boundary where you intend? - Are the fingerprint templates your fingerprint detectors reference registered, with valid versions?