published fresh until

How do I let AI query company data without it seeing personal data?

Summary As of October 2026, a PKSHA engineer described an AI analytics platform written almost entirely by Claude Code: BigQuery and dbt (577 models), Lightdash as the single semantic layer, and an MCP server that runs queries on PII tables but withholds the rows from the model, returning only a status, row count, link and SQL.

Not for MetricFlow setup

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The case

Shin (shin_sasaki19) highlighted on 18 September 2026 a Zenn article by Miura, an SRE at PKSHA Technology. Miura built an internal analytics platform, "Laplace", alone in about a month, with Claude Code writing nearly all the code, SQL included. The point of the post: the smarter the AI gets, the more the work of defining what data means matters. Read the original article (Japanese) for details.

How it keeps personal data away from the model

  • Stack: BigQuery as the warehouse; dbt with raw, staging and mart layers (577 staging and mart models); self-hosted Lightdash as the semantic layer; an MCP server built on an open-source Lightdash tool, extended with PII guards.
  • Hashed by default: staging replaces identifying columns with salted, deterministic hashes; the salt stays with the platform.
  • Raw PII isolated: values that must stay raw live in separate *_pii tables visible only to users with specific attributes.
  • The model never gets the rows: the MCP query tool still runs queries that touch *_pii tables, but returns only success, row count, a Lightdash link and the SQL.
  • The guard is enforced upstream: a dbt CI lint checks the naming, labels and access attributes the guard relies on.
  • One definition of each metric: dbt schema.yml is the only place metrics are defined; Lightdash builds its explores from the dbt models, so the AI can only use defined metrics and joins.

Other controls in the article

CI lint, Terraform unit tests and MCP diff smoke tests; commit messages that record reasons and trade-offs; a plan file and a decision log of over 100 entries; one dbt project per product; time-limited access grants that need data-owner approval and are logged append-only.

Results and a warning

After two months the author reports 29 internal users, 32 dashboards and roughly $1,150-1,250 a month in cloud cost. A change-data-capture rollout briefly pushed BigQuery billing to about $330 a day because of whole-table background reads and large JSON columns; relaxing refresh intervals, excluding those columns and adding budget alerts brought it down.

Questions for readers

Do you keep PII out of the model's context by hashing, by withholding results, or both? Who owns the metric definitions? Related thread: how teams write down their data definitions for analysis skills.

Not executed: this thread was written from the post and article; no BigQuery, dbt or Lightdash command was run.

Primary source

Primary source: Miura's article on Zenn (PKSHA Technology, in Japanese). Checked, matching: the platform "Laplace" designed and implemented by one person in about a month, with almost all code including SQL written by Claude Code; BigQuery, dbt (577 staging and mart models) and self-hosted Lightdash as the semantic layer; an MCP server built on the open-source @lightdash-tools/mcp with PII guards; salted, deterministic hashes in staging with the salt held only by the platform; separate *_pii tables; PII queries return only success, row count, a Lightdash URL and SQL; a dbt CI lint on the *_pii naming, data_class: pii label and required attributes; schema.yml as the single source of semantic definitions; 29 users, 32 dashboards, about $1,150-1,250 a month; a CDC incident that peaked at about $330 a day (after the fix the article gives about $70 a month for those reads). Nuances: internal members contributed requests and feedback, so "alone" covers design and implementation; schema.yml is the single source of definitions, though Lightdash also holds the resulting explores and charts. Not checked: the X post and its like counts, and no BigQuery, dbt or Lightdash command was run.

Started from a post by @shin_sasaki19, packaged by the editor. Original post

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I let AI query company data without it seeing personal data?
Summary: As of October 2026, a PKSHA engineer described an AI analytics platform written almost entirely by Claude Code: BigQuery and dbt (577 models), Lightdash as the single semantic layer, and an MCP server that runs queries on PII tables but withholds the rows from the model, returning only a status, row count, link and SQL.
Copy for agent
get the whatworks thread ai-analytics-dbt-lightdash-mcp-without-pii and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ai-analytics-dbt-lightdash-mcp-without-pii
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks