gitguard
- 2 Devlogs
- 1 Total hours
when i started,
agent_manual.py could see that gemini was requesting a tool call, but it couldn’t actually run the tool or send the result back to gemini.also, there was only one tool, so gemini never really had to choose between different tools.gemini’s opinion about risky files was coming back as a normal paragraph of text, so my code couldn’t really use it properly.the rule engine and gemini’s opinion were also living in separate scripts, so there was no way to combine both of their results.and there was no single command that could just give a clear pass or fail result.# Nownow the agent runs a full loop: it calls a tool, gets the real result, sends that result back to gemini, and keeps repeating this until gemini gives a plain answer.i also added a second tool for checking the current branch, so now gemini actually has to pick the right tool depending on what the question is.gemini now responds with structured JSON instead of normal prose, so the flagged files can actually be read by the code as a real list.the rule-based flags and gemini’s flags are now merged together. gemini can only add files to the flagged list, it can never remove a file that the rule engine already flagged.and finally, gitguard.py is now a single command that gives a clear BLOCKED or CLEAR result and also sets a exit code.
so i started gitGuard project and im so excited to build itso i build a function named as get_staged_files(), which uses git status --porcelain to get staged filenames without reading file contents. This is the main privacy feature. then i connected gemini to my codebase using its api, its basically being used to send request to , and dw it wont look at you env secrets it will only get file names , is_sensitive_path() checks individual paths, while scan_staged_files() scans everything staged and returns flagged and safe results without using AI.
i will build 2 layers, one is determinisitic layers like it will look at hardcoded rule (its like if this then do this) , and then declare this might be a secret while then this will go to gemini and he will classify it further!