Skip to content

test(node): Assert absence of PII-bearing gen_ai attributes when recording is disabled - #24776

Closed
sx4im wants to merge 1 commit into
getsentry:developfrom
sx4im:feat/genai-pii-absence-assertions
Closed

sx4im wants to merge 1 commit into
getsentry:developfrom
sx4im:feat/genai-pii-absence-assertions

Conversation

@sx4im

@sx4im sx4im commented Sep 27, 2026

Copy link
Copy Markdown

The 'genAI recording disabled' integration tests for Anthropic, LangChain, and Google GenAI asserted non-PII attributes but never explicitly checked that content-bearing attributes stay absent. This adds explicit toBeUndefined assertions for input messages, system instructions, response text/tool calls, tool definitions, and embeddings input on every span in those disabled scenarios, so a regression in the recording gate fails loudly instead of silently leaking PII into span data.

Verified locally: all 73 tests across the three suites pass (suites/tracing/anthropic, suites/tracing/langchain, suites/tracing/google-genai); oxlint and oxfmt clean.

Fixes #19801

…rding is disabled

The 'genAI recording disabled' integration tests for Anthropic, LangChain,
and Google GenAI only asserted non-PII attributes. Add explicit assertions
that content-bearing attributes (input messages, system instructions,
response text/tool calls, tool definitions, embeddings input) are undefined
on every span, so a regression in the recording gate fails loudly.

Fixes #19801

Co-Authored-By: Muse Spark <noreply@meta.com>
Lms24
Lms24 previously approved these changes Sep 28, 2026
@Lms24
Lms24 dismissed their stale review September 28, 2026 10:38

Still in draft. Dismissing until ready for review.

@sx4im sx4im closed this Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI integration tests don't assert absence of PII when sendDefaultPii is false

2 participants