fix: AI privacy — connection policy, Gemini key, file protection#619
Merged
fix: AI privacy — connection policy, Gemini key, file protection#619
Conversation
…key to header, add file protection
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
Fixes 3 privacy/security issues found during AI system audit:
H2 — Inline suggestions ignore connection AI policy:
InlineSuggestionManagernever checkedAIConnectionPolicy. A connection set to "Never" still sent SQL to the AI provider for inline completions. Fix: addedconnectionPolicyproperty, passed through the view chain (MainEditorContentView→QueryEditorView→SQLEditorView→SQLEditorCoordinator→InlineSuggestionManager), and checked inisEnabled().H6 — Gemini API key exposed in URL query string: All 3 Gemini endpoints (
streamGenerateContent,fetchAvailableModels,testConnection) embedded the API key as?key=in the URL, making it visible in proxy logs, network captures, and OS-level logging. Fix: moved tox-goog-api-keyHTTP header (supported by Gemini API), matching how Anthropic usesx-api-keyand OpenAI usesAuthorization: Bearer.H8 — Chat history stored as unencrypted plain-text JSON: AI conversations in
~/Library/Application Support/TablePro/ai_chats/had no file protection beyond atomic writes. Fix: added.completeFileProtectionUntilFirstUserAuthenticationto both file writes and the directory itself, providing FileVault-level encryption at rest.Test plan