PII masking
Mask sensitive fields in audit events before they are written, for privacy-sensitive deployments.
Enable PII masking
For deployments subject to data privacy requirements, AutoPIL can mask sensitive content in audit events before writing to the database. Enable with a single environment variable:
| Variable | Default | Description |
|---|---|---|
AUTOPIL_LOG_PII_MASK | — | Set to true to mask query, user_id, and embedded query content in reason before writing each new audit event. Existing events are not modified. |
AUTOPIL_LOG_PII_MASK=true
How salting works
Salt is derived from AUTOPIL_SECRET_KEY + tenant_id — the same user always hashes to the same value within a tenant, so per-user filtering still works.
Enforce agent identity globally
Enforcing agent identity globally: To require that every evaluate call across all tenants must supply a registered agent_id, set the server-wide flag:
| Variable | Default | Description |
|---|---|---|
AUTOPIL_REQUIRE_AGENT_ID | — | Set to 1, true, or yes to deny any evaluate call that omits agent_id. Denial is recorded with policy_name="agent_id_required". Per-tenant enforcement can also be toggled at runtime via PATCH /v1/admin/tenants/{id}/settings without a restart. |
Was this page helpful?