# threefold Privacy Policy

*Last updated: 25 November 2026*

This policy describes how **Threefold Ltd** ("threefold", "we", "us", or "our"), trading as threefold and operating `https://threefold.eco` and `https://api.threefold.eco`, collects, uses, processes, retains, and protects personal data.

---

## 1. Data Controller Information (GDPR Art. 13(1)(a))

- **Data Controller:** Threefold Ltd, a private limited company registered in Northern Ireland
- **Company Registration Number:** NI734175
- **Registered Address:** 114 Glen Road, Glenariffe, Ballymena, Northern Ireland, BT44 0RG
- **Privacy & Data Protection Contact:** `info@threefold.eco`
- **Data Protection Officer (DPO):** Not appointed under GDPR Article 37; privacy inquiries are handled by the Data Protection Contact at `info@threefold.eco`.

---

## 2. Categories of Personal Data Collected & Technical Data Flows

The data flows below distinguish account/service data, public creator/reviewer evidence, stateless page-localisation requests, and explicitly opted-in saved projects. A saved project has different storage behaviour from a stateless translation request.

### A. Customer, Developer & Account Data

| Category | Specific Data Points | Purpose | Legal Basis (GDPR Art. 6) | Technical Implementation in Code |
|---|---|---|---|---|
| **Account Identity** | Email address, optional display name | Magic-link sign-in, user account management, workspace membership | Performance of Contract (Art. 6(1)(b)) | Normalised and persisted in the `users` table via `modules/platform/accounts.mjs` (`normaliseEmail`, `upsertUser`) and `db/migrations/007_accounts.sql`. |
| **Authentication Credentials** | Single-use magic tokens (SHA-256), session identifiers (SHA-256), API keys (SHA-256) | Authenticating API, MCP, and web sessions; enforcing workspace permissions | Performance of Contract (Art. 6(1)(b)) | Secrets generated via `modules/platform/accounts.mjs` (`randomToken`) and stored only as one-way SHA-256 hashes via `modules/platform/accounts.mjs` (`sha256`, `lookupApiKey`, `lookupSession`); incoming requests verified via `modules/platform/auth.mjs` (`isAdminKey`, `identify`). Raw secrets are never stored. |
| **Billing & Payments** | Stripe customer ID, subscription ID, payment status | Processing subscription plans, usage top-ups, invoicing | Performance of Contract (Art. 6(1)(b)); Legal Obligation (Art. 6(1)(c)) | Stored in the `workspaces` table via `modules/platform/accounts.mjs` (`createWorkspace`, `setPlan`); checkout sessions and billing portal sessions managed via `modules/platform/billing.mjs` (`createCheckout`, `createTopUpCheckout`, `createPortal`) with webhook verification via `modules/platform/billing.mjs` (`handleStripeEvent`, `verifyStripeSignature`) and `api/routes/billing.mjs` (`routes`). Payment card details are handled directly by Stripe and never transit threefold application servers. |
| **Usage & Metering** | Per-workspace balance, endpoint call counts, micro-USD cost allocations | Atomic spend tracking, allowance refresh, rate limits | Performance of Contract (Art. 6(1)(b)) | Metered per priced call via `modules/platform/meter.mjs` (`withMeter`, `checkBalance`, `calculateSettlement`) and recorded in `meter_entries` (`db/migrations/011_metering.sql`). |
| **Network & Operational Telemetry** | Client IP address, request method, route pattern, latency, HTTP status code | Network defense, rate limiting, system diagnostics | Legitimate Interests (Art. 6(1)(f)) | Client IP extracted via `modules/platform/auth.mjs` (`clientIp`) accounting for configured proxy hops (`THREEFOLD_TRUSTED_PROXIES`). Structured JSON logging via `modules/platform/log.mjs` (`createLogger`); credentials, bearer tokens, and secrets are automatically scrubbed via `modules/platform/log.mjs` (`redact`, `redactString`). |

### B. Public Store Reviewer & Organic Creator Intelligence

threefold collects publicly observable market data across three pillars: **Brand**, **Organic**, and **Paid**.

