Skip to content

docs(integrations): add NoPII gateway#2964

Open
evdevlead wants to merge 2 commits into
langfuse:mainfrom
Enigma-Vault:docs/add-nopii-provider
Open

docs(integrations): add NoPII gateway#2964
evdevlead wants to merge 2 commits into
langfuse:mainfrom
Enigma-Vault:docs/add-nopii-provider

Conversation

@evdevlead
Copy link
Copy Markdown

@evdevlead evdevlead commented May 18, 2026

Summary

Adds NoPII to the gateways section. NoPII is a hosted privacy proxy that exposes OpenAI- and Anthropic-compatible endpoints; it tokenizes PII in outbound prompts before they reach the LLM, then restores the original values in the response.

NoPII has built-in Langfuse support: when enabled in the NoPII admin console, every proxied request emits server-side spans (sanitize, llm-call, desanitize) directly to the user's Langfuse project. Combined with the W3C traceparent header, client-side application traces and NoPII's server-side traces appear together as a single end-to-end trace in Langfuse.

Files

  • content/integrations/gateways/nopii.mdx (new) — integration page covering OpenAI and Anthropic via Langfuse's @observe() decorators with traceparent propagation.
  • content/integrations/gateways/meta.json — adds "nopii" to the alphabetical pages list.
  • public/images/integrations/nopii_icon.svg (new) — 960-byte square logo.

Verification

All code examples on the page are lifted verbatim from runnable examples in the NoPII repo and have been validated end-to-end:

PR prepared with the assistance of Claude.

Greptile Summary

This PR adds a new NoPII gateway integration page to the Langfuse docs, demonstrating how to route LLM calls through NoPII's PII-stripping proxy while linking client-side @observe() traces to NoPII's server-side spans via the W3C traceparent header.

  • nopii.mdx: New integration page with two end-to-end examples (OpenAI and Anthropic) that correctly use langfuse.get_current_trace_id() / langfuse.get_current_observation_id() to build a valid W3C traceparent; both IDs are W3C Trace Context–compliant (32-char and 16-char hex strings respectively), so NoPII's sanitize/llm-call/desanitize spans land in the correct trace.
  • meta.json: Inserts "nopii" in its correct alphabetical position in the gateways sidebar.
  • nopii_icon.svg: Adds a lightweight (960-byte) vector logo for the integration card.

Confidence Score: 5/5

Safe to merge — this is a documentation-only addition with no application logic changes.

The previously raised concerns about random trace/span IDs have been fully addressed: the examples now use langfuse.get_current_trace_id() (32-char hex, W3C trace-id compliant) and langfuse.get_current_observation_id() (16-char hex, W3C parent-id compliant), producing a correctly formed traceparent. All Langfuse SDK calls (update_current_generation, get_current_trace_id, get_current_observation_id) are documented v3 SDK methods. The meta.json ordering is alphabetically correct, and the SVG logo is well-formed.

No files require special attention.

Sequence Diagram

sequenceDiagram
    participant App as Client App
    participant LF as Langfuse SDK (@observe)
    participant NoPII as NoPII Proxy
    participant LLM as LLM Provider (OpenAI/Anthropic)
    participant LFBE as Langfuse Backend

    App->>LF: "customer_lookup(prompt) [@observe]"
    LF->>LF: create trace span
    App->>LF: "call_llm(prompt) [@observe as_type=generation]"
    LF->>LF: create generation span
    LF-->>App: trace_id (32 hex), span_id (16 hex)
    App->>App: "build traceparent 00-{trace_id}-{span_id}-01"
    App->>NoPII: POST /chat/completions + traceparent header
    NoPII->>NoPII: sanitize PII to vault tokens
    NoPII->>LLM: POST sanitized prompt (no raw PII)
    LLM-->>NoPII: response (tokenized)
    NoPII->>NoPII: desanitize to restore PII
    NoPII-->>App: response (original PII restored)
    NoPII->>LFBE: server-side spans (sanitize, llm-call, desanitize) parented to traceparent
    App->>LFBE: "client-side spans via @observe flush"
    Note over LFBE: Single unified trace in Langfuse UI
Loading

Reviews (3): Last reviewed commit: "docs(integrations): fix nopii trace prop..." | Re-trigger Greptile

Adds NoPII to the gateways section. NoPII is a hosted privacy
proxy that exposes OpenAI- and Anthropic-compatible endpoints
and tokenizes PII in outbound prompts before they reach the LLM.

NoPII has built-in Langfuse support: when enabled in the NoPII
admin console, every proxied request emits server-side spans
(sanitize, llm-call, desanitize) directly to the user's Langfuse
project. The integration page covers both OpenAI and Anthropic
clients using Langfuse's @observe() decorators, and shows how the
W3C traceparent header links client-side application traces with
NoPII's server-side traces for a single end-to-end trace view.

Files:
- content/integrations/gateways/nopii.mdx (new)
- content/integrations/gateways/meta.json (add 'nopii' alphabetically)
- public/images/integrations/nopii_icon.svg (new)

Source: https://github.com/Enigma-Vault/NoPII/tree/main/examples
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

@ev-engineering is attempting to deploy a commit to the langfuse Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 18, 2026

CLA assistant check
All committers have signed the CLA.

@evdevlead evdevlead marked this pull request as ready for review May 18, 2026 15:29
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. documentation Improvements or additions to documentation labels May 18, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d570d287a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread content/integrations/gateways/nopii.mdx Outdated
Comment thread content/integrations/gateways/nopii.mdx Outdated
Comment thread content/integrations/gateways/nopii.mdx Outdated
@evdevlead evdevlead marked this pull request as draft May 18, 2026 15:34
The original examples generated a fresh trace_id/span_id via uuid.uuid4
and passed those to NoPII as the W3C traceparent. Because Langfuse's
@observe() decorator had already started its own trace with a different
ID, NoPII's server-side spans landed under an unrelated trace and the
"single end-to-end trace" promised by the guide did not appear.

Pull the active Langfuse trace and observation IDs at the point of the
LLM call (langfuse.get_current_trace_id and get_current_observation_id)
and forward those as the traceparent. NoPII's sanitize / llm-call /
desanitize spans now attach as children of the generation in the same
trace.

Applies the same fix to both the OpenAI and Anthropic examples and
matches the updated source examples in NoPII-Examples.
@evdevlead evdevlead force-pushed the docs/add-nopii-provider branch from a0a9bc6 to 6891bc1 Compare May 18, 2026 15:45
@evdevlead
Copy link
Copy Markdown
Author

Thanks for the catch, @codex. Confirmed the issue was real: the original code generated fresh trace_id and span_id values via uuid.uuid4 instead of propagating the active Langfuse context, so NoPII's server-side spans would have landed under a different trace.

Both examples now pull the active trace and observation IDs via langfuse.get_current_trace_id() and langfuse.get_current_observation_id() and forward those as the W3C traceparent. Fix in 6891bc17. The matching upstream examples in NoPII-Examples were updated in parallel.

@chatgpt-codex-connector
Copy link
Copy Markdown

To use Codex here, create an environment for this repo.

@evdevlead evdevlead marked this pull request as ready for review May 18, 2026 15:49
@evdevlead
Copy link
Copy Markdown
Author

The P1 findings raised by Codex and Greptile (random trace_id/span_id instead of propagating Langfuse's active trace context) were addressed in commit 6891bc1. Both the OpenAI and Anthropic examples now read the active trace_id and observation_id from Langfuse via langfuse.get_current_trace_id() and langfuse.get_current_observation_id(), so NoPII's server-side spans correctly attach to the same trace.

@greptileai please re-review on the latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants