Skip to main content

Humanbound

Find vulnerabilities in your AI agents before attackers do.

Humanbound attacks your agent the way real attackers will, scores every conversation,
and turns each failure into a firewall rule. Open source, runs locally, no login needed.

Docs Humanbound Platform: start free Discord Enterprise: contact us

PyPI version CI License GitHub stars


Overview

AI agents hold conversations, call tools and keep state, so many security failures appear only as a conversation unfolds, never in a single prompt.

Humanbound tests the agent, not just the prompt: it holds multi-turn conversations with your real endpoint, tries to make the agent misuse its tools or step outside its role, and an AI judge scores every reply against your security policy.

Key capabilities:

  • Realistic attacks — multi-turn conversations that try prompt injection, jailbreaks, tool abuse and data leaks, the way a real attacker would
  • Standards-mapped — every finding maps to the OWASP LLM and Agentic AI Top 10
  • Behavior checks — does the agent stay on task and answer correctly
  • A security score — 0–100 with an A–F grade, plus every conversation that failed
  • Findings into defenses — failures become rules for humanbound-firewall
  • Fits your workflow — CLI, Python SDK, GitHub Action and an MCP server for coding agents

Output of hb posture, a score of 18.0 out of 100 and grade F, and hb logs --verdict fail, a table of failed conversations with their severity, category such as system_exposure and restriction_bypass, and the judge's explanation.
Security score and failed conversations after attacking the hello-world practice agent, with each conversation's severity (0–100) and the judge's reason.

Use cases

  • Before launch — red-team a new agent before real users reach it
  • On every pull request — fail the build when a prompt, tool or model change opens a hole
  • In production — monitor the agent continuously and catch regressions (Platform)
  • At runtime — block the attacks it failed with firewall rules generated from the findings

How it works

How Humanbound works: the scope defines what the agent may do; attacks are generated from it and run as multi-turn conversations against the real agent; an AI judge scores each reply; failures become findings, which produce a security posture score and firewall rules; then the agent is tested again.


Quick start

Prerequisites: Python 3.10+, and an LLM API key (OpenAI, Anthropic, Gemini) or a local Ollama. The practice agents below also need Docker and an OpenAI key, or an OpenAI-compatible server such as Ollama.

pip install 'humanbound[engine]'
export HB_PROVIDER=openai HB_API_KEY=sk-...   # the model that attacks and judges

Attack a practice agent

No agent of your own yet? hello-world is a deliberately vulnerable shop chatbot that runs in Docker. Start it, attack it and see how it broke:

hb arena config set OPENAI_API_KEY=sk-...             # the practice agent's model
hb arena run hello-world
hb test --target arena://hello-world --quick --wait   # about 20 minutes
hb posture                                            # security score, 0–100 and A–F
hb logs --verdict fail                                # the conversations where it broke
hb arena stop hello-world

Building with tools? Try pricewatch (tool use, indirect injection). hb arena ls lists every practice agent (Arena docs).

Attack your own agent

Humanbound calls your agent's API over REST, WebSocket or SSE. Tell it how in bot-config.json; $PROMPT is replaced with each attack message:

{
  "chat_completion": {
    "endpoint": "https://your-bot.com/chat",
    "headers": {"Authorization": "Bearer <token>"},
    "payload": {"message": "$PROMPT"}
  }
}

The agent should reply with JSON that has the answer in a field such as content, text, reply or message; nested fields are fine.

hb test --endpoint ./bot-config.json --wait   # about 20 minutes with a cloud model
hb report -o report.html                      # shareable HTML report

No API key, or your model refuses to write attacks? Test your agent on the Platform with hosted attack models.

Next steps

Want to… Do this
Test an agent that needs a session or login See Agent Configuration
Get sharper attacks Add --prompt ./system.txt or --repo ., or write a scope.yaml
Keep everything on your machine export HB_PROVIDER=ollama HB_TELEMETRY_DISABLED=1 (details)
Run in a container Use the Docker image

Humanbound Platform

Log in and the same CLI sends its runs to the Humanbound Platform. Your findings and score are kept across runs, and the Platform can keep testing your agent on a schedule (hb monitor). The Community plan needs no card.

hb login
hb connect --endpoint ./bot-config.json    # creates a project and runs a first test
hb posture --trends                        # score over time
hb findings                                # open, fixed and regressed findings

Everything in open source, plus:

  • Findings tracked across runs, and score history
  • Continuous monitoring
  • Cross-session leaks: does one user's data reach another
  • Hosted attack models, no API key needed
  • Team collaboration

Hosted attack models

Many models refuse to write attacks because of their safety rules, which makes them poor attackers. Hosted attack models don't have that problem: if an attack doesn't work with one model, it's retried with another, and a separate model grades the results, so the model that wrote an attack never judges it.

