Redact and mask private data before text model calls - #2003
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 470cde132b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| gmai.Register("openai", func(opts ...gmai.Option) gmai.Model { return privacy.New(openai.NewProvider, opts...) }) | ||
| gmai.Register("anthropic", func(opts ...gmai.Option) gmai.Model { return privacy.New(anthropic.NewProvider, opts...) }) | ||
| gmai.Register("atlascloud", func(opts ...gmai.Option) gmai.Model { return privacy.New(atlascloud.NewProvider, opts...) }) |
There was a problem hiding this comment.
Protect providers instantiated by the local CLI agent
These registrations protect only models created through gmai.New, but the mu agent path in agent/local/local.go:172-213 directly calls anthropic.NewProvider, atlascloud.NewProvider, and openai.NewProvider. Consequently, when that CLI agent calls remote personal tools such as Gmail or Drive, its prompts, history, and tool results still go to the configured provider verbatim, bypassing the new redaction and placeholder restoration boundary. Route those direct constructions through privacy.New (or the protected registry) as well.
Useful? React with 👍 / 👎.
Text model providers currently receive account context, mail and calendar tool results verbatim. Add a local privacy boundary around the supported text model adapters, including their internal tool loops.
Validation: full
go test -buildvcs=false ./... -short; focused race tests for privacy, ai, codex, agent, mail and events;go build -buildvcs=false ./...; diff checks. Fake HTTP endpoints verify actual initial and follow-up payloads for all five HTTP adapters, plus local tool-argument and answer restoration. Tests cover run isolation, concurrency, structured secrets, exact large JSON IDs, private Google links, revoked mappings and every streaming split position.Limits: this is deterministic pseudonymization, not encryption or anonymity. Unrecognized names and identifying prose can remain. Standard plaintext quote/signature trimming does not recognize every mail format. Availability preference is a model instruction, not a ban on event-detail access. Image/media generation is outside this text-model boundary. No live Google account, provider call, authenticated browser or screenshot verification was performed; there are no UI changes.