Repository navigation
Conversation
Spans reach the self-hosted Langfuse over OTLP, and Langfuse writes every raw ingestion event to a retention-locked bucket (2,555 days in prod), so a prompt, response or end-user identifier on a span outlives the 90-day raw-prompt purge that the privacy impact assessment describes. Remove content and identity at every source: - POST /agent/query no longer sets the prompt, the response or enduser.id. thread.id is recorded only for a caller-supplied thread id, because the default advisor_session_<user_id> embeds the user id. - genai_span/record_completion, the inference proxy chat span, the NeMo rails and vLLM client, the advisor graph nodes and tool endpoint, MCP tracing and the MCP client record character lengths (cage.content.input_length, cage.content.output_length), never text or a hash of it. - Governor spans record governance.tool and violation codes instead of the tool parameters; the post-HITL span drops the thread id. - The NeMo block reason names the matched keyword instead of echoing the action result. Add ContentFilterSpanExporter in src/gateway/observability/content_filter.py and wrap every exporter that configure_telemetry(), setup_tracing() and the evaluator auditor build. It removes the denied exact keys, dotted prefixes, namespace-agnostic suffixes and identity-bearing captured headers from span, event and link attributes, and drops any span it cannot sanitise, logging only counts. telemetry_client now forces GenAI content capture, httpx body capture and TRACELOOP_TRACE_CONTENT off instead of forcing GenAI content capture on. Both workload modules set the three capture variables to "false" and no longer capture the IAP end-user email header; a static test fails if either module sets a capture variable to anything else. Canary tests assert that no prompt, response or user id appears in raw or exported span attributes, event attributes or resource attributes for the advisor request span, the inference proxy span, genai_span, the vLLM client and a LangGraph run under the LangChain instrumentation. BREAKING CHANGE: telemetry spans no longer carry prompt or response content or end-user identifiers (gen_ai.input.messages, gen_ai.output.messages, Langfuse observation input/output, enduser.id); httpx body and GenAI content capture are off in both workload modules.
lahlfors
force-pushed
the
fix/stop-raw-prompt-export
branch
from
November 16, 2026 03:49
f9c393d to
796a43c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stops raw prompts, model responses and end-user identifiers from leaving the process in telemetry. Telemetry goes to the trace store, whose raw-event bucket is retention-locked for 2555 days in every non-staging tier, while the PIA promises a 90-day purge of raw prompts. This fix keeps that promise true by changing what reaches the bucket. Tracked as
POAM-2026-225(#772, stacked on #771).enduser.id. It now recordscage.principal.verifiedand the input and output character lengths.thread.idis recorded only when the caller supplies it, because the default session id embeds the user id.genai_span,record_completion);src/gateway/observability/content_filter.pywraps every exporter: OTLP HTTP and gRPC, console,setup_tracing, and the evaluator's always-on exporter.TRACELOOP_TRACE_CONTENToff."false". They also stop capturing the IAP end-user email header. A test fails on any other value.BREAKING CHANGE: spans no longer carry prompt or response content or end-user identifiers. Indexed as TC-1 in
docs/BREAKING_CHANGES.md.Follow-ups, not in this PR:
compliance/oscal/system-security-plan.yaml, "prompt/response logging") must be restated within 2 business days of merge, per AGENTS.md.POAM-2026-225.record_exception;Verification
uv run pytest -m "local or unit" -n auto -q:10996 passed, 76 skipped, 0 faileduv run bandit -r src/ scripts/ -c pyproject.toml -ll -ii:0High /0Mediumscripts/check_import_boundaries.py,check_domain_literals.py,check_telemetry_literals.py,check_vendor_brands.py,check_doc_references.py: clean;terraform fmt -checkclean