Skip to main content

HackAgent - AI Agent Security Testing Toolkit

AI Security Red-Team Toolkit


App -- Docs -- API

Security Policy



Python Version License uv Commitizen Ruff Test Coverage CI Status

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.

HackAgent CLI Demo

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 WEB provider drives a real browser through Playwright, whose browser binaries cannot be embedded in the archive (or in the PyPI package). Before using hackagent web-based targets, install them once with playwright 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

Google ADK OpenAI SDK LiteLLM LangChain

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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hackagent 0.13.0
File Size Uploaded
hackagent-0.13.0.tar.gz 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for hackagent 0.13.0
File Interpreter ABI Platform
hackagent-0.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.3 MB

Release files / hackagent-0.13.0.tar.gz

Download URL hackagent-0.13.0.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
01b585397b0aa985952e307a3a7a2c37d7214e0811f438428bfbcda10f16e9e1
BLAKE2b-256 checksum
How to use checksums
b2ac7ff8300f4c531c4b789d725769fe16c8f1806e21a0899ad4aeee887be178
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.0-py3-none-any.whl

Download URL hackagent-0.13.0-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4469ca056f3991b97eada0ce90d1c3a0b43fd68a65b1dbfc23d283d810506480
BLAKE2b-256 checksum
How to use checksums
2ea1c572b4a878bbafc4402aa40ea4ac0bf5ce21a25568a51f7b3b3a46588cef
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 history Release notifications | RSS feed

0.14.0

2 release files

0.13.1

2 release files

This release

0.13.0 This release

2 release files

0.12.0

2 release files

0.10.1

2 release files

0.10.0

2 release files

0.9.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page