# Survey answers as personal data

A survey answer is the personal data of a person who is not your user of Bucker. It was collected on your
instruction, it can name someone (a contact address, a respondent key, a sentence that says who they are), and
it is the one kind of data in the product that an agent could be handed by accident. This page says what the
product does about that, what you control, and what you cannot switch off.

Surveys are off until product analytics is enabled for the project (the per-project gate and the amended data
processing agreement). Nothing on this page stores a row for a project whose gate is shut.

## What is stored, and under what key

| Table | Holds | Keyed by |
| --- | --- | --- |
| Feedback reports of kind `SURVEY_RESPONSE` | the message, an optional name and contact address, the environment and release | respondent hash, contact address |
| Survey answers | one typed answer per question | respondent hash |
| Pending triggers | "ask this person this survey next" | respondent hash |
| Exposure state | when a person was last prompted, dismissed or answered | respondent hash |
| Fix confirmations | "was it fixed for you?" | the response they came with |
| Rollups (exposure, score, answer counts) | counts only | no identity |

The respondent hash is a keyed pseudonym (an HMAC under a per-project key), never the address or id itself.
See [Identity](identity.md) for the keys and what rotating them means.

## Automatic prompts need a basis

A prompt is **automatic** when the product puts it in front of someone without their asking: a popover or
micro-survey, an issue-impact question, a fix confirmation. A feedback tab, a hosted link, an inline embed and
a headless call are the respondent's own initiative.

An owner records the project's **survey consent basis** (Settings, Surveys, Privacy):

- **`consent`**: automatic prompts are built into the survey bundle. A person is asked only when their consent
  state is `granted`.
- **`exempt_audience:<profile>`**: automatic prompts are built in, and a person whose consent is not granted may
  still be asked, but only by a survey that stores nothing that names or keys them. It is accepted only when the
  project's consent posture records the same exempt profile; if the posture later changes, the basis stops being
  honoured at once.
- **no basis** (the default): no automatic prompt is built into the bundle, and nobody is asked by one.

Whatever the basis, a visitor's own refusal wins: a revoked or pending consent, and a Global Privacy Control or
Do-Not-Track signal your SDK honoured, mean that person is not asked. The decision is made by the server on each
request, so a withdrawal takes effect on the next request and not the next time a bundle is cached.

Recording the basis is a person's act (an owner, signed in; not an agent, a token or an OAuth client). It writes
an audit row with the previous and the new value, and tells the other owners.

## Erasure

One request removes a respondent from every survey table at once, found by their respondent hash (every key
generation, so a rotation never strands rows) and by their contact address, in any letter case. Each response
leaves together with its answers and its fix confirmation; queued triggers and exposure state go with it; a theme
that cited one of the removed answers as evidence loses that reference. The reach report counts rows per table
before anything is removed, and verification repeats it and expects nothing.

Erasure is a person's act through the subject-request workflow (it has its own cancel window, receipt and
deadline). The rollups hold no identity and stay; an opt-out record keeps its keyed hash on purpose, because
forgetting that someone asked not to be written to would write to them.

## Retention

Every table that holds a respondent hash or a response id is pruned at your plan's retention ceiling (30, 90,
180 or 365 days), following your organization's own window if you shortened it. The rollups hold counts under no
identity and keep 13 months.

## What an agent can read

An agent never receives a contact address, a name or a respondent hash, and there is no key for them to be
withheld from: the agent projection of a response and of an answer is built field by field from a short list. The
free text it does receive is scrubbed at the agent tier with your organization's scrub rules, then scanned for
prompt injection, and every string carries its trust label. Text the scanner quarantined is replaced by a
placeholder, and stays replaced even if a rule changes later. If your rules cannot be loaded, the text is
withheld rather than served half-scrubbed.

## Exporting one respondent

`survey_respondent.export` gives one respondent's answers with their identity (contact address, name, hash)
to a person. An export cannot be recalled, so it is the strictest act in this area:

- **Off until an owner turns it on.** The shipped policy is DENY. An owner writes an ASK row for the act
  (itself a loosening policy change, which needs a second person); a policy on this act can never be ALLOW
  and asks for two approvers.
- **Two people, every time.** The person who needs the export files it, naming the respondent and saying why;
  another person who can read survey responses approves it with their own security-key step-up; the request
  waits out its hold; the requester confirms; and only then is it applied. The request names the respondent
  by a keyed digest and counts, never by their address or id, so the approval record holds nothing that
  names anyone.
- **Collected once, by the requester, within a day.** The requester then collects the export, naming the
  same respondent. Nobody else can collect it, it cannot be collected twice, and an approval not collected
  within 24 hours lapses.
- **Only people.** Filing, approving and collecting all need a person signed in to Bucker with the `pii:read`
  scope, which no agent, token or OAuth client can hold, and your organization's data-access policy for survey
  responses (restricted by default: a scope must name the person). Analytics must be enabled for the project.

Each collection writes one row to the personal-data read ledger, with categories and counts and no value, and
one audit row; if the ledger row cannot be written, nothing is returned and the approval can still be used.
At most 10,000 rows come back; narrow the respondent if the answer says it was truncated.

## API

| Method and path | Who |
| --- | --- |
| `GET /orgs/:org/projects/:project/surveys/consent-basis` | anyone who can read the project |
| `PUT /orgs/:org/projects/:project/surveys/consent-basis` | an owner, in their own session |
| `POST /orgs/:org/operations/human-requester/survey_respondent.export` | files an export: `target.id` is the project id, `input` names the respondent (`identifiers`, `respondentHashes`, `emails`) and the `reason` |
| `POST /orgs/:org/operations/:id/vote`, `.../confirm` | the approver's vote and the requester's confirmation |
| `POST /orgs/:org/projects/:project/surveys/respondents/export` | the requester collects an applied export: `operationId` and the same respondent |
