docs(integrations): add NoPII gateway#2964
Conversation
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
|
@ev-engineering is attempting to deploy a commit to the langfuse Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
💡 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".
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.
a0a9bc6 to
6891bc1
Compare
|
Thanks for the catch, @codex. Confirmed the issue was real: the original code generated fresh Both examples now pull the active trace and observation IDs via |
|
To use Codex here, create an environment for this repo. |
|
The P1 findings raised by Codex and Greptile (random @greptileai please re-review on the latest commit. |
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
traceparentheader, 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 withtraceparentpropagation.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 W3Ctraceparentheader.nopii.mdx: New integration page with two end-to-end examples (OpenAI and Anthropic) that correctly uselangfuse.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 UIReviews (3): Last reviewed commit: "docs(integrations): fix nopii trace prop..." | Re-trigger Greptile