Skip to main content

A CLI tool for AI-powered code security scanning

Project description


Code Security Vulnerabilities Scanner

Release and Publish GitHub release (latest by date) GitHub issues GitHub pull requests GitHub

GuardAI

GuardAI leverages multiple AI models, including OpenAI, Gemini, and custom self-hosted AI servers, to scan code for security vulnerabilities. It is designed to integrate seamlessly into CI/CD pipelines, such as GitHub Actions, allowing developers to automatically analyze their code for potential security issues during the development process.

Full Demo: https://github.com/codeguardai/demo

Features

  • Multi-AI Model Support:

    • OpenAI Integration: Scan your code using OpenAI's powerful models like GPT-4 to identify potential security vulnerabilities.
    • Gemini Integration: Leverage Gemini's capabilities to analyze code for security risks.
    • Groq Integration: Uses Groq's Fast AI Inference
    • Custom AI Server Integration: Connect to a self-hosted or privately hosted AI server to perform security scans, allowing for fully customizable and self-hosted AI solutions.
  • CI/CD Integration:

    • Easily integrate the CLI tool into GitHub Actions, enabling automated code scanning for security vulnerabilities on every pull request.
    • Provides support for running scans on specific branches or changes in a repository.
  • Flexible Scanning Options:

    • Full Directory Scans: Analyze all files within a directory for comprehensive security analysis.
    • PR-Specific Scans: Focus on files changed in a specific pull request to streamline the scanning process and reduce overhead.

Getting Started

Prerequisites

  • Python 3.10 or higher
  • API keys for the supported AI models:
    • OpenAI API key
    • Gemini API key
    • Groq API key
    • Access to a custom AI server (host, port, and optional token)

Installation

Option 1: Install via pip

You can install the tool directly from the repository using pip:

pip install guardai

This will allow you to use the guardai command directly in your terminal.

Option 2: Clone the Repository

If you prefer to clone the repository and install the dependencies manually:

git clone https://github.com/codeguardai/guardai.git
cd guardai
pip install -r requirements.txt
pip install -r requirements-dev.txt

Usage

Scanning a Directory

To scan all files within a directory:

guardai --provider openai --directory path/to/your/code

Scanning with a Custom AI Server

To scan code using a custom AI server:

guardai --provider custom --host http://localhost --port 5000 --token your_token --directory path/to/your/code

Supported AI Providers

  • OpenAI: Leverages GPT models for detailed security analysis.
  • Gemini: Provides robust security analysis using Gemini's capabilities.
  • Custom: Integrates with a self-hosted or privately hosted AI server, allowing for fully customizable solutions.

Future Work

  • Caching Implementation: A caching mechanism to store results of previously scanned files, reducing the number of API calls and optimizing performance.

  • Expanded Git Provider Support: The tool is currently integrated with GitHub for PR-based scanning, future plans include extending support to other Git providers like GitLab, Bitbucket, and Azure Repos.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

guardai-0.2.0.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

guardai-0.2.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file guardai-0.2.0.tar.gz.

File metadata

  • Download URL: guardai-0.2.0.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for guardai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 98562e6207161312fa43c307cbe0dd6d30d0e7f41922a3f3f62e076676146b70
MD5 9926d46c38726e3bf5b7a3756de0d5dc
BLAKE2b-256 702c3643ff2a8139fabf026d0f4aec1c629f0afdd2f819c6838b48273f3437d6

See more details on using hashes here.

File details

Details for the file guardai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: guardai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for guardai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29e2127cc6480edb4ae9ec3620c00e4237a06ede9a71228110c49512b1b79731
MD5 c47f6be53f250092c1f21cbf7395cb8e
BLAKE2b-256 20815edc407b81aac2a3081348281d4c7df4f36eac93919e8a8cc9816c9f0617

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page