Skip to content

Harden privacy boundaries for trace identifiers - #18

Merged
tjdonley merged 1 commit into
mainfrom
fix/privacy-boundary
Apr 26, 2026
Merged

tjdonley merged 1 commit into
mainfrom
fix/privacy-boundary

Conversation

@tjdonley

Copy link
Copy Markdown
Owner

Summary

  • Hash Langfuse userId and sessionId into privacy metadata, remove raw identity fields from sanitized raw span payloads, and stop promoting raw identities into normalized span attributes.
  • Enforce a minimum env HMAC salt length, surface missing/weak salts in doctor, and warn on every config-loading CLI command when privacy.store_raw_io is enabled.
  • Create .agentprof/.gitignore during agentprof init and refresh README examples to export a sufficiently long salt before doctor and imports.

Review

  • Self-review found raw identity fields still persisted in sanitized raw spans; fixed by removing userId/sessionId after hashing and adding import-level coverage.
  • Self-review found doctor would break older workspaces missing .agentprof/.gitignore; fixed by keeping .gitignore creation in init without making it a doctor requirement.
  • Final review found normalization still fell back to raw sessionId; fixed so normalized session IDs come only from session_hash.

Tests

  • uv run pytest tests/test_cli.py tests/test_privacy_hashing.py tests/test_langfuse_export_import.py tests/test_normalize.py
  • uv run pytest
  • uv build
  • git diff --check

@tjdonley
tjdonley merged commit 715f620 into main Apr 26, 2026
1 check passed
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.

1 participant