Sensitive Field Handling
Evidence status: The evaluator finding and regenerated
audit_mask_fields metadata were verified. Runtime masking in safe sinks,
responses, raw/debug paths, exports, and failures has not yet been executed.
Problem
Record useful audit evidence without exposing passwords, tokens, identifiers, contact details, health data, or payment-related values to logs and downstream audit consumers.
Model
Declare audit masking in the model:
<customer
_name="Customer"
name="string()"
email="string()"
phone="string()"
passport_number="string()"
_audit_mask_fields="email,phone,passport_number" />
Evaluate the model and treat high-sensitivity findings as blocking until they are reviewed.
Runtime Boundary
Masking is only one layer:
- Authorization controls whether the field may be read.
- Generated selection controls whether the field is loaded or returned.
- Audit metadata records why an operation happened.
- Safe audit events mask configured values.
- Log level and sinks control where evidence is sent.
- Encryption, secrets management, retention, deletion, and residency remain application/platform responsibilities.
Do not use masking as proof that access is authorized.
Verification
- Evaluate a model containing representative sensitive names. The verified
evaluator identifies
emailas a contact identifier and suggests adding it to_audit_mask_fields; evaluate again after changing the model. - Inspect generated entity metadata and confirm the expected field appears in
audit_mask_fields; do not patch the generated annotation. - Perform an audited mutation of each sensitive field.
- Confirm the safe audit sink does not receive raw values.
- Confirm raw/debug sinks are disabled or access-controlled in production.
- Confirm application responses omit fields not required by the use case.
- Test truncation for long free-text fields where configured.
- Verify exports, support tools, and error paths as well as normal requests.
Failure Modes
| Symptom | Fix |
|---|---|
| Field is masked in audit but returned to unauthorized client | Add field-level authorization/selection policy; masking is not access control. |
| Raw value appears in debug output | Reduce log detail, configure safe sinks, and review payload logging. |
| New sensitive field is unmasked | Update model metadata and add evaluation/verification tests. |
| Audit is unreadable | Keep field/change metadata and business purpose while masking values. |