Add optional OpenAI Privacy Filter redaction backend#69
Open
Add optional OpenAI Privacy Filter redaction backend#69
Conversation
Tracebook needs a stronger optional PII layer without changing the explicit redaction contract host apps already use. This adds a config-gated OpenAI Privacy Filter sidecar adapter, keeps regex/custom redactors first, restricts the sidecar endpoint to loopback addresses, and preserves fallback behavior when the sidecar cannot return usable spans. The release metadata moves the gem to 1.1.0, records the feature in the changelog, removes the dashboard CDN Stimulus fallback, and updates patched dependencies so release validation is not blocked by known advisories. Constraint: Issue #68 requires explicit Tracebook.redact placement, local sidecar behavior, stable placeholders, sidecar fallback, version bump, and changelog. Rejected: Hosted Hugging Face inference | would send raw conversation text to a third party by default. Rejected: Native Ruby ONNX runtime | larger dependency surface and higher drift from the official OPF implementation. Confidence: high Scope-risk: moderate Directive: Do not add automatic persistence, dashboard, export, or RubyLLM callback redaction without a separate explicit placement decision. Tested: bin/rails test; bundle audit check; targeted RuboCop on changed Ruby files; node --check app/assets/javascripts/tracebook/application.js; gem build/package contents check Not-tested: Real OpenAI Privacy Filter model or production sidecar process. Related: #68
This was referenced Apr 26, 2026
The branch uses OMX runtime files during autonomous work, but those files are local coordination state and should not appear as untracked PR noise. Constraint: .omx/ contains local workflow/session state, not project source Confidence: high Scope-risk: narrow Directive: Keep .omx/ ignored unless the repository explicitly starts owning OMX state Tested: git check-ignore -v .omx/ .omx/state Tested: git diff --check Not-tested: full Rails suite; ignore-only change
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
Tracebook::Redaction::OpenAiPrivacyFilterbackend for a local OpenAI Privacy Filter sidecar.Tracebook.redact(...); no dashboard/export/persistence/RubyLLM callback starts redacting automatically.1.1.0, and records the release in the changelog.Why
Tracebook already has regex/custom redaction, but issue #68 asks for an optional local model-backed layer for context-sensitive PII while preserving the existing explicit placement model and lightweight default install.
Changes
Add local privacy filter redaction backend
config.openai_privacy_filtersettings, the OPF sidecar adapter/client, stable placeholder mapping, loopback endpoint validation, fallback/raise failure modes, and tests for spans, invalid responses, connection failures, timeouts, and config behavior.Release and privacy hardening
Tracebook::VERSIONand lockfile metadata to1.1.0, added changelog/README/initializer docs, updated patched dependencies, and removed the dashboard's fallback load from unpkg.Testing
bin/rails test-> 90 runs, 210 assertions, 0 failuresbundle audit check-> No vulnerabilities foundbin/rubocop lib/generators/tracebook/install/templates/initializer.rb.tt lib/tracebook.rb lib/tracebook/config.rb lib/tracebook/redaction/openai_privacy_filter.rb lib/tracebook/version.rb test/lib/config_test.rb test/lib/redaction/config_integration_test.rb test/lib/redaction/openai_privacy_filter_test.rb-> no offensesnode --check app/assets/javascripts/tracebook/application.jsgem build tracebook.gemspec --output /tmp/tracebook-1.1.0.gemand gem specification contents includelib/tracebook/redaction/openai_privacy_filter.rbFull
bin/rubocopstill reports pre-existingtest/dummy/db/schema.rbarray-spacing offenses unrelated to this diff.Risk & Rollout
config.openai_privacy_filter.enabled = false.OpenAI Privacy Filter redaction skippedwarnings and confirm sidecar availability in host apps that enable the backend.Closes #68