Skip to content

Clean Room Demo Script ​

Five demos. Fifteen minutes. Multi-org computation without data sharing.

This script walks through a complete federated clean room lifecycle using an M&A due diligence scenario. Two organizations need to analyze revenue overlap and customer concentration risk — without either seeing the other's raw data. The narrative follows the deal team experience from creation to signed provenance records.


Pre-Demo Checklist ​

  • [ ] GhostAI instance is running and reachable
  • [ ] PhD Mode is enabled: PHD_MODE_ENABLED=true
  • [ ] Clean Room is enabled: CLEAN_ROOM_ENABLED=true
  • [ ] Sandbox is enabled: SANDBOX_ENABLED=true
  • [ ] PhD sandbox image is built: docker images ghostai-phd-sandbox
  • [ ] Docker daemon is running: docker info
  • [ ] Two API keys available (one per org): ORG_A_API_KEY and ORG_B_API_KEY
  • [ ] Health check passes for both orgs
  • [ ] Browser open to GhostAI chat interface
  • [ ] Clean Room tab visible in the empty state demo selector
  • [ ] If using SDK: pip install -e securechat/sdk and verify from ghostscience import GhostScienceClient

Quick health check ​

bash
curl -s -H "Authorization: Bearer $ORG_A_API_KEY" \
  https://your-host/api/phd/health | python -m json.tool

Verify "sandbox_available": true and "phd_mode_enabled": true.


The Scenario ​

Acme Corp (acquirer) wants to buy WidgetCo (target). Both companies need to understand:

  1. How much customer overlap exists (revenue risk)
  2. Customer concentration in the combined entity
  3. Revenue synergy opportunities

Neither company will share its raw customer or revenue data. A federated clean room lets them run the analysis on combined data without either party seeing the other's inputs.


Demo 1: Create and Invite ​

Duration: 2 minutes Story: Acme's deal team creates a clean room and invites WidgetCo to participate.

Input (Chat) ​

Two companies in an acquisition want to model revenue overlap and customer concentration risk, but neither will show the other their raw books. Walk me through setting up a GhostScience federated clean room for this M&A due diligence scenario — from creation through mutual attestation, computation, result escrow, and dual-approved release.

Alternative Input (SDK — for technical audiences) ​

python
from ghostscience import GhostScienceClient

client_a = GhostScienceClient(api_key="ORG_A_API_KEY", base_url="https://your-host")
room = client_a.create_clean_room(
    name="M&A Revenue Overlap",
    description="Customer overlap and concentration analysis for Acme-WidgetCo acquisition"
)
print(f"Room ID: {room['id']}, Status: {room['status']}")
# → Room ID: cr-xxxx, Status: draft

Then invite WidgetCo:

python
invite = client_a.invite_to_clean_room(room["id"], org_id="org-widgetco")
print(f"Invited: {invite['org_id']}, Status: {invite['status']}")
# → Invited: org-widgetco, Status: invited

Expected Output ​

  • Clean room created in draft status
  • Invitation sent to WidgetCo's organization
  • Clean room shows two organizations: Acme (owner) and WidgetCo (invited)

Talking Points ​

"The clean room is created in 'draft' status. No computation can run yet — both parties have to agree on the exact code, environment, and configuration before anything executes. This is the 'mutual attestation' model."

"Notice the invitation is organization-scoped, not user-scoped. WidgetCo's entire security team can review the clean room before accepting."


Demo 2: Set Template and Attestation ​

Duration: 3 minutes Story: Both organizations agree on the computation code and verify the environment cryptographically.

Input (Chat — continuing the narrative) ​

Explain how mutual attestation works in a GhostScience clean room. What hashes are verified (sandbox image, computation code, configuration), how do both parties sign off, and what happens if one party's attestation hash doesn't match?

Alternative Input (SDK) ​

WidgetCo accepts the invitation:

python
client_b = GhostScienceClient(api_key="ORG_B_API_KEY", base_url="https://your-host")
client_b.accept_clean_room(room["id"])

Acme sets the computation template:

python
template_code = """
import pandas as pd
import numpy as np

# Both orgs' data loaded automatically as org_a_data, org_b_data
overlap = pd.merge(org_a_data, org_b_data, on='customer_hash', how='inner')
total_overlap_revenue = overlap['revenue_a'].sum() + overlap['revenue_b'].sum()
concentration = overlap.groupby('customer_hash')['revenue_a'].sum().nlargest(10)
print(f"Overlap customers: {len(overlap)}")
print(f"Combined overlap revenue: ${total_overlap_revenue:,.2f}")
print(f"Top-10 concentration: {concentration.to_dict()}")
"""

client_a.set_clean_room_template(room["id"], code=template_code)

Both organizations generate and submit attestation:

python
# Acme attests
bundle_a = client_a.attest_clean_room(room["id"])
print(f"Image hash: {bundle_a['image_hash'][:16]}...")
print(f"Code hash:  {bundle_a['code_hash'][:16]}...")
print(f"Config hash: {bundle_a['config_hash'][:16]}...")
print(f"Combined:   {bundle_a['combined_hash'][:16]}...")

