Contact form privacy
Decision for #448, recorded 2026-11-16.
In short​
- The contact form still opens a GitHub issue, but the issue no longer contains the sender's email.
- The email is kept privately in the
contact_submissiontable, in the API's own database. - The issue says
Reply address kept privately (submission #<id>), so maintainers can look up the reply address. - We plan to clear the email after 180 days. That is not automated yet (#456).
Why the email left the issue​
POST /api/contact/submit creates an issue in getcommunityone/open-navigator. That repository is public. The issue body
used to read **From:** <name> (<email>), so every sender's email was published, indexed and open to scraping.
People who write to us did not agree to that. We still need a way to reply, so the email moved to a private store.
Where the email is kept​
The table is contact_submission, one row per accepted submission.
| Column | Type | Notes |
|---|---|---|
contact_submission_id | integer identity | Primary key. Shown in the issue. |
created_at | timestamptz | When the form was sent. |
sender_name | text | Also shown in the issue. |
sender_email | text | Private. Nullable, so retention can clear it. |
subject | text | Also shown in the issue title. |
github_issue_number | integer, nullable | Set after the issue is created. |
github_issue_url | text, nullable | Set after the issue is created. |
- It is a runtime table, like
userandcontact_oauth_state. The API creates it at startup withBase.metadata.create_all(api/models.py,ContactSubmission). dbt does not build it, and it has no foreign keys. - The running API writes it to the database it signs users in with. In production that is the same database that holds
user. - The local-to-Neon serving sync never copies it.
hosting.neon.sync_public_to_neononly copies objects on itsCIVIC_SERVINGallow-list, andcontact_submissionis also on itsRUNTIME_OWNEDdeny-list. So a local copy can never reach Neon, and a sync can never overwrite the production rows. make backup-publicleaves it out of snapshots (PII_EXCLUDE_TABLESin theMakefile).- No API route reads it, and no
publicserving view selects from it.
How a submission flows​
- The rate limit and duplicate check from #409 run first. Rejected submissions are not stored.
- The API saves the row, then creates the issue with the
submission #<id>line. - When the issue is created, the API stores its number and URL on the row.
- If GitHub fails, the API deletes the row. The user sees an error and can send again.
- If the database is down, the issue is still created. It says
Reply address not kept (private store unavailable). The email is never put in the issue as a fallback, and the warning log does not contain it.
The message text itself is posted as written. If a sender types their email into the message, it will appear in the issue. We do not scrub message text.
Who can read it​
Only people with credentials for the API's database: the maintainers who run the production API. There is no admin screen for it yet. To reply, look up the row by the id in the issue:
SELECT sender_name, sender_email, subject, github_issue_url
FROM contact_submission
WHERE contact_submission_id = <id>;
Retention​
- Rule: clear
sender_email(set it toNULL) 180 days aftercreated_at. The rest of the row stays, so the issue link still works. - 180 days is enough time to reply and follow up on any issue.
- This is automated (#456). The job is
python -m hosting.retention.contact_submission(packages/hosting/src/hosting/retention/contact_submission.py). TheContact form retentionworkflow (.github/workflows/contact-retention.yml) runs it every Monday at 04:17 UTC against the API's database, using the repository secretAPI_DATABASE_URL. If that secret is missing the run warns and clears nothing, so the secret is part of keeping this promise. - Check it with
python -m hosting.retention.contact_submission --dry-run, which counts the rows it would clear and changes nothing. The output is a count, never an email. - The job does exactly what this SQL does, so a maintainer can still run it by hand:
UPDATE contact_submission
SET sender_email = NULL
WHERE created_at < now() - interval '180 days'
AND sender_email IS NOT NULL;
Logs​
The contact route and the Facebook data-deletion callback (api/routes/data_deletion.py) log no email addresses. The
deletion callback logs the internal user_id and the Facebook user id only. Database errors there log the error type,
not its text, because that text can include row values.