You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AI integration tests don't assert absence of PII when sendDefaultPii is false #19801
All AI provider integration tests use expect.objectContaining() to verify span data when sendDefaultPii: false. The PII attributes are simply omitted from the expected object rather than explicitly asserted as absent. This means a regression that leaks PII attributes onto spans when sendDefaultPii is disabled would pass all existing tests.
The explicit negative assertions should remain the primary contract here. I would add one independent whole-envelope check as a second guard, because it catches PII that moves to a renamed or newly nested attribute while objectContaining-style tests keep passing.
Using exact fixture terms avoids detector ambiguity for test identifiers, while built-in format detection can catch unexpected credentials/PII introduced elsewhere. scan() omits matched values by default, so a failed CI assertion can report detector/path/location without echoing the PII into Actions logs.
I would pair this with direct not.toHaveProperty(...) checks for every documented sendDefaultPii: false attribute—the scanner is defense in depth, not a replacement for the SDK's precise field contract.
Maintainer disclosure: I maintain Flare Redact, used in the example.
Activity
linear-code commentedon Mar 13, 2026
JS-1939
umudhasanli commentedon Aug 4, 2026
The explicit negative assertions should remain the primary contract here. I would add one independent whole-envelope check as a second guard, because it catches PII that moves to a renamed or newly nested attribute while
objectContaining-style tests keep passing.Using exact fixture terms avoids detector ambiguity for test identifiers, while built-in format detection can catch unexpected credentials/PII introduced elsewhere.
scan()omits matched values by default, so a failed CI assertion can report detector/path/location without echoing the PII into Actions logs.I would pair this with direct
not.toHaveProperty(...)checks for every documentedsendDefaultPii: falseattribute—the scanner is defense in depth, not a replacement for the SDK's precise field contract.Maintainer disclosure: I maintain Flare Redact, used in the example.
test(node): Assert absence of PII attributes in OpenAI integration te…