# WidgetCo attests
bundle_b = client_b.attest_clean_room(room["id"])
print(f"Hashes match: {bundle_a['combined_hash'] == bundle_b['combined_hash']}")
# → Hashes match: True

Expected Output ​

  • Clean room transitions from draft → attesting → ready
  • Both organizations' attestation bundles contain four SHA-256 hashes:
    • Image hash: sandbox Docker image
    • Code hash: the computation template
    • Config hash: resource limits, timeout, allowed libraries
    • Combined hash: HMAC of image + code + config
  • Both combined hashes match — the room moves to ready

Talking Points ​

"This is the key trust mechanism. Both General Counsels can independently verify that the exact same Docker image, code, and configuration will be used. If WidgetCo's hash doesn't match Acme's, the room won't progress — the system rejects the attestation."

"These are real SHA-256 hashes, not summaries. The GC's team can verify them independently. The sandbox image hash is deterministic from the Dockerfile, which is version-controlled."

"In traditional M&A, the data room takes 6-8 weeks and both parties see everything. Here, neither party sees the other's data, and the entire analysis happens in minutes."


Demo 3: Execution ​

Duration: 3 minutes Story: The attested computation runs in a hardened sandbox on combined data. Results are encrypted immediately.

Input (Chat) ​

Walk me through the result escrow release flow in a clean room computation. After the model runs, results are encrypted and held — how does the summary review work, what happens when both CFOs approve, and what happens if one party rejects (results destroyed)?

Alternative Input (SDK) ​

If the room is in ready status, execution triggers automatically, or:

python
# Check status
status = client_a.get_clean_room(room["id"])
print(f"Status: {status['status']}")
# → Status: executing (or escrowed, if already complete)

Expected Output ​

  • Clean room transitions from ready → executing → escrowed
  • Computation runs inside a gVisor-isolated container:
    • No network access
    • Read-only filesystem
    • Memory limited to configured threshold
    • CPU limited to configured threshold
    • seccomp profile blocks dangerous syscalls
  • Results are encrypted with an escrow key before storage
  • Neither organization can see results yet

Talking Points ​

"The computation is running inside a gVisor sandbox — that's kernel-level isolation, not just container isolation. The sandbox has no network access, a read-only filesystem, and strict resource limits. This is the same isolation model used by Google Cloud Run."

"Results are encrypted immediately after execution and held in escrow. Neither Acme nor WidgetCo can see them yet. Both parties have to approve release — this is the dual-approval gate."

"The execution environment is the exact Docker image both parties attested to. The code is the exact template they reviewed. There's zero room for tampering."


Demo 4: Dual Approval Release ​

Duration: 3 minutes Story: Both organizations review a summary and decide whether to release the full results.

Input (SDK) ​

python
# Both parties review the escrowed summary
summary_a = client_a.get_clean_room_results(room["id"])
print(f"Summary: {summary_a['summary']}")
# → Summary: "Computation completed. 3 output values. No PII detected in results."

# Acme approves
client_a.release_clean_room(room["id"], decision="approve")

# WidgetCo approves
client_b.release_clean_room(room["id"], decision="approve")

# After both approve, results are decrypted
results = client_a.get_clean_room_results(room["id"])
print(results["output"])
# → Overlap customers: 847
# → Combined overlap revenue: $42,350,000.00
# → Top-10 concentration: {...}

What if one party rejects? ​

python
client_b.release_clean_room(room["id"], decision="reject")
# → Room status: "rejected"
# → Escrowed results are destroyed (key deleted)
# → Neither party ever sees the output

Expected Output ​

  • Both approve → room transitions from escrowed → released, results decrypted
  • One rejects → room transitions from escrowed → rejected, escrow key destroyed, results permanently unrecoverable

Talking Points ​

"This is the 'nuclear option' that gives both General Counsels confidence. If WidgetCo's GC doesn't like the summary — maybe the output count suggests too much data was processed — they reject, and the results are destroyed. Not archived, not hidden — destroyed. The encryption key is deleted."

"In traditional data rooms, once you've seen the data, you can't unsee it. Clean rooms give you a preview before committing. This is a fundamentally different trust model."

"For the CFO: this analysis would take 6-8 weeks with a traditional consulting engagement and cost $500K+. We just did it in 15 minutes with cryptographic guarantees."


Demo 5: Dual Provenance ​

Duration: 3 minutes Story: Each organization gets an independent audit record proving what happened — without revealing the other's data.

Input (Chat) ​

Show how dual provenance records work in a federated clean room. Each General Counsel gets an independent record — how does it prove what their side contributed, that the agreed model ran in the attested environment, and that the output is identical for both parties, without revealing the other org's input data?

Alternative Input (SDK) ​

python
# Acme's provenance record
prov_a = client_a.get_clean_room_provenance(room["id"])
print(f"Org: {prov_a['org_id']}")
print(f"Room: {prov_a['room_id']}")
print(f"Code hash: {prov_a['code_hash'][:16]}...")
print(f"Environment hash: {prov_a['environment_hash'][:16]}...")
print(f"Result hash: {prov_a['result_hash'][:16]}...")
print(f"Timestamp: {prov_a['created_at']}")

