Repository navigation
Mask PII in the engine (off by default), privacy switch, Console skills - #84
Merged
Merged
Conversation
privacy.mask_pii = off | regex | model. One vault per session in session/runner/llm.ts, the one place every provider request passes: emails, phones, cards and resident numbers (regex), plus people, organisations and places named by a configured LOCAL model (model), are replaced by placeholders on the way out and restored in every text delta and tool-call input on the way back. The system prompt is ours and is left alone. Also sends x-redrob-app from REDROB_APP so the Console can group AI work by app.
The value takes effect on the next message and is written to the user's global redrob.json.
console.redrob.ai/skills/ is the first skill source, before anything in config.skills, so every Redrob app that runs on the engine has the same skills.
The regenerated SDK gains SkillV2.autoInject, which the plugin API is typed from; the host converts readonly arrays at that boundary with the mutable() helper it already had.
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
The engine half of the insights / skills / privacy work. Everything is done once here so every Redrob app that runs on the engine inherits it.
privacy.mask_pii = off | regex | modelinredrob.json. Insession/runner/llm.ts, the one place every provider request passes, emails, phone numbers, card numbers (Luhn-checked) and Korean resident numbers are replaced by placeholders ([EMAIL_1]) before the request leaves the machine, for every provider.modeladds people, organisations and places named by a LOCAL model the engine already serves (privacy.model = provider/model, e.g. an Ollama model): the new text of each turn is sent to it, the answer is parsed as strict JSON, anything else is ignored. One vault per session, so the model sees the same placeholder for the same value across turns; placeholders are restored in every text delta (a placeholder split across two chunks is held back and joined) and in every tool-call input, so tools run on the real thing and the person reads the real thing. The system prompt is ours and is left alone. No new dependency, no on-device ONNX, no npm package.GETandPUT /api/privacy. An app shows a switch and nothing more.PUTtakes effect on the next message and is written to the user globalredrob.json, so it holds across restarts and across apps.x-redrob-app. The engine sends the app name fromREDROB_APP(set by the app on the engine process) next to theX-Session-Idit already sent, so the Console can group AI work by app. A session on a non-Redrob provider never reaches the Console, so nothing is sent for it.https://console.redrob.ai/skills/is the first skill source on every engine, before anything inconfig.skills. The discovery code already existed; this is the URL.autoInject, now privacy). The plugin API is typed from the SDK, which has no readonly arrays; the host converts at that boundary with themutable()helper it already had./v1/chat/completionsis already served ondevelop; nothing to add.developcontains no desktop shell; the drafts live onalpha/desktopandfeature/desktop-shelland stay unmerged.Not in this PR
Image and speech tools and the
/redrob/speech,/redrob/transcriberoutes (next PR). The on-device labellers (route-labeller,work-labeller): the gateway already classifies task type and language on the request it is serving, and these labels are the only thing that was going to leave the machine, so a 435 MB on-device model bought nothing.Tested
bun turbo typecheck --concurrency=2: 18/18.packages/core:bun test test/privacy test/config test/plugin test/skill193 pass;test/session*211 pass. Newtest/privacy/mask.test.tscovers the regex tier, request masking, split-placeholder streaming, tool-input restore, strict JSON parsing and the default.packages/redrobhttpapi-public-openapi.test.ts21 pass with the new group.oxlint0 errors; prettier clean on changed files.