Use OpenAI or Gemini to scan your code for security and health issues from the CLI. Bring your own tokens. Options to scan full code, code changes, or in pipeline. Now with AI agents for deeper analysis and automated fixes.
About Latio
Find Security Tools
pip install latio
export OPENAI_API_KEY=xxx
latio partial-agentic ./
partial-agentic
should be used on a new branch
full-agentic
can be used on an existing code base
- Get your OpenAI key from here, and/or your Google API key here
export OPENAI_API_KEY=<OpenAPI Key>
and/orexport GEMINI_API_KEY=<Gemini API Key>
- Scan only your changed files before merging with
latio partial /path/to/directory
. This uses the gpt-4o model by default. For Google, usepython latio partial /path/to/directory --model=gemini-pro
- Scan your full application with
latio full /path/to/directory
. This uses gpt-4o by default. Due to the context window, you may need to pass specific folders. For google, uselatio full /path/to/directory --model=gemini-pro
- Use the agentic analysis with
latio partial-agentic
orlatio full-agentic
for deeper code understanding and automated fixes - You can specify
--model
with the model name from open ai to experiment
- Haven't tested gemini for 2.5
- github workflows currently don't work, but should be switched over to the agentic model
Functionality currently busted
This will run OpenAI in pipeline against only your changed files. Here's an example of what it looks like, it uses GPT-3.5 to scan only changed files, so it's relatively cheap.
- Get your OpenAI token from here
- In your repository, go to
github.com/org/repo/settings/secrets/actions
and add a new Repository Secret calledOPENAI_API_KEY
with the value from OpenAI - Copy and paste the
.github/workflows/actions-template-security.yml
(or-health
for health scan) into your own.github/workflows/
folder.
Scans only the files that have been changed in the specified directory.
<directory>
: Path to the directory where your project is located.--model <model_name>
: (Optional) Specifies the name of the OpenAI model to use for the scan. Defaults togpt-4o
--health
: (Optional) Runs a prompt focused on code optimization
Example:
latio partial /path/to/your/project --model gpt-4o --health
Scans only the files that have been changed in the specified directory using AI agents for deeper analysis.
<directory>
: Path to the directory where your project is located.--model <model_name>
: (Optional) Specifies the name of the OpenAI model to use for the scan. Defaults togpt-4o
--health
: (Optional) Runs a prompt focused on code optimization
Example:
latio partial-agentic /path/to/your/project --model gpt-4o --health
Scans your entire codebase for security and health issues.
<directory>
: Path to the directory where your project is located.--model <model_name>
: (Optional) Specifies the name of the OpenAI model to use for the scan. Defaults togpt-4o
--health
: (Optional) Runs a prompt focused on code optimization
Example:
latio full /path/to/your/project --model gpt-4o --health
Scans your entire codebase using AI agents for deeper analysis and automated fixes.
<directory>
: Path to the directory where your project is located.--model <model_name>
: (Optional) Specifies the name of the OpenAI model to use for the scan. Defaults togpt-4o
--health
: (Optional) Runs a prompt focused on code optimization
Example:
latio full-agentic /path/to/your/project --model gpt-4o --health