# WidgetCo's provenance record
prov_b = client_b.get_clean_room_provenance(room["id"])

# Both see the same result hash
print(f"Result hashes match: {prov_a['result_hash'] == prov_b['result_hash']}")
# → True

# But each only sees their own org's input metadata
print(f"Acme sees WidgetCo data: {'org_b_data' in str(prov_a)}")
# → False

Expected Output ​

  • Each organization gets an independent ComputationRecord
  • Both records contain:
    • Clean room ID
    • Code hash (identical — both attested)
    • Environment hash (identical — same image)
    • Result hash (identical — same output)
    • Timestamp
  • Each record contains only that organization's input metadata
  • Neither record reveals the other organization's data or input schema

Talking Points ​

"This is the 'trust but verify' moment. Acme's GC takes their provenance record to the board and says: 'Here's proof. This exact code ran in this exact environment. Here's the result hash. WidgetCo has the same hash — we can both independently verify the result wasn't tampered with.'"

"What Acme's record does NOT contain is anything about WidgetCo's data — not the schema, not the row count, not any values. That's the federated guarantee."

"For SEC reporting, HSR Act filings, and SOX compliance, this record is the audit trail. It proves the analysis was conducted properly without requiring either party to disclose protected information."


Recovery Steps ​

Clean Room not enabled ​

POST /api/clean-room returns 403 or feature not available

Fix: Set CLEAN_ROOM_ENABLED=true in .env and restart the backend.

Attestation hash mismatch ​

If one org's hashes don't match (e.g., someone rebuilt the Docker image between attestations):

  1. Have both orgs re-pull the same image
  2. Delete the existing attestations (re-enter attesting state)
  3. Both orgs re-attest
python
# Hashes will now match
client_a.attest_clean_room(room["id"])
client_b.attest_clean_room(room["id"])

Escrow timeout ​

Clean rooms have a configurable escrow duration. If no one approves/rejects within the window, the room moves to expired and results are destroyed. Default is 48 hours; adjust for demos:

CLEAN_ROOM_ESCROW_TIMEOUT_HOURS=2

Sandbox unavailable ​

Same fix as GhostScience demo — verify Docker, image, and sandbox health.

"Both orgs" with one laptop ​

For demos on a single machine, use two terminal windows with different API keys:

bash
# Terminal 1 — Acme
export GHOSTSCIENCE_API_KEY="org-a-key"
python demo_acme.py

# Terminal 2 — WidgetCo
export GHOSTSCIENCE_API_KEY="org-b-key"
python demo_widgetco.py

Or use the SDK in a single script with two client instances.


Demo Flow Cheat Sheet ​

#DemoDurationStatus TransitionKey Moment
1Create & Invite2 min→ draftRoom created, WidgetCo invited
2Template & Attestation3 min→ attesting → readyBoth hashes match, room is ready
3Execution3 min→ executing → escrowedgVisor sandbox, results encrypted
4Dual Approval3 min→ released (or rejected)Both CFOs approve, results decrypted
5Dual Provenance3 min—Independent audit records, same hash
Total~14 min

Frequently Asked Questions (From Demos) ​

"What if one company changes the code between attestation and execution?"

They can't. The code is hashed during attestation. The execution engine verifies the hash before running. If the code was modified, the hash won't match and execution is rejected.

"Who holds the escrow key?"

The GhostAI platform holds the escrow key in a key-management service. Neither organization has access to it. The key is deleted on rejection or expiration. In air-gapped deployments, the key is stored in an HSM.

"Can the GhostAI platform see the results?"

The platform orchestrates execution and holds the escrow key, but results are encrypted at rest. In customer-managed deployments, the customer controls the KMS. In SaaS, GhostAI operates under a zero-knowledge policy with contractual guarantees.

"How is this different from Snowflake Clean Rooms?"

Snowflake Clean Rooms operate within Snowflake's data cloud — both parties must be Snowflake customers. GhostScience clean rooms are infrastructure-agnostic, support scientific computing (not just SQL), include AI-powered analysis, and provide cryptographic attestation with dual provenance. Snowflake has no equivalent to the attestation bundle or dual-approval escrow.

"What about AWS Clean Rooms?"

AWS Clean Rooms are SQL-based and operate within the AWS ecosystem. GhostScience clean rooms support arbitrary Python scientific computing with 50+ libraries, run in gVisor-isolated sandboxes, and provide per-organization provenance records. AWS has no equivalent to the mutual attestation or result escrow model.

"Can this handle real M&A deal sizes?"

Yes. The sandbox supports configurable memory (default 4GB, up to 32GB) and CPU limits. For large datasets, the computation template can use chunked processing or sampling strategies. The 48-hour escrow window is configurable.


For a hands-on setup of the two-org flow from scratch, see the Clean Room Full Lab. For GhostScience demos, see the GhostScience Demo Script.

SOC 2 Type II Certified | BAA Available | HIPAA-Ready