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.
- 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
HackAgent can be installed directly from PyPI:
# Install with pip
pip install hackagent
# Or with Poetry
poetry add hackagent
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)
HackAgent automatically sends test results to the dashboard for analysis
and visualization. All reports can be accessed through your dashboard account.
- Comprehensive visualization of attack results
- Historical data comparison
- Vulnerability severity ratings
Access your dashboard at https://hackagent.dev
- Python 3.10+
- Poetry
# 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/
Please read CONTRIBUTING.md for details on our code of conduct and the submission process.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
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.
- Project Maintainer: VistLabs Organization
- Project Repository: https://github.com/vistalabs-org/hackagent
- Issue Tracker: https://github.com/vistalabs-org/hackagent/issues
This project is for educational and research purposes. Always use responsibly and ethically.