Sign up, run hb login and hb connect, and hb test runs on the Platform with hosted attack models, unless you add your own provider with hb providers create. Practice agents and hb test --local always use your own model.

Start free on app.humanbound.ai →

Enterprise

On-premises installation, SAML/OIDC single sign-on, SIEM integration, bring-your-own-key models and a named engineer with an SLA. Contact sales →


Turn findings into guardrails

Test → find → defend → test again.

  1. Export the findings as a firewall policy:

    hb guardrails -f yaml -o agent.yaml
    
  2. Load agent.yaml into humanbound-firewall (pip install humanbound-firewall). It blocks the attacks your agent just failed.

  3. Run hb test again to confirm.

Optional: train a dedicated classifier from your test logs with 'humanbound[firewall]' (Firewall docs).

Run it in CI

humanbound/actions tests your agent on every pull request and fails the build on findings at or above a severity:

# .github/workflows/agent-security.yml
name: Agent security
on: [pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: docker compose up -d agent # start your agent, reachable on localhost

      - uses: humanbound/actions@v1
        with:
          endpoint: ./bot-config.json   # same format as in the Quick start, pointing at localhost
          provider-api-key: ${{ secrets.OPENAI_API_KEY }}
          model: gpt-4.1
          fail-on: high

With a Humanbound account, pass api-key, org-id and project-id instead of provider-api-key and model, and the run uses hosted attack models (or your own provider, if you added one).

Findings can also appear in GitHub's Security tab (SARIF). GitLab and other systems: CI/CD docs.

Use it from your coding agent

Ask about your results (MCP server). Claude Code, Cursor, Windsurf or Copilot can answer questions about your score, findings and runs on the Platform. It needs a Humanbound account:

pip install 'humanbound[mcp]'
hb login
claude mcp add humanbound -- hb mcp

Setup for other editors is in the MCP docs.

Let the agent run the test (plugin, preview). The humanbound-test plugin lets Claude Code or Cursor find your local FastAPI agent and test it for you. It needs a Humanbound account.

Use it from Python

The CLI and the SDK share one implementation:

import json
import time

from humanbound import LocalRunner, TestConfig

config = TestConfig(
    endpoint=json.load(open("bot-config.json")),
    test_category="humanbound/adversarial/owasp_agentic",
    testing_level="unit",
    lang="english",
)

runner = LocalRunner()
experiment_id = runner.start(config)
while runner.get_status(experiment_id).status not in ("Finished", "Failed", "Terminated"):
    time.sleep(5)

posture = runner.get_posture(experiment_id)
print(f"Security posture: {posture.overall_score} ({posture.grade})")

More in the docs, including how the engine works.


Documentation

Everything else is at docs.humanbound.ai: configuration, attack methodology, CI/CD, the Platform and the full command reference.

Contributing

Code, docs and bug reports are welcome. See CONTRIBUTING.md for the dev setup and the DCO sign-off.

If Humanbound finds something in your agent, a ⭐ helps other builders find it too.

Telemetry

The hb CLI sends anonymous usage data to help improve the project. To turn it off:

hb telemetry disable           # or: export HB_TELEMETRY_DISABLED=1, or: export DO_NOT_TRACK=1

Turning it off sends one final anonymous telemetry_disabled event per machine, so we can count opt-outs. Details in PRIVACY.md.

Authorized use only

License

Humanbound is licensed under the Apache License 2.0. See TRADEMARK.md for the trademark policy.

Metadata

Release files for humanbound 2.15.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 humanbound 2.15.0
File Size Uploaded Provenance Actions
humanbound-2.15.0.tar.gz 378.0 kB With provenance Details for humanbound-2.15.0.tar.gz

Built distribution (wheel)

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

Total release size: 820.0 kB

Release files / humanbound-2.15.0.tar.gz

Download URL humanbound-2.15.0.tar.gz
Size 378.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e5a1db20fe318602adcea6dbd55edf4794d689d6c45d8e9b5acdb2e094a28722
BLAKE2b-256 checksum
How to use checksums
4ba838596151beae38b24b02fae5a924747f84f6f0fb36c1997886dd1f9656e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Release files / humanbound-2.15.0-py3-none-any.whl

Download URL humanbound-2.15.0-py3-none-any.whl
Size 442.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e725e4936483a5b9fb0499a3ec55eb53a28d59935e39799e9ace43d154a4bdd
BLAKE2b-256 checksum
How to use checksums
9087dd3d4a5bcef31dfbf92bd4cc9c3200df6d4222ea4e2dd42d358c89c61830
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

Security for humanbound 2.15.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for humanbound-2.15.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.15.0 This release

2 release files Full provenance

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