[Security Patch] Fix RCE vulnerability, secure API key storage, and resolve UI threading bugs#3
Open
Guettaf-hossam wants to merge 3 commits into
Open
[Security Patch] Fix RCE vulnerability, secure API key storage, and resolve UI threading bugs#3Guettaf-hossam wants to merge 3 commits into
Guettaf-hossam wants to merge 3 commits into
Conversation
…HITL Sandbox for dangerous actions
Resolve conflicts |
ilhomovazizbek36-jpg
approved these changes
Apr 9, 2026
ilhomovazizbek36-jpg
approved these changes
Apr 9, 2026
ilhomovazizbek36-jpg
approved these changes
Apr 13, 2026
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.
Overview
This Pull Request addresses the critical security and structural vulnerabilities reported in #2. It hardens the system against potential prompt injection attacks, secures user secrets, and stabilizes the Tkinter UI.
Key Changes
1. Secrets Management (.env Migration)
config/api_keys.jsonplaintext storage with a secure.envimplementation usingpython-dotenv..gitignoreto ensure.envand__pycache__are never committed._get_api_key()inmain.pyto useos.getenv()and removed the redundant file-read bug.2. Human-in-the-Loop (HITL) Sandbox for Dangerous Tools
_confirm()helper usingtkinter.messagebox.askyesno(with a terminalinput()fallback).cmd_control,code_helper(run/build/edit), andfile_controller(delete/move/write) will now pause and explicitly ask for user permission before executing."Action blocked by user."to the LLM, neutralizing any prompt injection RCE attempts.3. Tkinter Thread-Safety Fix
ui.pywas being modified directly from backgroundasyncio/threadingloops (e.g.,write_logandspeakingstates), which causes Tkinter to freeze or crash.queue.Queue(). Background threads now only enqueue state changes, and a new_poll_queue()method running on the main thread (viaroot.after()) safely updates the UI.Note for the Maintainer:
Upon merging this, users will be prompted to re-enter their Gemini API key on their first launch to generate the new
.envfile. Read-only actions (like listing files or reading code) remain autonomous and un-gated for a smooth experience.Please let me know if you need any adjustments to these changes!