HackAgent CLI
HackAgent tests your AI model or agent for jailbreaks, prompt injection and tool misuse and reports a measured attack success rate
- 538 ★ on the repository
- Last commit
- Apache-2.0
Broad access
Why this level
- Automatically sends attack and jailbreak prompts to the chosen model, and provider rules can get an account banned
- Spends tokens and money on attacker and judge model calls, and sends campaign results to a server when the cloud dashboard is linked
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/hackagentDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- Automatically sends attack and jailbreak prompts to the chosen model, and provider rules can get an account banned
- Spends tokens and money on attacker and judge model calls, and sends campaign results to a server when the cloud dashboard is linked
This is third-party code. Review the repository files before installing.
What it does
HackAgent is an open source Python red-team toolkit for AI models and agents. It attacks a target with research-backed techniques: jailbreaks, prompt injection and tool misuse. Judge models score every reply, and the outcome is a measured success rate per attack, which shows how exposed a target is and whether a fix helped. The attack catalog includes adaptive methods such as PAIR, TAP, AutoDAN-Turbo, Best-of-N and h4rm3l, plus indirect variants. A campaign is one YAML file you can edit, check and run in a shell or in CI. There is a terminal UI, a command line and a results dashboard: hackagent web opens a local dashboard, and the same one runs on app.hackagent.dev. The example runs entirely locally through Ollama with no API keys, and results go to a local database.
Who it is for. Teams shipping AI agents who want to measure a model's and its tools' resistance to known attacks before release, and AI security researchers.
Good fit when
- Before releasing an agent you want the share of successful jailbreaks and prompt injections against your configuration
- After a system prompt change you want to see whether the target got more robust, using the same campaign
- The check runs in CI from a single YAML file and returns a numeric result
- You need a local check without cloud keys: the example works through Ollama
Not a fit when
- You do not own the target and have no written permission: the tool is for authorized testing only
- You need a scanner for ordinary code or networks: HackAgent tests models and agents
- You need a safety guarantee: a measured attack rate covers the tested techniques, not every possible one
Example request
Install HackAgent, copy the h4rm3l-demo example and run the campaign locally through Ollama against my test modelLimitations
- Needs Python 3.10 or newer, and the package is installed with the tui extra for the terminal UI. Standalone binaries without Python exist.
- Judge and attacker models are required: local through Ollama or cloud provider keys, with costs on your side.
- A campaign verdict stays unresolved until evaluations finish: the pooled verdict appears at the end unless the target is already jailbroken.
- The package is marked Beta in pyproject, version 0.18.
How to disable. Remove the package with pip uninstall hackagent or delete the standalone binary. The local results database stays in the data directory and is deleted by hand. If you linked an app.hackagent.dev account, revoke the key there.
FAQ
What does HackAgent do?
It attacks your model or agent with research-backed techniques (jailbreaks, prompt injection, tool misuse), scores replies with judge models and gives a measured attack success rate. You see how exposed the target is and whether a fix helped.
How do I install HackAgent and run the example?
Run pip install 'hackagent[tui]', then hackagent for the terminal UI. Local example: ollama pull gemma3:4b, hackagent examples copy h4rm3l-demo, hackagent campaign run h4rm3l-demo.yaml. No API keys are needed.
Can I run HackAgent against someone else's systems?
No. In the responsible use section the authors ask you to report findings through responsible disclosure and to keep tests to your own systems.
Where do I see campaign results?
hackagent web opens a local dashboard with runs, results and traces. The same dashboard exists in the cloud at app.hackagent.dev. Without explicit setup results stay in the local database.
Is HackAgent suitable for CI?
Yes. A campaign is one YAML file you can check and run with hackagent campaign run in a shell or in CI. The result holds an attack success rate to compare before and after changes.
Discussion
No questions or reviews yet.
Related
CLI toolsAgentic Radar analyzes multi-agent code on LangGraph, CrewAI, n8n, OpenAI Agents and AutoGen and builds an HTML report on tools and vulnerabilities
An authorized bug-bounty suite: 50 subagents, 26 commands and 2 bug-bounty-platform MCP servers for Claude Code, Codex and five more agents
Humanbound attacks your AI agent in multi-turn chats, scores replies against policy and turns failures into firewall rules
A static scanner for vulnerabilities in AI agent code and MCP configs with 66 rules mapped to OWASP Agentic Top 10
Burp Suite extension with AI: analyzes requests, runs scanners and opens Burp over MCP to Claude Desktop, Claude Code, Codex and Gemini CLI
AgentGuard checks a coding agent's actions before they run and scans third-party skills for secrets, backdoors and injections.
README in short
The README explains the purpose, shows the terminal UI, command line and dashboard, gives a quick start with an Ollama example and links to the docs. A responsible use section closes it.