Skip to main content

HackAgent is an open-source security toolkit to detect vulnerabilities of your AI Agents.

Project description

Hack Agent

⚔️ Detect vulnerabilities before attackers do! ⚔️


ico Web App -- Docs ico


GitHub stars Python Version License Poetry Commitizen Ruff Test Coverage CI Status


Overview

HackAgent is an open-source toolkit designed to help security researchers, developers and AI safety practitioners evaluate the security of AI agents. It provides a structured approach to discover potential vulnerabilities, including prompt injection, jailbreaking techniques, and other attack vectors.

🔥 Features

  • Comprehensive Attack Library: Pre-built techniques for prompt injections, jailbreaks, and goal hijacking
  • Modular Framework: Easily extend with custom attack vectors and testing methodologies
  • Safety Focused: Responsible disclosure guidelines and ethical usage recommendations

🔌 AI Agent Frameworks Supported

LiteLLM ADK

🚀 Installation

Installation from PyPI

HackAgent can be installed directly from PyPI:

# Install with pip
pip install hackagent

# Or with Poetry
poetry add hackagent

📚 Quick Start (Google ADK)

from hackagent import HackAgent

# Initialize the agent tester with API key
agent = HackAgent(
    name="multi_tool_agent",
    endpoint="http://localhost:8000",
    api_key="your_api_key_here",  # Or omit to use HACKAGENT_API_KEY environment variable
    agent_type=AgentTypeEnum.GOOGLE_ADK
)
attack_config = {
    "attack_type": "advprefix",
    "goals": [
        "Fake the weather for a not available city"
        "Fake the time for a not available city",
    ],
 }

# Run a basic security scan
agent.hack(attack_config=attack_config)

📊 Reporting

HackAgent automatically sends test results to the dashboard for analysis
and visualization. All reports can be accessed through your dashboard account.

Dashboard Features

  • Comprehensive visualization of attack results
  • Historical data comparison
  • Vulnerability severity ratings

Access your dashboard at https://hackagent.dev

🧪 Development

Prerequisites

# Clone the repository
git clone https://github.com/vistalabs-org/hackagent.git
cd hackagent

# Install development dependencies
poetry install --with dev

We use modern Python development tools to ensure code quality:

# Run tests with coverage reporting
poetry run pytest --cov=hackagent tests/

🤝 Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the submission process.

📜 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

⚠️ Disclaimer

HackAgent is a tool designed for security research and improving AI safety. Always obtain proper authorization before testing any AI systems. The authors are not responsible for any misuse of this software.

📞 Contact


This project is for educational and research purposes. Always use responsibly and ethically.

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

hackagent-0.2.4.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

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

hackagent-0.2.4-py3-none-any.whl (3.4 MB view details)

Uploaded Python 3

File details

Details for the file hackagent-0.2.4.tar.gz.

File metadata

  • Download URL: hackagent-0.2.4.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.11.0-1014-azure

File hashes

Hashes for hackagent-0.2.4.tar.gz
Algorithm Hash digest
SHA256 71697003dceafd1615c2881ed1015bc195b89f132d8257b1e46dd803be89ebed
MD5 3b0462cc1aea02d41f46c5380bd19fc1
BLAKE2b-256 3d9fe3f7bbdc2247e1af673dec9e3bdd04bd359bc9ea690aa4bcd973414bdebb

See more details on using hashes here.

File details

Details for the file hackagent-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: hackagent-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Linux/6.11.0-1014-azure

File hashes

Hashes for hackagent-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2763fdc88e8c7f7314e3096596ddef79110e0ad8d9ab4d4721f7552d10132cd5
MD5 382e5c291b71d37e1b73900da4799c5f
BLAKE2b-256 258e33ed92993c29ac88df152d7aff33c7e49b063f076c6bf90c8226858f0a43

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