ADR 0012: Bounded, digest-addressed detector profile customization
- Status: Accepted (profile foundation; runtime activation not implemented)
- Date: 2026-10-04
- Decision owners: architecture, detector, policy, security, privacy, product, and risk owners
- Extends: ADR 0004, ADR 0010, and ADR 0011
- Resolves: the profile-model defaults in OD-013. Public authoring, runtime activation, risk gates, and legal approvals remain open.
Context
Different clients legitimately use different field names, issuer labels, document layouts, and deployment postures. Giving them arbitrary detector regular expressions, code, CEL, or a copy of every detector setting would make detector semantics unauditable and would let tenants weaken mandatory controls. Encoding every variation as a new detector or certifying every possible layer combination would instead create an unbounded release matrix.
Groundskeeper therefore needs customization that is expressive only where a detector owner has declared a safe, tested variation. It must preserve the separation between:
- detector invariants and evidence production;
- policy thresholds, actions, and failure posture;
- deployment identity and server-side snapshot selection; and
- maturity evidence proving what a detector/profile/action tuple may do.
This ADR specifies the compiled model. It does not approve the current public YAML/CEL proposal, change detector behavior, or make the accompanying draft JSON Schema a stable authoring API.
The approved initial defaults are: a required immutable digest-pinned baseline;
at most one optional industry overlay; only typed detector-declared capability
slots; an optional tenant layer that may tighten, while broadening is limited by
declared ceilings and requires replay and gates; authenticated server-side
deployment binding; and no request-time merging. Temporary suppressions require
a reason, owner, risk approver, ticket, exact trusted scope, and expiry. The risk
owner alone authorizes required, block, or fail-closed postures after the
applicable evidence and legal gates. Customization remains internal and is not
added to public YAML or CEL at this stage.
Decision
1. Five ordered layers, one compiled result
The control plane compiles exactly these layers:
┌──────────────────────────┐
│ Immutable detector │ grammar, validators, evidence semantics
│ invariants + capability │ and bounded customization slots
└─────────────┬────────────┘
▼
┌──────────────────────────┐
│ Groundskeeper named │ required; digest-pinned release baseline
│ baseline │
└─────────────┬────────────┘
▼
┌──────────────────────────┐
│ Industry overlay │ optional; at most one per profile chain
└─────────────┬────────────┘
▼
┌──────────────────────────┐
│ Client / tenant overlay │ optional; tenant-owned bounded values
└─────────────┬────────────┘
▼
┌──────────────────────────┐
│ Deployment binding │ server-side selection of one complete snapshot
└─────────────┬────────────┘
▼
immutable snapshot digestThe detector implementation and its capability contract are inputs, not an override layer. A named baseline is always present. An industry or tenant layer can only target slots exported by the immediately resolved profile chain. A deployment binding contains no detector operations; it binds authenticated server-side deployment identity to an already compiled snapshot.
There is no request-time merge, fallback, policy choice, or profile parameter. Request bodies, provider metadata, and caller-supplied headers cannot select a profile, tenant, overlay, or snapshot. This extends TM-01 and ADR 0004's atomic snapshot rule.
2. Detector invariants and capability contracts
Each detector release has an immutable semantic core and a separately
digest-addressed configuration capability contract. Describe() and the
snapshot lock eventually expose:
- detector ID, artifact digest, semantic-core version, configuration-contract digest, and compatible host/compiler ranges;
- stable slot and operation IDs, value schemas, cardinality/resource limits, and whether each change expands or contracts recognition, enforcement, cost, or disclosure;
- baseline value, immutable floor/ceiling, permitted layer kinds, and required approval/evidence impact for each slot;
- mutually exclusive features and cross-slot constraints; and
- certified envelope IDs and the evidence bundles that cover them.
The host accepts only declared operation IDs and values. A configuration_schema
URI in the current detector manifest is not enough by itself: compilation pins
the fetched schema digest and capability contract digest. Unknown slots,
operations, values, or contract digests fail closed at compile time. Runtime
negotiation never silently drops unsupported configuration.
The following are non-overridable detector invariants:
- public category, detector class, entity meaning, and detector identity;
- authoritative candidate grammar, type-disambiguating prefixes, checksum or reference-validation algorithm, and excluded/reserved-value rules;
- the meaning and ordering of
candidate,probable, andvalidated, including evidence required to emit each state; - ADR 0010's rule that
context_bound_structuredemits no finding without an approved exact label or trusted field binding, and cannot emitvalidatedwithout an approved authoritative validation source; - evidence kinds and whether evidence supports or contradicts a finding;
- Unicode code-point span semantics, original-text addressing, coverage/error states, deterministic ordering, and sensitive-value exclusion from evidence;
- resource hard maxima, permission sandbox, cancellation, and output bounds;
- mandatory platform rules, trust roots, audit minimization, tenant isolation, gate ceilings, and legal/governance prohibitions; and
- the operation language itself. A layer cannot introduce regex, glob, code, CEL, templates, dynamic lookups, remote endpoints, credentials, or extension fields with executable meaning.
A detector update is required to change an invariant. It receives a new artifact digest and, when observable semantics change, a compatible version increment and new gate evidence.
3. Bounded customization surface
“Broader” below means more inputs can become findings or have policy action
applied. “Tighter” can be ambiguous: stronger recognition is broader detection,
while a higher evidence threshold is narrower enforcement. The compiler records
both recognitionImpact and enforcementImpact; it never infers safety from the
word “tighten”.
| Setting | Allowed bounded operation | Safety boundary and evidence consequence |
|---|---|---|
| Normalization | Select an owner-defined normalizationProfileId | No custom transforms or order. Enabling digit folding, separator folding, or compatibility normalization broadens recognition and requires transformed-positive, hard-negative, span, leakage, and latency replay. Disabling baseline normalization narrows recognition and is forbidden below a mandatory floor; otherwise it requires recall replay. Normalization maps back to exact original code-point spans. |
| Exact labels | Add/remove finite exact labels in declared tiers | Values are literal strings, bounded in count/length, normalized by the selected declared normalizer, and rejected on post-normalization collision. No regex/glob. Added labels cannot change evidence-state semantics; additions require positive and competing-label/benign replay, removals require recall replay. Contradicting labels may be added where the detector exports that slot; removing baseline contradictions is normally forbidden. |
| Trusted field paths | Add/remove exact canonical JSON Pointers in declared tiers | Paths come from adapter-produced canonical segments or an authenticated schema registry, never arbitrary request-body claims. No wildcard or prefix paths. Additions require field-confusion and benign replay; removals require recall replay. Field names do not by themselves raise a state beyond the invariant evidence map. |
| Binding scope/distance | Select a declared scope and bounded integer distance/direction | Choices are detector-owned (same_field, same_line, same_sentence, same_segment, and declared direction). Cross-segment/message/conversation binding is unavailable unless a future detector core explicitly implements and certifies it. Increasing scope/distance broadens recognition and requires binding-negative and latency replay; decreasing it requires recall replay. |
| Context requirements | Select a declared monotone requirement set ID | A tenant may add required evidence/context. It may remove only optional requirements down to the immutable detector/platform floor. It cannot invent evidence, reinterpret labels, make untrusted context authoritative, or remove VSN's label/field requirement. Any change requires context positive/negative replay. |
| Unicode handling | Select a detector-owned Unicode disposition profile | Profiles name exact versions and dispositions for the maturity-gate transformation catalogue. No arbitrary character maps. A new Unicode version or disposition is a semantic change requiring Unicode, span, redaction, adversarial, and benign replay. Unsupported transformations stay declared gaps, not clean results. |
| Minimum evidence state | Set candidate, probable, or validated, plus declared required evidence kinds | This is a policy trigger over findings, not a detector-state redefinition. Raising the minimum narrows enforcement and may weaken coverage; lowering it broadens enforcement and requires action-appropriate false-positive evidence. Numeric confidence is unavailable unless the capability points to approved calibration evidence. |
| Action mode | Select record, redact, or block | Action is policy, ordered by traffic effect, and capped by the detector/profile gate (G1, G2, or G3). A layer cannot exceed its delegated action ceiling or legal/governance prohibition. Moving to a more consequential action requires evidence for that action and approvals; moving down cannot weaken a mandatory platform action. |
| Replacement token | Replace with a bounded, static literal | No interpolation, matched-value fragments, reversible tokenization, tenant secrets, control characters, or context-dependent templates. The token must pass payload-schema, idempotence, collision/overlap, grapheme-boundary, and leakage tests. This does not change detector corpus evidence but changes transformation evidence. |
| Required/advisory | Set required within a delegated envelope | required: false never turns failures into clean coverage. false → true can improve confidentiality but threatens availability; true → false weakens mandatory enforcement and is forbidden unless explicitly delegated. Gate and route failure tests are required. |
| Timeout/on-error | Select bounded timeout and an explicitly allowed failure posture tuple | Timeout is bounded by detector and service budgets. Lower timeout can increase unjudged traffic; higher timeout can exhaust route budget. on_error has no universal safety order (block protects confidentiality but harms availability), so the capability lists exact allowed transitions by risk tier. Changes require fault/load evidence, not detector corpus replay unless timeout changes observed completeness. |
| Suppressions/allowlists | Add/remove expiring, reasoned, ID-addressed skip_action rules over exact trusted selectors | Findings and coverage remain visible; suppression only skips the policy action. Selectors may use category, exact trusted field paths, authenticated deployment/schema/source IDs, and operator-allowlisted trusted-context labels. No regex/CEL, free-form body metadata, raw sensitive values, or unkeyed/per-value hashes for enumerable HPI-I/VSN spaces. Suppressions have reason, owner, risk approver, ticket, expiry, maximum scope, and mandatory audit. They cannot target non-suppressible rules. Additions require suppressed-positive and scope-escape tests; broad or long-lived suppressions require corpus replay and risk approval. |
HPI-I and VSN defaults
For HPI-I, prefix 800361, 16 normalized digits, Luhn, adjacency/type boundaries,
validated requiring shape + checksum, and original-span behavior are invariant.
Labels and trusted field paths may add supporting/contradicting evidence but cannot
make a Luhn failure a finding or change the state. A client may select only
predeclared grouped-digit/Unicode normalization profiles and label/path sets.
For VSN, nine normalized digits, excluded-value rules, exact binding, and the
probable ceiling are invariant. Bare values never emit. Tenant labels and paths
are assigned to detector-owned evidence tiers; an acronym-only tier cannot be
promoted by a layer. Binding may only use declared same-field/proximal scopes.
Removing the final label/field requirement or treating student number as VSN by
semantic fiat is invalid.
Future structured detectors use the same slots only if their capability contract exports them. A common operation name does not imply that every detector supports it or shares bounds.
4. Typed operations, precedence, and conflict behavior
The conceptual operation set is:
select_normalization_profileunion_exact_labels/subtract_exact_labelsunion_trusted_field_paths/subtract_trusted_field_pathsset_bindingselect_context_requirementselect_unicode_profileset_minimum_evidenceset_actionset_replacementset_failure_postureadd_suppression/remove_suppression
Operations target stable detector profile and slot IDs, not document paths. Set operations are idempotent; union/subtract operate on canonical mathematical sets; suppression IDs are globally unique within the resolved profile. General JSON Patch, strategic merge, YAML merge keys, and deep merge are forbidden.
Within each layer, operations are sorted by target and operation ID for compiled form, but author order never resolves a conflict. Two writes to the same scalar slot in one layer, add/remove of the same set member in one layer, duplicate suppression IDs, unknown remove targets, or semantically colliding normalized labels are compile errors—even if values happen to agree. Authors must state one unambiguous intent.
Across layers, later layers take precedence only when the capability delegates that exact operation to that layer and the result remains inside all earlier floors/ceilings. Set additions/removals compose mathematically. A lower layer cannot restore a value prohibited by a higher non-overridable constraint. Conflicting industry and tenant intent is therefore either a permitted bounded override with visible provenance or a compile error; never last-writer-wins by accident.
Every import is by digest. Import and extends graphs must be acyclic. The
compiler rejects cycles, a missing or duplicate baseline for any effective
profile, multiple industry ancestors for a profile, diamond imports that yield
two paths to an object, duplicate stable IDs, unknown targets, stale expected
base digests, and incompatible capability/host versions. A multi-profile layer
may therefore pin multiple independent baselines, exactly one per profile. There
is no conflict fallback.
5. Deterministic canonicalization and identity
Source syntax is not identity. The compiler parses a closed, versioned input, rejects duplicate keys, YAML aliases/merge keys, non-I-JSON numbers, unknown core fields, and non-canonical identifiers, then expands defaults and resolves every reference by digest.
Compiled objects use RFC 8785 JCS. Before JCS:
- maps use stable IDs as keys;
- semantic sets are deduplicated and sorted by their canonical scalar or object identity;
- genuinely ordered arrays retain schema-defined order;
- strings are not silently Unicode-normalized; a slot's declared normalizer creates an explicit compiled value, and source values that collapse together are rejected; and
- timestamps, comments, signatures, mutable tags, source formatting, and the digest field itself are excluded from semantic digest input.
Identity is split deliberately:
| Digest | Covers | Use |
|---|---|---|
detectorArtifactDigest | executable detector artifact | implementation identity |
capabilityContractDigest | slots, bounds, impacts, compatibility, envelopes | what can be customized |
layerDigest | one canonical authored layer plus exact imports | review/audit identity |
effectiveProfileDigest | detector artifact + contract + fully resolved semantic detector/policy configuration | replay and behavioral identity |
policySnapshotDigest | composed ADR 0004 policy | decision identity |
deploymentSnapshotDigest | effective profiles, policy, catalogue, detectors, bindings/lock, compiler and schemas | atomic activation/rollback identity |
evidenceBundleDigest | reports and approvals whose subjects include the exact digests above | promotion authority |
Audit responses identify the deployment snapshot and effective profile digests, not mutable names alone. A named baseline, overlay, or SemVer tag is for discovery; the digest is authority.
6. Snapshot, evidence, and certification containment
An evidence bundle's subject is at least:
(detector artifact digest,
capability contract digest,
effective profile digest or certified envelope ID,
action/gate,
corpus and gate-definition digests,
evaluator/environment compatibility)Evidence is not automatically inherited across semantic changes. The compiler emits a machine-readable impact manifest listing changed slots and required suites. Promotion verifies that every impact is covered.
To avoid combinatorial certification, detector owners define a small number of
certified envelopes, not arbitrary cross-products. An envelope contains
explicit per-slot bounds plus interaction constraints and is tested using
boundary and pairwise/adversarial combinations chosen by the owner. A tenant
configuration can reuse envelope evidence only when the compiler proves it is a
member and no rule marks the changed combination replayRequired. Evidence for
the envelope establishes detector behavior; deployment-specific legal authority,
suppression review, binding authorization, and action approval are still needed.
Changes are classified as follows:
| Class | Examples | Required evidence |
|---|---|---|
| A: identity/presentation | narrower authenticated deployment binding; static replacement token | no detector corpus replay; binding authorization tests or transformation conformance as applicable |
| B: operational | timeout/failure tuple within an existing semantic profile | deadline, fault, coverage, availability, and load evidence; corpus replay only if completeness changes |
| C: policy consequence | minimum evidence, required/advisory, suppression, action | policy decision diff; affected positive/negative cases; action-specific G1/G2/G3 evidence and approvals; broad suppression adds corpus replay |
| D: recognition semantic | normalization, labels, paths, context, Unicode, binding | affected positive, near-miss, competing-context, benign, adversarial, span, latency, and redaction replay; broadened recognition emphasizes precision, narrowed recognition emphasizes recall |
| E: invariant | grammar/checksum/state semantics/class | customization rejected; new detector release and full relevant gate evidence |
At minimum, every semantic customization runs conformance invariants plus a decision diff against its immediate parent. Recognition changes run the relevant corpus partitions. A move to redact adds end-to-end leakage/over-redaction and payload validity evidence; a move to block adds G3 precision, observed-traffic or accepted synthetic-only risk, SRE, legal/domain, and incident-readiness evidence. Changing only the tenant name never causes replay because tenant identity is not part of detector semantics.
7. Compatibility and versioning
The draft schema in
detector-profile-layer.v1alpha1.schema.json
is an internal interchange/prototyping contract with 0.1-draft; it is not the
public policy authoring format promised by OD-011. Implementations should first
define an internal typed model and compiler IR. YAML, JSON, SDK builders, or a UI
may later compile to that IR.
Compatibility has separate axes:
- authoring/interchange schema version;
- compiler IR and canonicalization profile version;
- detector artifact and semantic version;
- capability contract version/digest;
- policy snapshot format;
- host protocol range; and
- evidence/gate definition version.
Adding an optional operation or slot is a contract minor change but does not make old hosts support it. Removing/changing a slot, bound, direction, or meaning is a major change. Tightening a safety floor can be issued as an urgent incompatible admission change, but published artifacts and historical snapshots remain immutable and are revoked/demoted rather than rewritten. The compiler requires explicit migration records for renamed slots, operations, tiers, and envelope IDs; it never guesses aliases.
8. Tenancy, authorization, and audit
Namespace and authorization are checked before compilation and again before activation:
- Groundskeeper owns invariants, named baselines, mandatory constraints, and capability contracts.
- An industry authority can publish only in its verified namespace and cannot grant itself tenant rights.
- A tenant editor can change only that tenant's overlays and delegated slots.
- A deployment binder can bind only deployments in its scope to snapshots the tenant has approved.
- Publisher, approver, and activator are separate roles for consequential changes; break-glass use is time-bounded and independently reviewed.
- Cross-tenant imports, suppressions, paths, labels, evidence, and names are forbidden unless an explicitly public signed artifact is imported by digest.
- The runtime derives binding identity from authenticated integration state. It
does not trust
tenant_id, profile names, or snapshot digests in payloads.
The append-only audit record contains actor/workload identity, tenant, operation, reason/ticket, source and result digests, compiler/schema versions, semantic diff, impact classification, validation/evidence references, approvals, binding scope, activation/rollback, and suppression expiry. It contains no matched value and no raw prompt. Label/path source values may themselves reveal schema information, so audit access is tenant-scoped and metadata follows ADR 0007 retention controls.
Every compiled value carries field-level provenance: invariant, baseline, industry, tenant, or derived compiler value, with source layer digest and operation ID. Generated diffs show both the winning value and shadowed constraints.
Threat analysis
| Threat | Control | Verification |
|---|---|---|
| Tenant supplies regex/code or catastrophic pattern | closed typed operations; literal bounded sets; no CEL/regex/glob/template | schema and compiler rejection; fuzz size/cost limits |
Tenant redefines validated, promotes VSN, or accepts HPI-I checksum failures | semantic core and evidence-state map are invariant | invariant conformance and malicious-layer fixtures |
| Caller selects a weak policy/profile | authenticated server-side deployment binding to complete snapshot | API negative tests and binding authorization tests |
| Overlay weakens mandatory baseline | per-slot floor/ceiling and permitted-layer mask; compile fails | directional and cross-layer compiler tests |
| Unicode normalization changes span or creates collisions | named/versioned profiles, explicit original-span map, reject normalized duplicates | Unicode metamorphic, span, leakage, and collision tests |
| Overbroad custom label/path floods findings | finite exact values, count/length bounds, trusted paths, precision/benign replay | competing-label, field-confusion, and benign corpora |
| Suppression becomes permanent bypass | skip_action only, finding retained, exact trusted scope, expiry/owner/ticket, non-suppressible floor | expiry, scope-escape, audit, and mandatory-rule tests |
| Enumerable identifier hash allowlist leaks or can be brute-forced | prohibit raw values and per-value/unkeyed digests for HPI-I/VSN; use schema/source scope | admission rejection and audit inspection |
| Capability downgrade or ignored operation | pin contract digest; exact host range; unknown operation fails; no runtime fallback | downgrade/substitution activation tests |
| Ambiguous precedence or import cycle yields attacker-chosen result | fixed chain, digest imports, no diamonds, conflicts/cycles fatal | compiler graph/property tests |
| Canonicalization ambiguity changes digest | duplicate-key/I-JSON checks, schema-defined set ordering, RFC 8785 | cross-language canonical vectors |
| Combinatorial envelope hides unsafe interaction | explicit interaction exclusions; boundary/pairwise/adversarial envelope tests; compiler can demand replay | envelope membership and excluded-combination tests |
| Stale evidence is reused for changed semantics | evidence subject includes artifact, contract, effective profile, gate and corpora | promotion admission negative tests |
| Cross-tenant metadata or overlay disclosure | namespace isolation, tenant-scoped RBAC/storage/audit, public artifacts only by digest | authorization and RLS tests |
Residual risk remains in owner-defined envelopes and corpus representativeness. An envelope is a reviewed claim, not a mathematical proof that every combination is safe. Risk owners approve numerical gates; legal/privacy/governance owners approve whether an action is permitted at all.
Reconciliation with existing decisions and schemas
- ADR 0004: detector customization compiles before activation and appears in
the same immutable snapshot/lock. Policy remains the owner of triggers,
actions, required/advisory, timeout, and on-error. This ADR narrows the generic
replace_parameterconcept to detector-declared typed operations; it does not add request-time inheritance or deep merge. - ADR 0010: structured classes and validation-state meaning are immutable. Custom labels/paths add evidence only through detector-owned tiers. HPI-I stays validated only by shape/checksum; VSN remains context-bound and at most probable.
- ADR 0011: layers are independently reviewable source artifacts, while the deployment snapshot is flattened, digest-addressed, signed, and atomic. Stable object IDs and provenance survive source moves. Catalogue definitions do not contain tenant values.
- Current
policy-bundle.schema.json:check.configis still not passed to built-ins, and the runtime still rejects layered composition. Do not add these draft operations to that public-looking schema yet. A future compiler maps the internal profile IR to a resolved detector config and policy rules. - Current detector manifest: retain
configuration_schemabut augment the future manifest/Describe result with a pinned capability contract. Do not make arbitrary schema-valid detector config tenant-overridable.
Migration and implementation plan
No runtime behavior changes with this ADR.
- Model and fixtures: approve terminology and open decisions; use the draft schema/examples only for compiler design. Add malicious and conflict fixtures before accepting source layers.
- Capability inventory: extract HPI-I/VSN current behavior into read-only capability documents. Mark every existing semantic value invariant first; export no client slot until its bounds and replay suite are approved.
- Compiler IR: implement typed operations, directional impact analysis, provenance, graph/conflict checks, JCS digests, and a semantic decision diff. Keep it offline; continue emitting current runtime snapshots unchanged.
- Evidence integration: make gate reports accept effective-profile and capability-contract digests; implement impact-to-suite mapping and certified envelope membership. Preserve historical evidence subjects.
- Control plane: add tenant-scoped storage/RBAC, approval separation, suppression expiry, authenticated deployment binding, signing, atomic activation, and rollback. Threat-model and test RLS/confused deputies before multi-tenancy.
- Pilot: use the synthetic Australian banking
EXAMPLE-BANKoverlay as the first certification example. It covers the current HPI-I and VSN baselines, is observe-only and tightening-only, and does not activate runtime behavior. HPI-I normalization, recognition broadening, and all block actions remain closed until their owner decisions and gate evidence exist. - Public contract: after the compiler and operations stabilize, decide OD-011/OD-013 and design the public YAML/SDK/UI. Publish migrations rather than declaring the draft schema stable.
Open decisions
- Which team owns capability contracts and may classify a slot as tenant-safe?
- Which additional settings, directions, maxima, and suppression scopes may be delegated after the initial record-only contracts?
- Which certified envelopes and interaction tests are funded next for HPI-I and VSN?
- What maximum suppression duration applies by risk tier?
- Which canonicalization/IR version and cross-language JCS implementation become normative before artifact publication?
- Must trusted field paths be registered from a customer schema artifact, or may tenant editors enter exact JSON Pointers directly under review?
Consequences
Clients get useful bounded customization without owning detector semantics. Effective configurations are reproducible and attributable, and certification scales by semantic digest and tested envelope rather than customer count.
The cost is a real compiler, capability-contract lifecycle, provenance/diff model, and targeted replay system. Some requested customizations will correctly require a detector release instead of an overlay. This is intentional: convenient configuration is subordinate to evidence integrity and tenant-safe enforcement.