We want a multitude of things from our AI systems. We want them to be quick, accurate, and cost efficient, just to start with. Traditionally, keeping our systems current could mean something as manual as retraining a model or updating a knowledge base. This is starting to be more and more an issue of the past. I recently tried Google Gemini CLI and the aspect that impressed me the most was the ability to quickly readjust and learn.
Installing Gemini CLI is very quick, and you most likely will be done in a few minutes. The Gemini CLI repository is here: GitHub — google-gemini/gemini-cli: An open-source AI agent that brings the power of Gemini directly into your terminal.
I asked Gemini to write a program that could ingest architectural diagrams and produce threat modeling and risk information. Gemini was quick to produce a Python program for me to run with the correct logic. My first attempt at running the program stopped with an error about a deprecated model: “An error occurred during architecture parsing: 404 Gemini 1.0 Pro Vision has been deprecated…”
Well okay, I can’t claim perfection either. I copy and pasted the error into the Gemini prompt and received an immediate suggested fix for the deprecated version. I agreed to the fixed code and it was updated.
The program successfully ran this time, but the output file,’Threat_Model_Report.md’, was missing threat and risk information. Gemini added some print statements to the code to troubleshoot this issue and asked me to provide the returned text.
This helped pinpoint the issue and Gemini supplied a fix.
Now, my program was working well. Gemini suggested enhancements with smarter risk assessment and enhanced reporting.
I ran the updated program and received a fairly detailed report.
I closed out my session and Gemini gave me statistics on my token usage and run time. At this point in time Gemini CLI free tier has a context token window of 1,000,000 with an output token limit of 8192.
So, I spent about ten minutes building this, including the corrections proposed by Gemini CLI. All of this, at no cost to me. Pretty amazing, but what really impressed me was the adaptation and self-correction. If anyone wants to look at the code Gemini produced, here is a link — https://github.com/mgbec/threat-modeling-agents.git. We could, of course, go much further with this program and add more features or refine outputs.
Thanks for reading and I highly recommend trying it yourself!
Top comments (0)