# Partner data matching

Add a partner's outcome data to a campaign through a Partner Clean Room, the trade's data clean room for two owners. Both sides approve one question, the match runs once under both owners' rules, and each side receives the answer with a signed proof file.

| Capability | Runtime | Status |
|---|---|---|
| Run the sample matching steps against configured public-test `/api/v1/cleanroom/*` | Sandbox | Preview |
| Deploy the two-owner worker and verify its proof under the owners’ grants | Tenant Cloud | Preview |
| Build a partner audience for a destination both owners name | Tenant Cloud | Preview |

## The four steps

1. **Add a partner's data.** Each side names one table and the key it matches on.
2. **Match Key Test.** Both sides normalize and hash five sample emails. The test passes when all five hashes agree, and no customer row is read before it does.
3. **Both sides approve.** Each organization signs the same job. If its signed card names a human passkey, the verifier also requires that person's approval. Both cards in this sample do.
4. **Result.** The worker answers the one question, and both sides get the answer and its signed proof file.

```mermaid
flowchart LR
  a["Publisher's table"]
  b["Advertiser's table"]
  check["Match Key Test: 5 sample emails"]
  approve["Both sides approve one job"]
  job["Partner Clean Room job"]
  out["Answer and signed proof file"]
  a --> check
  b --> check
  check --> approve
  approve --> job
  job --> out
```

## Step 1: the tables and the question

The answer lists both tables, the questions a match can answer, and the protections on the result. Answer trimmed to the two tables.

```sh preview
curl -s "$PRECISE_URL/api/v1/cleanroom/partners"
```

```json answer
{
  "tables": [
    {
      "side": "a",
      "owner": "publisher",
      "table": "exposures-2026-11",
      "rows_rounded": 600,
      "matched_on": "hashed_email",
      "filled_pct": 100,
      "counts": "person",
      "smallest_group": 50
    },
    {
      "side": "b",
      "owner": "advertiser",
      "table": "conversions-2026-11",
      "rows_rounded": 600,
      "matched_on": "email",
      "filled_pct": 100,
      "counts": "person",
      "smallest_group": 25
    }
  ],
  "runs_live": true
}
```

Each table shows a rounded row count, the share of rows that carry the match key (`filled_pct`), what a row counts (`person`) and its owner's minimum group size. The exact row count stays with its owner. `runs_live: true` means the server can run a new synthetic job with its local worker; without the worker it replays recorded jobs. The full answer adds the digest of each pinned snapshot, and lists three questions and two protections.

| Question | `operation` | The answer |
|-|-|-|
| Audience overlap count | `overlap_count` | Both totals, the matched count and the overlap rate |
| Lift vs. BAU Control Line | `group_lift` | For each setup, the people eligible and the people found in the partner's table |
| Targetable partner audience | `adcp_segment_activation` | The audience size and a segment manifest: segment ID, the destination both owners named, expiry, a revocation handle and the digest of its tokens. The destination can tell which of its own identifiers are in the audience; noise covers counts and does not cover this membership |

| Protection | `privacy` | What it does |
|-|-|-|
| Exact counts (small groups suppressed) | `strict_floor` | The default. A count under the floor is withheld |
| Enhanced privacy (differential privacy) | `geometric_dp` | Every count gets two-sided geometric noise at the stated epsilon, drawn against each owner's budget |

## Step 2: the Match Key Test

Two sides match only when both prepare an address the same way before hashing. The test uses five public sample addresses that exercise the rules of `precise.email-norm/v1`: trim, lowercase, Unicode NFKC, Gmail dots, Gmail `+suffix`, and `googlemail.com` read as `gmail.com`. It runs before any row is read.

```sh preview
curl -s -X POST "$PRECISE_URL/api/v1/cleanroom/preflight" \
  -H 'content-type: application/json' \
  -d '{"scenario": "match"}'
```

```json answer
{
  "scenario": "match",
  "ready": true,
  "rows_read": 0,
  "checks": [
    {
      "ok": true,
      "title": "canary  5 of 5 canary hashes agree on both sides"
    }
  ]
}
```

All five sample hashes agree, the job is ready and no row was read. Answer trimmed to readiness and the Match Key Test. Gate automation on `ready` and the `canary` check.

When one side prepares an address differently, the test stops the job before any row is read and names the address and the rule it breaks. Answer trimmed to the reading and its cause.

```sh preview
curl -s -X POST "$PRECISE_URL/api/v1/cleanroom/preflight" \
  -H 'content-type: application/json' \
  -d '{"scenario": "mismatch"}'
```

