Skip to content

Protect analytics properties ​

Edge checks analytics property keys and values for email addresses, phone numbers, payment cards, government ids, JWTs, and PII-like key names.

This policy is managed through an agent, the CLI, or the API, and it is admin only (pii.read / pii.policy.write). The console does not provide a Security editor yet. Publisher and manager tokens cannot change it.

Understand the modes ​

  • block — the original value is not retained; analytics sees (blocked).
  • redact — analytics retains (redacted) instead of the original value.
  • allow — the original value can pass to analytics.

The default is block. Namespace policy is a ceiling for distributions beneath it. Embed distributions (embed_script and embed_iframe) can never be looser than redact. Payment-card and government-id detectors are locked to block.

Review effective policy ​

text
On acme-marketing, list the PII detectors, show the resolved policy
for every detector, and report blocked and redacted properties from
the last seven days.

The agent runs edge_pii_detector_list, edge_pii_policy_get, and edge_pii_report. Resolved policy identifies whether each mode came from an exemption, distribution, namespace, or default.

The equivalent reads are:

  • GET /v1/pii-detectors
  • GET /v1/distributions/{id}/pii-policy
  • GET /v1/distributions/{id}/pii-report?from=…&to=…

Set distribution policy ​

text
For acme-marketing, redact values matched as email addresses. Record
the reason "Support form reporting without retaining addresses".
bash
edge api PUT /v1/distributions/d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38/pii-policy --input - <<'EOF'
{
        "detector_key": "email",
        "mode": "redact",
        "reason": "Support form reporting without retaining addresses"
      }
EOF
bash
curl -s -X PUT \
  https://api.edge.deca-dev.com/v1/distributions/d3f7a1c4-90b2-4e6a-8f15-6c2b7e0a9d38/pii-policy \
  -H "Authorization: Bearer $EDGE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
        "detector_key": "email",
        "mode": "redact",
        "reason": "Support form reporting without retaining addresses"
      }'

The agent runs edge_pii_policy_set. Moving away from block requires a reason and cannot exceed a namespace, detector, or embed ceiling. Policy changes are audited.

Make a narrow exception ​

An exemption applies to one property and one detector. It must include a reason and can include expires_at.

json
{
  "property_key": "support_contact_type",
  "detector_key": "key_name",
  "mode": "allow",
  "reason": "Enum contains no contact details",
  "expires_at": "2026-12-31T00:00:00Z"
}

Send that body to POST /v1/distributions/{id}/pii-exemptions, or ask an agent to run edge_pii_exemption_create. Locked detectors cannot be exempted. Revoke an exemption with DELETE /v1/distributions/{id}/pii-exemptions or edge_pii_exemption_revoke; revocation is also audited.

Prefer changing what the page sends over adding an exception. A policy protects stored analytics but does not make collecting unnecessary personal data a good design.

Next ​