| Data Subject Category | Data Collected | Source | Legal Basis | Code Implementation |
|---|---|---|---|---|
| **App Store Reviewers** | Public reviewer pseudonym/handle, rating score, review title and text, submission timestamp | Public Apple App Store RSS feeds and Google Play public store web pages | Legitimate Interests (Art. 6(1)(f)) | Ingested via `modules/sources/store-reviews/connector.mjs` (`connector`) and persisted in `store_reviews` (`db/migrations/005_sources_reports.sql`). |
| **Public Social Creators** | Public channel/account handle, author ID, public video/post caption, publication timestamp, public engagement metrics (views, likes, comments) | Public YouTube Data API v3, and public social platform actors (TikTok, Instagram, X) | Legitimate Interests (Art. 6(1)(f)) | Ingested via `modules/sources/organic-search/client.mjs` (`search`, `normaliseVideo`) and `modules/sources/_social/social-apify.mjs` (`searchSocial`, `SOCIAL`), persisted in `organic_posts` and `organic_post_metrics` (`db/migrations/002_live_ingest.sql`). |

*Special Category Data (GDPR Art. 9):* threefold does not intentionally collect, infer, or profile special category personal data (e.g. biometric, health, political, religious data). Ingest connectors drop follower lists, private emails, phone numbers, and location coordinates (as summarized in `docs/compliance.md`).

### C. Customer Content Submitted for Page Localisation