```json answer
{
  "scenario": "mismatch",
  "ready": false,
  "rows_read": 0,
  "checks": [
    {
      "ok": false,
      "title": "canary  canary: the two matching pipelines differ; no data was read. owner b canary 1 (\"J.a.n.e.Doe+news@GoogleMail.com\"): expected d6117306485e got 1ad426a0fadc: does not remove dots from Gmail addresses"
    }
  ],
  "about": "Partner B's pipeline keeps the dots in a Gmail address. Its card was altered after signing to declare that hash, so the worker also reports the altered card."
}
```

The `scenario` field picks one of the two recorded cases. In a live room the test runs on the two sides' own signed hashes.

## Steps 3 and 4: approve and run

Each owner approves the exact job: the question, the protection, the worker image, who runs it and in which region, who pays and the most it may cost. An audience job also names its destination and how long the audience lives. Then the job runs. The sample uses the current worker and its nine verification checks, listed on [Offline verification](../security-and-infosec/offline-verification.md). Answer trimmed to the result and its summary.

```sh preview
curl -s -X POST "$PRECISE_URL/api/v1/cleanroom/run" \
  -H 'content-type: application/json' \
  -d '{"operation": "overlap_count", "privacy": "strict_floor"}'
```

```json answer
{
  "operation": "overlap_count",
  "privacy": "strict_floor",
  "result": {
    "a_total": {
      "value": 600
    },
    "b_total": {
      "value": 600
    },
    "matched": {
      "value": 200
    },
    "overlap_rate_bps": 3333,
    "privacy": {
      "floor": 100,
      "mode": "strict_floor"
    },
    "unit": "person"
  },
  "sentence": "200 people are in both tables: 33.3% of the smaller one.",
  "both_sides_approved": true,
  "approvals": {
    "organizations": 2,
    "passkeys": 2
  },
  "match_formats_agree": true,
  "smallest_group": 100,
  "sealed_by": "test-authority",
  "note": "attested by a test authority, not by hardware",
  "verification": {
    "ok": true,
    "level": "merkle_local"
  }
}
```

Each new run returns its own `proof_id`, omitted from this excerpt. Pass the returned ID to `get_proof_file`. Read the other fields as follows.

- **`sentence`** is the result in plain words: 200 people are in both tables.
- **`smallest_group`** is 100. The floor is the largest of the two owners' minimums (50 and 25) and the minimum audience both sides signed (100).
- **`approvals`** counts two organization signatures and two passkey approvals.
- **`sealed_by`** names the attestation authority. In this sample it is a test authority, not confidential hardware.
- **`verification.level`** is `merkle_local`: every check passed and the run sits in a signed Merkle tree.
- **`proof_id`** names the proof file. Download it with `GET /api/v1/proofs/{proof_id}`.

With `"operation": "group_lift"` and `"privacy": "geometric_dp"`, the recorded run reports 100 of 300 on the Precise setup and 80 of 304 on the BAU Control Line (33.33% and 26.31%). These counts carry two-sided geometric noise at epsilon 1.

## Build a launch audience with a data partner

This is the second door of [Launch Audiences](../buyers-and-agencies/launch-audiences.md): a new audience built from a partner's records for one campaign. It runs the same four steps with the audience question.

1. **Match Key Test.** Five sample emails first, as above. Nothing is read until all five hashes agree.
2. **One job, both owners.** Both owners approve one `adcp_segment_activation` job. The job names the destination allowed to receive the audience (`destination.agent`), how long the audience lives (`destination.ttl_seconds`) and the smallest audience both sides accept.
3. **The audience.** The worker builds it only when both the true matched count and the released count meet the strictest signed floor. It writes the segment manifest into the proof file and a token file for the destination. The destination recomputes the same token from each of its own identifiers.
4. **The right to deliver.** A clean-room total or a minimum group size does not by itself grant the right to deliver membership to a DSP or exchange. That right is a separate term the data owner signs with the destination.
5. **Package and measure.** The audience goes out through DSP Direct or behind one Curated Deal ID, and is measured from day 1 against a BAU Control Line. `group_lift` reads the outcome for each setup inside the clean room. The settled lift joins the prior pool for the next launch, as [Methodology and holdouts](methodology-and-holdouts.md#launch-audiences-from-priors) describes.

Today the worker writes the manifest and token file locally. Sending the tokens to the destination, encrypted to its key, is next to build. [Known limits](../../reference/known-limits.md) lists the rest.

## What the proof file holds

- The question both sides approved, with both organization signatures and every passkey approval the cards require.
- Both table cards and the record of the five-address Match Key Test.
- The worker's attestation and the two signatures on its image.
- Each owner's ledger entry for this release.
- The result, signed by a key made for this run alone.

Anyone holding the file can check all of it with no network. See [Offline verification](../security-and-infosec/offline-verification.md).

## From an agent

The same three operations are MCP tools on Precise Access: `list_partner_tables`, `check_match_formats` and `run_partner_match`. The room itself is described for security readers in [Partner Clean Room](../security-and-infosec/partner-clean-room.md).
