Repository navigation
feat: inject placeholder-preservation prompt for online providers - #11
Merged
Merged
Conversation
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
Round 2 step 3 of SplitMind privacy routing. After unifying the redaction source of truth (PR #10), remote providers received redacted text containing placeholders like
[REDACTED_EMAIL_0]but no instruction to preserve them. Models could translate, drop, reformat, or invent placeholders, breaking local restoration.This PR injects a placeholder-preservation instruction into the provider system prompt when a subtask carries privacy placeholders.
Changes
splitmind/providers/base.pybuild_placeholder_preservation_instruction(placeholders): builds the instruction from placeholder IDs only; returns empty string when there are none. Only placeholder IDs are used; original values are never included.compose_system_prompt(task_type, system_prompt, placeholders): composes the task system prompt and appends the preservation instruction when placeholders exist.splitmind/core/engine.py_execute_with_onlinebuilds the system prompt viaprovider.compose_system_prompt(...)usingsubtask.sensitive_info.keys()and passes it togenerate_async.tests/test_placeholder_preservation.py(new)Privacy guarantee tested
The integration test asserts that the system prompt and the sent prompt contain placeholder IDs but never the raw sensitive values.
Validation
Result:
Review note:
~/pip/reviews/splitmind-placeholder-preservation-prompt-2026-06-25.mdNot included