What is HackAgent?
HackAgent is a comprehensive Python SDK and CLI designed to help security researchers, developers, and AI safety practitioners evaluate and strengthen the security of AI agents.
As AI agents become more powerful and autonomous, they face security challenges that traditional testing tools cannot address:
| Threat | Description |
|---|---|
| Prompt Injection | Malicious inputs that hijack agent behavior |
| Jailbreaking | Bypassing safety guardrails and content filters |
| Goal Hijacking | Manipulating agents to pursue unintended objectives |
| Tool Misuse | Exploiting agent capabilities for unauthorized actions |
HackAgent automates testing for these vulnerabilities using research-backed attack techniques, helping you identify and fix security issues before they are exploited.
Interactive TUI with real-time attack progress and visual reporting.
Get Started Now
Quick Install
python3 -m venv .venv
source .venv/bin/activate
pip install hackagent
No API key required: HackAgent works locally out of the box.
Standalone binary (no Python required)
Every GitHub Release ships a self-contained archive per platform:
| Platform | Asset |
|---|---|
| Linux x86_64 | hackagent-<version>-linux-x86_64.tar.gz |
| macOS arm64 | hackagent-<version>-macos-arm64.tar.gz |
| macOS x86_64 | hackagent-<version>-macos-x86_64.tar.gz |
| Windows x86_64 | hackagent-<version>-windows-x86_64.zip |
Extract the archive and run the hackagent launcher inside it — no Python, pip
or uv install needed. Keep the extracted folder intact; the launcher loads the
libraries next to it.
Note: the
WEBprovider drives a real browser through Playwright, whose browser binaries cannot be embedded in the archive (or in the PyPI package). Before usinghackagent web-based targets, install them once withplaywright install.
Questions? Join community discussions or email ais@ai4i.it.
Architecture
HackAgent uses a modular pipeline to test agent robustness end-to-end.
| Component | Description |
|---|---|
| Attack Engine | Orchestrates attacks using AdvPrefix, AutoDAN-Turbo, PAIR, TAP, FlipAttack, BoN, h4rm3l, CipherChat, PAP, and Static Template |
| Generator | LLM role that creates adversarial prompts to test the target agent |
| Judge | LLM role that evaluates whether attacks bypass safety measures |
| Target Agent | Your AI agent under test across supported frameworks |
| Datasets | Pre-built benchmark presets plus custom HuggingFace/file/URL JSON datasets |
Supported Frameworks
Reporting
HackAgent supports both local and remote reporting.
- Local mode stores test results in SQLite, readable offline.
- Cloud mode syncs runs to the HackAgent remote platform when an API key is configured.
hackagent web serves the HackAgent dashboard — the same app as
app.hackagent.dev — from your own machine, against
your cloud data when an API key is configured and against the local SQLite
database (read-only) when it is not. Your API key stays in the CLI process and
is never exposed to the browser.
hackagent web
Install it with pip install 'hackagent[web]'; see the web command docs for modes and options.
Responsible Use
HackAgent is designed for authorized security testing only. Always obtain explicit permission before testing any AI system.
Do
- Test your own agents
- Conduct authorized pentesting
- Follow coordinated disclosure
- Share security knowledge responsibly
Don't
- Test systems without permission
- Exploit vulnerabilities maliciously
- Violate terms of service
- Share harmful exploit instructions irresponsibly
Read the full guidelines: Responsible Disclosure
Contributing
Contributions are welcome. See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
License
Licensed under Apache-2.0. See LICENSE.
Disclaimer
HackAgent is intended for security research and AI safety improvement. The authors are not responsible for misuse.
Release files for hackagent 0.13.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hackagent-0.13.1.tar.gz | 1.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hackagent-0.13.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.3 MB
Release files / hackagent-0.13.1.tar.gz
| Download URL | hackagent-0.13.1.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf2acff5ebb6aec459c3a3649e27a4dd278413dbcfb27024eda9aba56309e2e4
|
|
BLAKE2b-256 checksum How to use checksums |
3fe5818e0b3803c7ef4bd43be51e20c36809ceb42de4ce83156e23604fba49c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / hackagent-0.13.1-py3-none-any.whl
| Download URL | hackagent-0.13.1-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d486fb357a6d7ab4c57bf5a476275ee0b5294a98df325b1f8aa2a4dbfe12827d
|
|
BLAKE2b-256 checksum How to use checksums |
aff8323eaa1678d5926cda124f3a94745a8551a52951db731df2f54c76df08da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|