# Privacy

Zero cookies, raw IPs dropped by default (RAW_IP_OPT_IN=false), daily rotating SHA-256 salt, and unlinked geo_hits.

Status: Live

You want a count you can trust, and you want your readers told the truth about what is kept.

Privacy claims fail when products promise magic instead of publishing their schema. Kokumi states exact defaults in src/privacy.rs and exposes them live via GET /api/v1/privacy.

Kokumi separates three storage streams. Edge counts store no IP, no user-agent text, no cookie, and no id. Reader views drop raw IPs by default (RAW_IP_OPT_IN=false) and compute a 12-byte SHA-256 key from a daily UTC rotating salt. City and region totals detach into unlinked geo_hits rows. A reader can be forgotten.

"No cookies" is true.
"No raw IP stored by default" is true.
"Banner exemption guaranteed automatically everywhere" is not true.

## What is stored

### Edge counts

One total per day, path, and kind of file (a page, a markdown twin, or llms.txt), one tag, the referring host, and who asked: a verified agent, a claimed agent, an unconfirmed browser, or unrecognised.

Not kept: No IP, no user-agent text, no cookie, and no id. An agent is checked against the operator's published IP list during the request. That IP is not stored. The check is not by network or ASN.

### Same-site clicks

The day, the page, the page on this site it came from, and a count. The source is a path only: no host, no query, and no fragment.

Not kept: Nothing about the person.

### Beacon totals

The day, the path, one tag, the referring host, and a count, added when the page script runs. This is the people total.

Not kept: No IP, no user-agent text, no cookie, and no id. This is not a row about one reader.

### Reader views

The day, path, referrer host, tag, device class (phone or desktop), short screen/language labels, time in view, scroll depth, and a 12-byte daily UTC rotating SHA-256 visitor key. Raw IP is stored only when RAW_IP_OPT_IN=true (false by default).

Not kept: Zero cookies, zero user-agent text, and zero raw IP by default (RAW_IP_OPT_IN=false). The key uses SHA-256(VISITOR_SALT || UTC day || IP || UA) so identifiers expire every UTC midnight without extra cleanup jobs.

### Geo totals (geo_hits)

Unlinked daily city, region, and country totals (day, country, region, city, n).

Not kept: No visitor key, no IP, no path, no timestamp, and no foreign link back to reader views.

### Component events

The page-load id, the day, the path, the component, where it sat, and what happened (seen, clicked, opened, closed, played, copied, or submitted), with a count and a time.

Not kept: No new id, no IP, and no cookie. The row joins back to the reader view.

### Tool calls

When a site uses a Kokumi tool: the day, the time, the tool, the public site name that was typed, the outcome, the verdict, the Turnstile result, who called, the visitor key, and the country.

Not kept: No IP. The IP is used only to rate-limit the call, and it is not written on the row.

## What is not stored

- Kokumi does not set a cookie, and it does not read one.
- Raw IP addresses are dropped by default (RAW_IP_OPT_IN=false). Only an explicit opt-in flag in deployment config persists raw IPs.
- The user-agent string is not stored. It is checked in RAM to classify an edge request or derive the daily visitor key, then dropped.
- Country, region, and city come from Cloudflare headers on the request and write into unlinked geo_hits rather than individual reader rows.

## Zero raw IP default

Status: Live

Enforced in src/privacy.rs: RAW_IP_OPT_IN is false by default, visitor keys rotate automatically every midnight UTC via SHA-256(VISITOR_SALT || UTC_DAY || ip || ua), and geo_hits detaches city counts from reader rows. Inspect live deployment state via GET /api/v1/privacy or kokumi privacy.

## Forget a reader

A reader can still be forgotten on demand within the active day window via kokumi forget-reader (or Legacy pagebook forget-reader), keyed on the daily rotating hash rather than a cookie.

## Questions


### Does Kokumi set a cookie?

No. Nothing is stored in cookies or browser storage. Daily visitor keys are derived on the Worker in memory.

### Does Kokumi store raw IP addresses?

No, not by default. RAW_IP_OPT_IN defaults to false in src/privacy.rs. Both edge hits and reader views drop the raw IP unless an operator opts in.

### Why does the daily visitor key expire at midnight UTC?

Each hash includes the UTC YYYY-MM-DD date string inside the SHA-256 input, so yesterday's keys stop matching at 00:00 UTC without needing a cron wipe.

### How are city and country reports built without tracking people?

Geographic counts write into detached geo_hits rows keyed only by day, country, region, city, and count, with zero path, timestamp, or visitor key.

## Related

- [Read the data docs](/docs/data-and-privacy)
- [People vs agents at the edge](/features/edge-analytics)
- [Kokumi vs Umami](/vs/umami)
- [Kokumi vs Plausible](/vs/plausible)
- [Kokumi vs Google Analytics](/vs/google-analytics)
- [Privacy policy for this site](/legal/privacy)
