Metadata-Version: 2.5
Name: hackagent
Version: 0.18.0
Summary: HackAgent is an open-source security toolkit to detect vulnerabilities of your AI Agents.
Author-email: AI Security Lab <ais@ai4i.it>
License: Apache-2.0
License-File: LICENSE
Keywords: agents,ai,security,testing,vulnerabilities
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: litellm>=1.69.2
Requires-Dist: openai>=1.0.0
Requires-Dist: packaging>=23.0
Requires-Dist: pydantic[email]>=2.0
Requires-Dist: python-dateutil>=2.8.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: rich>=14.0.0
Provides-Extra: browser
Requires-Dist: playwright>=1.40; extra == 'browser'
Provides-Extra: hf
Requires-Dist: datasets>=2.14.0; extra == 'hf'
Provides-Extra: rag
Requires-Dist: faiss-cpu>=1.13.2; extra == 'rag'
Requires-Dist: numpy>=1.26; extra == 'rag'
Provides-Extra: tui
Requires-Dist: textual>=1.0.0; extra == 'tui'
Provides-Extra: vision
Requires-Dist: pillow>=10.0.0; extra == 'vision'
Provides-Extra: web
Requires-Dist: flask>=3.1.3; extra == 'web'
Requires-Dist: hackagent-webui<1.0,>=0.2; extra == 'web'
Description-Content-Type: text/markdown

<div align="center">

<img src="https://docs.hackagent.dev/img/banner.svg" alt="HackAgent" width="800">

**The open-source red-team toolkit for AI models and agents**

[Docs](https://docs.hackagent.dev/) · [App](https://app.hackagent.dev/) · [API](https://api.hackagent.dev/schema/redoc)

[![PyPI](https://img.shields.io/pypi/v/hackagent)](https://pypi.org/project/hackagent/)
![Python](https://img.shields.io/badge/python-3.10%2B-blue)
![License](https://img.shields.io/badge/license-Apache%202.0-green)
![CI](https://img.shields.io/github/actions/workflow/status/AISecurityLab/hackagent/ci.yml)
![Coverage](https://img.shields.io/codecov/c/github/AISecurityLab/hackagent)

</div>

HackAgent attacks your AI model or agent with research-backed techniques —
jailbreaks, prompt injection, tool misuse — and has judge models score every
reply. You get a measured success rate per attack, so you can see how exposed a
target is and whether a fix helped.

## See it run

**Terminal UI.** Start from an example, change what you need, run it.

<img src="https://raw.githubusercontent.com/AISecurityLab/hackagent/main/docs/static/gifs/hackagent-tui.gif" alt="Building and running a campaign in the HackAgent terminal UI" width="100%">

**Command line.** The same campaign is one YAML file you can edit, check and run, in a shell or in CI.

<img src="https://raw.githubusercontent.com/AISecurityLab/hackagent/main/docs/static/gifs/hackagent-cli.gif" alt="Copying, editing, validating and running a campaign from the command line" width="100%">

**Dashboard.** Browse runs, results and traces with `hackagent web`, or on [app.hackagent.dev](https://app.hackagent.dev/).

In local campaign coverage, each attack's evaluated goal outcomes appear while
other goals are still running. Pending evaluations and errors remain unresolved.
The pooled campaign verdict stays unresolved until the campaign finishes unless
an attack has already jailbroken that goal.

Time to first jailbreak measures per-goal execution through the earliest
successful target response. It includes rewriting and intervening judging, but
excludes local concurrency-slot waits, final judging, and shared run preparation.
Server-side queueing remains included. Legacy queue-inclusive clocks are not
substituted when execution timing is unavailable.

<img src="https://raw.githubusercontent.com/AISecurityLab/hackagent/main/docs/static/gifs/hackagent-dashboard.gif" alt="Browsing campaign results in the HackAgent dashboard" width="100%">

## Quick start

```bash
pip install 'hackagent[tui]'
hackagent                # opens the terminal UI
```

Or run an example end to end, fully local, with [Ollama](https://ollama.com):

```bash
ollama pull gemma3:4b
hackagent examples copy h4rm3l-demo
hackagent campaign run h4rm3l-demo.yaml
```

No API key needed: results go to a local database unless a campaign says
otherwise.

## Learn more

- [Installation](https://docs.hackagent.dev/getting-started/installation) — extras, and standalone binaries that need no Python
- [Your first campaign](https://docs.hackagent.dev/getting-started/first-campaign) — write, check and run one
- [Concepts](https://docs.hackagent.dev/concepts) — attacks, judges and how a run works
- [Attacks](https://docs.hackagent.dev/attacks) and the [campaign file reference](https://docs.hackagent.dev/cli/campaign-files)
- [Dashboard](https://docs.hackagent.dev/getting-started/dashboard) — `hackagent web`, locally or against your account

Questions? Join the [discussions](https://github.com/AISecurityLab/hackagent/discussions) or email ais@ai4i.it.

## Responsible use

HackAgent is for authorized security testing only. Test systems you own or
have written permission to test, and report what you find through coordinated
disclosure. Read the [responsible disclosure guidelines](https://docs.hackagent.dev/security/responsible-disclosure)
and our [security policy](SECURITY.md).

## Contributing

Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) and
[CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).

## License

Licensed under Apache-2.0. See [LICENSE](LICENSE). HackAgent is intended for
security research and AI safety improvement; the authors are not responsible
for misuse.