| Data Subject Category | Data Collected | Purpose | Legal Basis | Code Implementation |
|---|---|---|---|---|
| **People named in a customer's own page, CMS or product text** | Whatever personal data the customer's text contains, for example a named contact, author or testimonial, plus the customer's glossary and variant choices | Translating the customer's text into one target variant | Performance of Contract (Art. 6(1)(b)) with the customer, who acts as Data Controller for its submitted content and is responsible for providing any required notices to its data subjects; threefold acts as Data Processor under the DPA | `POST /api/pages/localise` (`api/routes/pages.mjs` -> `modules/product/pages/localise.mjs`, `localisePage`). Text is sent to the configured model supplier (today Google Gemini; Anthropic is the alternative; see [subprocessors](https://threefold.eco/subprocessors.md)). Stateless: page text is not stored or cached by threefold; `meter_entries` (`modules/platform/meter.mjs`) records only scalar usage/cost metadata (`endpoint_id`, `status`, `settled_micro_usd`). |

The Legitimate Interests Assessment in Section 3 covers public data only. It does not cover this section. Customers are instructed not to submit special-category personal data (GDPR Art. 9) to stateless localisation endpoints; threefold does not intentionally collect or filter for Art. 9 data in customer-submitted text.

Customer page localisation (Section 2.C) is not in the table above. `POST /api/pages/localise` (`api/routes/pages.mjs` -> `modules/product/pages/localise.mjs`) is stateless, does not store or cache page text, and `meter_entries` (`modules/platform/meter.mjs`) records only scalar usage/cost metadata (`endpoint_id`, `status`, `settled_micro_usd`).

### D. Opt-in Saved Projects and Customer Material

Project creation requires `persist_consent: true` after the user is told that descriptions, evidence, drafts, adapted material, source references, QA and review decisions will be stored in the authenticated workspace. The customer decides the lawful basis for any personal data in that content, and must have permission to provide and use it. The customer acts as Data Controller and threefold acts as Data Processor under the DPA. Customers are instructed not to submit special-category personal data (GDPR Art. 9).

The project's stored content is processed by the hosting/database providers. Explicit hosted generation sends the selected permitted evidence and project facts to the configured model supplier (today Google Gemini; Anthropic is the alternative); explicit project localisation sends the selected page text and instructions to that supplier. Manual editing and saving do not call a model. Supplier accounting retains usage/cost metadata rather than customer text in the analysis ledger. Reference-only evidence must not contain copied source content and is excluded from generation inputs.

Projects use workspace access controls, revision-bound review, authenticated exports and deletion. Retention is selected at creation (technical range 1–3650 days; default 365), measured from creation rather than extended by each edit. The daily retention worker deletes expired projects and their dependent raw content. Explicit deletion keeps a minimal project/workspace/actor/time audit record without the content. Deleted rows stay in database backups until those backups expire (30 days, Section 4); deletion of live rows does not promise immediate deletion from every backup.

This is not a cache or automatic mirror of a CMS/store. `POST /api/pages/localise` remains stateless; storage occurs only through the separate opted-in project workflow. Code: `modules/product/projects/index.mjs`, `db/migrations/114_market_projects.sql`, `modules/runtime/retention.mjs`. Known imported organic-post references participate in the existing erasure flow. To ask for erasure of personal data inside content a customer submitted, write to `info@threefold.eco`.

---

## 3. Legitimate Interests Assessment (LIA) Summary

Where personal data is processed under Article 6(1)(f) (public creator posts and app reviews), our legitimate interests are:
1. **Purpose:** Providing competitive market intelligence and localization benchmarking to developers, publishers, and growth teams launching software products internationally.
2. **Necessity:** Evaluating cross-market customer sentiment and marketing effectiveness requires observing publicly available social and app store engagement.
3. **Balancing & Safeguards:** Only publicly posted information is processed; private messaging and accounts are never accessed; raw JSON payloads are cleared after 90 days via `modules/runtime/retention.mjs` (`purgePayloads`); unobserved creator records are purged after 730 days via `modules/runtime/retention.mjs` (`deletePosts`); and the right to object / erasure is supported through an automated erasure pipeline implemented in `modules/runtime/privacy.mjs` (`eraseAuthor`).

---

## 4. Automated Retention and Data Minimization Schedules

threefold implements automated technical retention mechanisms executed by daily worker cron passes configured via `modules/runtime/retention.mjs` (`retentionConfig`):

```
+--------------------------------------------------------------------------------------------------+
|                                    DATA RETENTION TIMELINE                                       |
+------------------------------------+-------------------------------------------------------------+
| Data Category                      | Technical Retention Mechanism in Code                       |
+------------------------------------+-------------------------------------------------------------+
| Raw Ingest Payloads                | Cleared after 90 days via modules/runtime/retention.mjs (purgePayloads)  |
| YouTube API Records                | Refreshed or deleted after 27 days via modules/runtime/retention.mjs    |
|                                    | (expireYoutube, per YouTube Developer Policy cap of 30 days)|
| Stale Organic Creator Posts        | Deleted after 730 days via modules/runtime/retention.mjs (deletePosts)  |
| Archived Media Files               | Unlinked and purged via ingest/media/erase.mjs              |
|                                    | (eraseMediaForPosts) called from modules/runtime/retention.mjs          |
| Daily Post Metrics                 | Collapsed into monthly aggregates after 400 days            |
|                                    | via modules/runtime/retention.mjs (rollupMetrics)                       |
| Database Backups                   | Daily encrypted pg_dump backups to EU Cloudflare R2         |
|                                    | (postgres-backup cron), retained for 30 days.               |
+------------------------------------+-------------------------------------------------------------+
```

---

## 5. Subprocessors & International Transfers (GDPR Art. 13(1)(e)–(f))

We share personal data with infrastructure and service providers operating as subprocessors:

- **Railway Corp.** (Application Hosting and Production PostgreSQL Database `threefold-postgres`, `postgres:17-alpine`, EU region `europe-west4`, Netherlands, per `docs/deploy.md`; DPA: `https://railway.com/legal/dpa`, Trust Center: `https://trust.railway.com`).
- **Cloudflare, Inc.** (EU R2 Object Storage bucket `threefold-media` for archived media and 30-day encrypted database backups; Workers AI currently disabled in production; DPA: `https://www.cloudflare.com/cloudflare-customer-dpa/`).
- **Stripe, Inc. / Stripe Payments Europe Ltd.** (Payments & Billing, Ireland/USA, per `modules/platform/billing.mjs` `stripe`, `createCheckout`; only a test account is connected today, and Stripe receives customer data once live billing is switched on).
- **Anthropic, PBC** (AI Intelligence via Claude API and page localisation, Section 2.C; USA, per `modules/product/analysis/client.mjs` `callClaude` and `modules/product/pages/localise.mjs` `localisePage`; not in use in production today, where Google Gemini is the live model supplier).
- **Google LLC / Google Ireland Limited** (Google Gemini API, live in production for brand-name analysis and page localisation on `gemini-3.5-flash-lite` under `google_gemini` accepted transfer, plus YouTube Data API v3 and BigQuery; EEA/USA, per `https://cloud.google.com/terms/data-processing-addendum`).
- **OpenAI OpCo, LLC / OpenAI Ireland Limited** (Model evaluation/labelling, and analysis if the model family is switched to OpenAI; currently disabled in production; USA).
- **Apify Technologies s.r.o.** (Data Extraction, Czech Republic, EU, per `modules/sources/_suppliers/apify.mjs` `runActor`; no actor runs in production today).
- **Meta Platforms, Inc. / Meta Platforms Ireland Limited** (Meta Ad Library API, Ireland/USA, per `modules/sources/meta-ad-library/client.mjs` `searchAdsArchive`; not in use today, there is no access token).
- **Resend, Inc.** (Transactional Magic-Link Delivery, USA, per `modules/platform/mailer.mjs` `sendMail`).

*(Historical note: Supabase, Inc. was decommissioned as an active database subprocessor on 22 Nov 2026 in favour of Railway EU Postgres and EU Cloudflare R2 backups.)*

Customer-connected third-party platforms (Shopify, Sanity, Vercel, App Store Connect, Google Play, GitHub, RevenueCat, Google Search Console) are customer-authorized third-party services accessed via customer-provisioned encrypted vault credentials (`modules/platform/connections.mjs`), not general threefold subprocessors.

The complete subprocessor register, citing public terms and processing locations, is maintained at `docs/legal/subprocessors.md`.

---

## 6. Data Subject Rights (GDPR Articles 15–22)

All individuals whose personal data is processed by threefold possess statutory rights under Chapter III of the GDPR:

1. **Right of Access (Art. 15):** Request confirmation and export of personal data held about you.
2. **Right to Rectification (Art. 16):** Request correction of inaccurate personal data.
3. **Right to Erasure ("Right to be Forgotten", Art. 17):** Request deletion of your personal data.
4. **Right to Restriction of Processing (Art. 18):** Restrict processing under statutory conditions.
5. **Right to Data Portability (Art. 20):** Receive customer account data in machine-readable format.
6. **Right to Object (Art. 21):** Creators and reviewers may object to the processing of their public posts and reviews.

### Technical Execution of Erasure Requests (`modules/runtime/privacy.mjs`)
When an erasure or objection request is submitted to `info@threefold.eco`:
1. The operator executes `npm run privacy:erase -- --author <handle>` implemented in `modules/runtime/privacy.mjs` (`eraseAuthor`).
2. The code permanently deletes matching posts from `organic_posts`, deletes user reviews from `store_reviews`, removes cascading media assets from storage via `ingest/media/erase.mjs` (`eraseMediaForPosts`), and purges cached AI analysis narratives citing the post via `modules/runtime/privacy.mjs` (`eraseAuthor`).
3. To prevent re-ingesting the individual during future crawls, the normalized SHA-256 hash of the handle is stored in `erasure_log` via `modules/runtime/privacy.mjs` (`subjectHash`, `eraseAuthor`).
4. Subsequent ingest runs query `modules/runtime/privacy.mjs` (`suppressErased`), automatically discarding newly observed content from that author.

---

## 7. Security Measures (GDPR Art. 32)

We implement administrative and technical security measures verified in our codebase and deployment configuration:
- **Encryption in Transit:** HTTPS is provided by the hosting provider's TLS termination at the edge. Application session cookies carry the `Secure` attribute in production (`modules/platform/auth.mjs` `sessionCookie` and `secureCookies`).
- **Cryptographic Hashing:** API keys, session tokens, and magic-link tokens are hashed using SHA-256 before storage; raw secrets are never recoverable from database dumps (`modules/platform/accounts.mjs` `sha256`, `lookupApiKey`).
- **Network Guard & SSRF Defense:** Outbound media fetches validate DNS records and enforce private, loopback, and link-local IP address blocking on every redirect hop (`modules/platform/netguard.mjs` `publicUrl`, `resolvesPublic`).
- **Secret Redaction:** Passwords, bearer tokens, and credentials are automatically scrubbed from application logs (`modules/platform/log.mjs` `redact`, `redactString`).

---

## 8. Supervisory Authority & Contact

If you have questions, data subject requests, or privacy complaints:
- **Email:** `info@threefold.eco`
- **Mail:** Threefold Ltd, Attn: Data Protection, 114 Glen Road, Glenariffe, Ballymena, Northern Ireland, BT44 0RG

You also have the statutory right to lodge a complaint with your local Data Protection Supervisory Authority (e.g. the Irish Data Protection Commission (DPC), the UK Information Commissioner's Office (ICO), or your local German State Data Protection Authority).
