hackagent 0.6.0__tar.gz → 0.9.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hackagent-0.6.0 → hackagent-0.9.1}/.gitignore +2 -6
- hackagent-0.9.1/PKG-INFO +154 -0
- hackagent-0.9.1/README.md +122 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/__init__.py +8 -2
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/agent.py +85 -31
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/__init__.py +2 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/evaluator/__init__.py +3 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/evaluator/base.py +187 -37
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/evaluator/evaluation_step.py +498 -18
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/evaluator/judge_evaluators.py +65 -4
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/evaluator/metrics.py +109 -12
- hackagent-0.9.1/hackagent/attacks/evaluator/sync.py +322 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/orchestrator.py +318 -217
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/registry.py +13 -1
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/shared/router_factory.py +37 -45
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/advprefix/attack.py +10 -7
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/advprefix/completions.py +12 -12
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/advprefix/config.py +65 -64
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/advprefix/evaluation.py +27 -1
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/advprefix/generate.py +68 -27
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/attack.py +35 -12
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/config.py +102 -71
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/core.py +102 -46
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/dashboard_tracing.py +1 -1
- hackagent-0.9.1/hackagent/attacks/techniques/autodan_turbo/evaluation.py +164 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/lifelong.py +117 -10
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/strategy_library.py +183 -27
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/summarizer.py +2 -1
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/warm_up.py +64 -12
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/base.py +22 -3
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/baseline/attack.py +39 -7
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/baseline/config.py +17 -30
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/baseline/evaluation.py +331 -68
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/baseline/generation.py +126 -53
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/bon/attack.py +8 -5
- hackagent-0.9.1/hackagent/attacks/techniques/bon/config.py +121 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/bon/evaluation.py +1 -1
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/bon/generation.py +30 -11
- hackagent-0.9.1/hackagent/attacks/techniques/cipherchat/__init__.py +12 -0
- hackagent-0.9.1/hackagent/attacks/techniques/cipherchat/attack.py +202 -0
- hackagent-0.9.1/hackagent/attacks/techniques/cipherchat/config.py +54 -0
- hackagent-0.9.1/hackagent/attacks/techniques/cipherchat/encode_experts.py +366 -0
- hackagent-0.9.1/hackagent/attacks/techniques/cipherchat/evaluation.py +108 -0
- hackagent-0.9.1/hackagent/attacks/techniques/cipherchat/generation.py +326 -0
- hackagent-0.9.1/hackagent/attacks/techniques/cipherchat/prompts_and_demonstrations.py +331 -0
- hackagent-0.9.1/hackagent/attacks/techniques/config.py +370 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/flipattack/attack.py +28 -40
- hackagent-0.9.1/hackagent/attacks/techniques/flipattack/config.py +114 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/flipattack/evaluation.py +1 -1
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/flipattack/generation.py +33 -1
- hackagent-0.9.1/hackagent/attacks/techniques/h4rm3l/__init__.py +15 -0
- hackagent-0.9.1/hackagent/attacks/techniques/h4rm3l/attack.py +224 -0
- hackagent-0.9.1/hackagent/attacks/techniques/h4rm3l/config.py +183 -0
- hackagent-0.9.1/hackagent/attacks/techniques/h4rm3l/decorators.py +1240 -0
- hackagent-0.9.1/hackagent/attacks/techniques/h4rm3l/evaluation.py +185 -0
- hackagent-0.9.1/hackagent/attacks/techniques/h4rm3l/generation.py +357 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/pair/attack.py +451 -80
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/pair/config.py +56 -22
- hackagent-0.9.1/hackagent/attacks/techniques/pair/evaluation.py +90 -0
- hackagent-0.9.1/hackagent/attacks/techniques/pap/__init__.py +15 -0
- hackagent-0.9.1/hackagent/attacks/techniques/pap/attack.py +228 -0
- hackagent-0.9.1/hackagent/attacks/techniques/pap/config.py +157 -0
- hackagent-0.9.1/hackagent/attacks/techniques/pap/evaluation.py +105 -0
- hackagent-0.9.1/hackagent/attacks/techniques/pap/generation.py +626 -0
- hackagent-0.9.1/hackagent/attacks/techniques/pap/taxonomy.py +540 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/tap/attack.py +7 -7
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/tap/config.py +14 -101
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/tap/evaluation.py +1 -1
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/tap/generation.py +80 -16
- hackagent-0.9.1/hackagent/cli/commands/attack.py +884 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/commands/config.py +8 -29
- hackagent-0.9.1/hackagent/cli/commands/examples.py +470 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/commands/results.py +67 -75
- hackagent-0.9.1/hackagent/cli/commands/scan.py +335 -0
- hackagent-0.9.1/hackagent/cli/commands/web.py +157 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/config.py +25 -66
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/main.py +205 -179
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/app.py +2 -2
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/attack_specs.py +583 -13
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/base.py +21 -20
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/views/agents.py +46 -78
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/views/attacks.py +408 -35
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/views/config.py +35 -82
- hackagent-0.9.1/hackagent/cli/tui/views/dashboard.py +352 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/views/results.py +864 -422
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/datasets/providers/huggingface.py +0 -22
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/jailbreak/profile.py +18 -2
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/profile_types.py +0 -1
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/adapters/base.py +20 -13
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/adapters/google_adk.py +4 -4
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/adapters/litellm.py +13 -38
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/adapters/ollama.py +18 -15
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/adapters/openai.py +90 -17
- hackagent-0.9.1/hackagent/router/router.py +459 -0
- hackagent-0.9.1/hackagent/router/tracking/category_classifier.py +519 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/tracking/context.py +4 -4
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/tracking/coordinator.py +130 -26
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/tracking/step.py +35 -97
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/tracking/tracker.py +143 -106
- hackagent-0.9.1/hackagent/server/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/models.py +3 -1
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/scripts/generate.py +6 -16
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/scripts/openapi-python-client.yaml +3 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/client.py +93 -77
- hackagent-0.9.1/hackagent/server/dashboard/__init__.py +23 -0
- hackagent-0.9.1/hackagent/server/dashboard/_api.py +210 -0
- hackagent-0.9.1/hackagent/server/dashboard/_components.py +304 -0
- hackagent-0.9.1/hackagent/server/dashboard/_helpers.py +137 -0
- hackagent-0.9.1/hackagent/server/dashboard/_page.py +6535 -0
- hackagent-0.9.1/hackagent/server/dashboard/app.py +75 -0
- hackagent-0.9.1/hackagent/server/dashboard/templates/index.html +1288 -0
- hackagent-0.9.1/hackagent/server/errors.py +23 -0
- hackagent-0.9.1/hackagent/server/storage/__init__.py +0 -0
- hackagent-0.9.1/hackagent/server/storage/base.py +239 -0
- hackagent-0.9.1/hackagent/server/storage/enums.py +34 -0
- hackagent-0.9.1/hackagent/server/storage/local.py +717 -0
- hackagent-0.9.1/hackagent/server/storage/remote.py +904 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/types.py +8 -5
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/utils.py +30 -47
- {hackagent-0.6.0 → hackagent-0.9.1}/pyproject.toml +15 -16
- hackagent-0.6.0/PKG-INFO +0 -145
- hackagent-0.6.0/README.md +0 -112
- hackagent-0.6.0/hackagent/attacks/evaluator/sync.py +0 -210
- hackagent-0.6.0/hackagent/attacks/techniques/autodan_turbo/evaluation.py +0 -174
- hackagent-0.6.0/hackagent/attacks/techniques/bon/config.py +0 -227
- hackagent-0.6.0/hackagent/attacks/techniques/flipattack/config.py +0 -203
- hackagent-0.6.0/hackagent/cli/commands/attack.py +0 -425
- hackagent-0.6.0/hackagent/cli/tui/views/dashboard.py +0 -322
- hackagent-0.6.0/hackagent/router/router.py +0 -1035
- {hackagent-0.6.0 → hackagent-0.9.1}/LICENSE +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/base.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/evaluator/pattern_evaluators.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/generator/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/generator/templates.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/objectives/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/objectives/base.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/objectives/harmful_behavior.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/objectives/jailbreak.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/objectives/policy_violation.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/shared/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/shared/progress.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/shared/prompt_parser.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/shared/response_utils.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/shared/tui.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/shared/utils.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/advprefix/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/advprefix/utils.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/autodan_turbo/log_styles.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/baseline/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/bon/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/flipattack/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/pair/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/attacks/techniques/tap/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/commands/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/commands/agent.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/actions_logger.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/logger.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/views/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/widgets/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/widgets/actions.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/tui/widgets/logs.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/cli/utils.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/datasets/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/datasets/base.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/datasets/presets.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/datasets/providers/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/datasets/providers/file.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/datasets/registry.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/errors.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/logger.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/base.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/craft_adversarial_data/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/craft_adversarial_data/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/craft_adversarial_data/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/craft_adversarial_data/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/credential_exposure/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/credential_exposure/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/credential_exposure/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/credential_exposure/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/excessive_agency/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/excessive_agency/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/excessive_agency/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/excessive_agency/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/input_manipulation_attack/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/input_manipulation_attack/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/input_manipulation_attack/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/input_manipulation_attack/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/jailbreak/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/jailbreak/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/jailbreak/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/malicious_tool_invocation/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/malicious_tool_invocation/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/malicious_tool_invocation/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/malicious_tool_invocation/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/misinformation/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/misinformation/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/misinformation/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/misinformation/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/model_evasion/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/model_evasion/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/model_evasion/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/model_evasion/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/profile_helpers.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/prompt_injection/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/prompt_injection/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/prompt_injection/templates.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/prompt_injection/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/prompt_injection/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/public_facing_application_exploitation/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/public_facing_application_exploitation/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/public_facing_application_exploitation/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/public_facing_application_exploitation/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/registry.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/sensitive_information_disclosure/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/sensitive_information_disclosure/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/sensitive_information_disclosure/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/sensitive_information_disclosure/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/system_prompt_leakage/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/system_prompt_leakage/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/system_prompt_leakage/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/system_prompt_leakage/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/utils.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/vector_embedding_weaknesses_exploit/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/vector_embedding_weaknesses_exploit/profile.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/vector_embedding_weaknesses_exploit/types.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/risks/vector_embedding_weaknesses_exploit/vulnerabilities.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/adapters/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/tracking/__init__.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/tracking/decorators.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/tracking/utils.py +0 -0
- {hackagent-0.6.0 → hackagent-0.9.1}/hackagent/router/types.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/agent/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/agent/agent_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/agent/agent_destroy.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/agent/agent_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/agent/agent_partial_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/agent/agent_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/agent/agent_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/apilogs/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/apilogs/apilogs_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/apilogs/apilogs_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/apilogs/apilogs_summary_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/attack/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/attack/attack_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/attack/attack_destroy.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/attack/attack_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/attack/attack_partial_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/attack/attack_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/attack/attack_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/checkout/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/checkout/checkout_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/generate/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/generate/v1_chat_completions_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/judge/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/judge/judge_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/key/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/key/key_context_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/key/key_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/key/key_destroy.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/key/key_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/key/key_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/organization_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/organization_destroy.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/organization_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/organization_me_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/organization_partial_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/organization_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/organization/organization_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/result_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/result_destroy.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/result_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/result_partial_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/result_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/result_trace_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/result/result_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_destroy.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_partial_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_result_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_run_tests_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/run/run_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/scripts/generate.sh +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/__init__.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_create.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_destroy.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_list.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_me_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_me_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_partial_update.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_retrieve.py +0 -0
- {hackagent-0.6.0/hackagent → hackagent-0.9.1/hackagent/server}/api/user/user_update.py +0 -0
|
@@ -132,10 +132,6 @@ venv.bak/
|
|
|
132
132
|
.dmypy.json
|
|
133
133
|
dmypy.json
|
|
134
134
|
|
|
135
|
-
tests/test_with_cineca_judge
|
|
136
135
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
hackagent/attacks/techniques/bon/original_codebase/
|
|
140
|
-
|
|
141
|
-
ATTACK_INTEGRATION_HANDOUT.md
|
|
136
|
+
.copilotignore
|
|
137
|
+
tests/e2e/attacks/
|
hackagent-0.9.1/PKG-INFO
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hackagent
|
|
3
|
+
Version: 0.9.1
|
|
4
|
+
Summary: HackAgent is an open-source security toolkit to detect vulnerabilities of your AI Agents.
|
|
5
|
+
Author-email: AI Security Lab <ais@ai4i.it>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agents,ai,security,testing,vulnerabilities
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Requires-Dist: click>=8.1.0
|
|
19
|
+
Requires-Dist: datasets>=2.14.0
|
|
20
|
+
Requires-Dist: faiss-cpu>=1.13.2
|
|
21
|
+
Requires-Dist: httpx>=0.27.0
|
|
22
|
+
Requires-Dist: litellm>=1.69.2
|
|
23
|
+
Requires-Dist: nicegui>=2.0
|
|
24
|
+
Requires-Dist: openai>=1.0.0
|
|
25
|
+
Requires-Dist: pydantic[email]>=2.0
|
|
26
|
+
Requires-Dist: python-dateutil>=2.8.0
|
|
27
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
28
|
+
Requires-Dist: requests>=2.31.0
|
|
29
|
+
Requires-Dist: rich>=14.0.0
|
|
30
|
+
Requires-Dist: textual>=1.0.0
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
<div align="center">
|
|
34
|
+
<p align="center">
|
|
35
|
+
<img src="https://docs.hackagent.dev/img/banner.svg" alt="HackAgent - AI Agent Security Testing Toolkit" width="800">
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
<strong>AI Security Red-Team Toolkit</strong>
|
|
39
|
+
|
|
40
|
+
<br>
|
|
41
|
+
|
|
42
|
+
[App](https://app.hackagent.dev/) -- [Docs](https://docs.hackagent.dev/) -- [API](https://api.hackagent.dev/schema/redoc)
|
|
43
|
+
|
|
44
|
+
<br>
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+

|
|
48
|
+

|
|
49
|
+
[](http://commitizen.github.io/cz-cli/)
|
|
50
|
+

|
|
51
|
+

|
|
52
|
+

|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
## What is HackAgent?
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
As AI agents become more powerful and autonomous, they face security challenges that traditional testing tools cannot address:
|
|
62
|
+
|
|
63
|
+
| Threat | Description |
|
|
64
|
+
|--------|-------------|
|
|
65
|
+
| **Prompt Injection** | Malicious inputs that hijack agent behavior |
|
|
66
|
+
| **Jailbreaking** | Bypassing safety guardrails and content filters |
|
|
67
|
+
| **Goal Hijacking** | Manipulating agents to pursue unintended objectives |
|
|
68
|
+
| **Tool Misuse** | Exploiting agent capabilities for unauthorized actions |
|
|
69
|
+
|
|
70
|
+
HackAgent automates testing for these vulnerabilities using research-backed attack techniques, helping you identify and fix security issues before they are exploited.
|
|
71
|
+
|
|
72
|
+
<div align="center">
|
|
73
|
+
<img src="docs/static/gifs/terminal.gif" alt="HackAgent CLI Demo" width="100%" />
|
|
74
|
+
<p><em>Interactive TUI with real-time attack progress and visual reporting.</em></p>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
## Get Started Now
|
|
78
|
+
|
|
79
|
+
### Quick Install
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
python3 -m venv .venv
|
|
83
|
+
source .venv/bin/activate
|
|
84
|
+
pip install hackagent
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
No API key required: HackAgent works locally out of the box.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
Questions? Join [community discussions](https://github.com/AISecurityLab/hackagent/discussions) or email ais@ai4i.it.
|
|
91
|
+
|
|
92
|
+
## Architecture
|
|
93
|
+
|
|
94
|
+
HackAgent uses a modular pipeline to test agent robustness end-to-end.
|
|
95
|
+
|
|
96
|
+
| Component | Description |
|
|
97
|
+
|-----------|-------------|
|
|
98
|
+
| **Attack Engine** | Orchestrates attacks using AdvPrefix, AutoDAN-Turbo, PAIR, TAP, FlipAttack, BoN, h4rm3l, CipherChat, PAP, and Baseline |
|
|
99
|
+
| **Generator** | LLM role that creates adversarial prompts to test the target agent |
|
|
100
|
+
| **Judge** | LLM role that evaluates whether attacks bypass safety measures |
|
|
101
|
+
| **Target Agent** | Your AI agent under test across supported frameworks |
|
|
102
|
+
| **Datasets** | Pre-built benchmark presets plus custom HuggingFace/file datasets |
|
|
103
|
+
|
|
104
|
+
## Supported Frameworks
|
|
105
|
+
|
|
106
|
+
[](https://google.github.io/adk-docs/)
|
|
107
|
+
[](https://platform.openai.com/docs)
|
|
108
|
+
[](https://github.com/BerriAI/litellm)
|
|
109
|
+
[](https://python.langchain.com)
|
|
110
|
+
|
|
111
|
+
## Reporting
|
|
112
|
+
|
|
113
|
+
HackAgent supports both local and remote reporting.
|
|
114
|
+
|
|
115
|
+
- Local mode stores test results in SQLite and includes a built-in dashboard.
|
|
116
|
+
- Cloud mode syncs runs to the HackAgent remote platform when an API key is configured.
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
hackagent web
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Access cloud reporting at [https://app.hackagent.dev](https://app.hackagent.dev).
|
|
123
|
+
|
|
124
|
+
## Responsible Use
|
|
125
|
+
|
|
126
|
+
HackAgent is designed for authorized security testing only. Always obtain explicit permission before testing any AI system.
|
|
127
|
+
|
|
128
|
+
### Do
|
|
129
|
+
|
|
130
|
+
- Test your own agents
|
|
131
|
+
- Conduct authorized pentesting
|
|
132
|
+
- Follow coordinated disclosure
|
|
133
|
+
- Share security knowledge responsibly
|
|
134
|
+
|
|
135
|
+
### Don't
|
|
136
|
+
|
|
137
|
+
- Test systems without permission
|
|
138
|
+
- Exploit vulnerabilities maliciously
|
|
139
|
+
- Violate terms of service
|
|
140
|
+
- Share harmful exploit instructions irresponsibly
|
|
141
|
+
|
|
142
|
+
Read the full guidelines: [Responsible Disclosure](docs/docs/security/responsible-disclosure.md)
|
|
143
|
+
|
|
144
|
+
## Contributing
|
|
145
|
+
|
|
146
|
+
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
Licensed under Apache-2.0. See [LICENSE](LICENSE).
|
|
151
|
+
|
|
152
|
+
## Disclaimer
|
|
153
|
+
|
|
154
|
+
HackAgent is intended for security research and AI safety improvement. The authors are not responsible for misuse.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://docs.hackagent.dev/img/banner.svg" alt="HackAgent - AI Agent Security Testing Toolkit" width="800">
|
|
4
|
+
</p>
|
|
5
|
+
|
|
6
|
+
<strong>AI Security Red-Team Toolkit</strong>
|
|
7
|
+
|
|
8
|
+
<br>
|
|
9
|
+
|
|
10
|
+
[App](https://app.hackagent.dev/) -- [Docs](https://docs.hackagent.dev/) -- [API](https://api.hackagent.dev/schema/redoc)
|
|
11
|
+
|
|
12
|
+
<br>
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+

|
|
16
|
+

|
|
17
|
+
[](http://commitizen.github.io/cz-cli/)
|
|
18
|
+

|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
## What is HackAgent?
|
|
24
|
+
|
|
25
|
+
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.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
As AI agents become more powerful and autonomous, they face security challenges that traditional testing tools cannot address:
|
|
30
|
+
|
|
31
|
+
| Threat | Description |
|
|
32
|
+
|--------|-------------|
|
|
33
|
+
| **Prompt Injection** | Malicious inputs that hijack agent behavior |
|
|
34
|
+
| **Jailbreaking** | Bypassing safety guardrails and content filters |
|
|
35
|
+
| **Goal Hijacking** | Manipulating agents to pursue unintended objectives |
|
|
36
|
+
| **Tool Misuse** | Exploiting agent capabilities for unauthorized actions |
|
|
37
|
+
|
|
38
|
+
HackAgent automates testing for these vulnerabilities using research-backed attack techniques, helping you identify and fix security issues before they are exploited.
|
|
39
|
+
|
|
40
|
+
<div align="center">
|
|
41
|
+
<img src="docs/static/gifs/terminal.gif" alt="HackAgent CLI Demo" width="100%" />
|
|
42
|
+
<p><em>Interactive TUI with real-time attack progress and visual reporting.</em></p>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
## Get Started Now
|
|
46
|
+
|
|
47
|
+
### Quick Install
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
python3 -m venv .venv
|
|
51
|
+
source .venv/bin/activate
|
|
52
|
+
pip install hackagent
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
No API key required: HackAgent works locally out of the box.
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
Questions? Join [community discussions](https://github.com/AISecurityLab/hackagent/discussions) or email ais@ai4i.it.
|
|
59
|
+
|
|
60
|
+
## Architecture
|
|
61
|
+
|
|
62
|
+
HackAgent uses a modular pipeline to test agent robustness end-to-end.
|
|
63
|
+
|
|
64
|
+
| Component | Description |
|
|
65
|
+
|-----------|-------------|
|
|
66
|
+
| **Attack Engine** | Orchestrates attacks using AdvPrefix, AutoDAN-Turbo, PAIR, TAP, FlipAttack, BoN, h4rm3l, CipherChat, PAP, and Baseline |
|
|
67
|
+
| **Generator** | LLM role that creates adversarial prompts to test the target agent |
|
|
68
|
+
| **Judge** | LLM role that evaluates whether attacks bypass safety measures |
|
|
69
|
+
| **Target Agent** | Your AI agent under test across supported frameworks |
|
|
70
|
+
| **Datasets** | Pre-built benchmark presets plus custom HuggingFace/file datasets |
|
|
71
|
+
|
|
72
|
+
## Supported Frameworks
|
|
73
|
+
|
|
74
|
+
[](https://google.github.io/adk-docs/)
|
|
75
|
+
[](https://platform.openai.com/docs)
|
|
76
|
+
[](https://github.com/BerriAI/litellm)
|
|
77
|
+
[](https://python.langchain.com)
|
|
78
|
+
|
|
79
|
+
## Reporting
|
|
80
|
+
|
|
81
|
+
HackAgent supports both local and remote reporting.
|
|
82
|
+
|
|
83
|
+
- Local mode stores test results in SQLite and includes a built-in dashboard.
|
|
84
|
+
- Cloud mode syncs runs to the HackAgent remote platform when an API key is configured.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
hackagent web
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Access cloud reporting at [https://app.hackagent.dev](https://app.hackagent.dev).
|
|
91
|
+
|
|
92
|
+
## Responsible Use
|
|
93
|
+
|
|
94
|
+
HackAgent is designed for authorized security testing only. Always obtain explicit permission before testing any AI system.
|
|
95
|
+
|
|
96
|
+
### Do
|
|
97
|
+
|
|
98
|
+
- Test your own agents
|
|
99
|
+
- Conduct authorized pentesting
|
|
100
|
+
- Follow coordinated disclosure
|
|
101
|
+
- Share security knowledge responsibly
|
|
102
|
+
|
|
103
|
+
### Don't
|
|
104
|
+
|
|
105
|
+
- Test systems without permission
|
|
106
|
+
- Exploit vulnerabilities maliciously
|
|
107
|
+
- Violate terms of service
|
|
108
|
+
- Share harmful exploit instructions irresponsibly
|
|
109
|
+
|
|
110
|
+
Read the full guidelines: [Responsible Disclosure](docs/docs/security/responsible-disclosure.md)
|
|
111
|
+
|
|
112
|
+
## Contributing
|
|
113
|
+
|
|
114
|
+
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md).
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
Licensed under Apache-2.0. See [LICENSE](LICENSE).
|
|
119
|
+
|
|
120
|
+
## Disclaimer
|
|
121
|
+
|
|
122
|
+
HackAgent is intended for security research and AI safety improvement. The authors are not responsible for misuse.
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
# Copyright 2026 - AI4I. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
"""A client library for
|
|
4
|
+
"""A client library for HackAgent — AI Agent Security Testing"""
|
|
5
5
|
|
|
6
6
|
from .agent import HackAgent
|
|
7
|
-
from .client import AuthenticatedClient, Client
|
|
7
|
+
from .server.client import AuthenticatedClient, Client
|
|
8
8
|
from .logger import setup_package_logging
|
|
9
9
|
from .router.types import AgentTypeEnum
|
|
10
|
+
from .server.storage.base import StorageBackend
|
|
11
|
+
from .server.storage.local import LocalBackend
|
|
12
|
+
from .server.storage.remote import RemoteBackend
|
|
10
13
|
|
|
11
14
|
# Configure RichHandler for all hackagent.* loggers on first import.
|
|
12
15
|
setup_package_logging()
|
|
@@ -16,4 +19,7 @@ __all__ = (
|
|
|
16
19
|
"AuthenticatedClient",
|
|
17
20
|
"Client",
|
|
18
21
|
"HackAgent",
|
|
22
|
+
"LocalBackend",
|
|
23
|
+
"RemoteBackend",
|
|
24
|
+
"StorageBackend",
|
|
19
25
|
)
|
|
@@ -5,7 +5,6 @@ from hackagent.logger import get_logger
|
|
|
5
5
|
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
|
6
6
|
|
|
7
7
|
from hackagent import utils
|
|
8
|
-
from hackagent.client import AuthenticatedClient
|
|
9
8
|
from hackagent.errors import HackAgentError
|
|
10
9
|
from hackagent.router import AgentRouter
|
|
11
10
|
from hackagent.router.types import AgentTypeEnum
|
|
@@ -17,6 +16,22 @@ if TYPE_CHECKING:
|
|
|
17
16
|
logger = get_logger(__name__)
|
|
18
17
|
|
|
19
18
|
|
|
19
|
+
def _resolve_target_config(target_config: Optional[Dict[str, Any]]) -> Dict[str, Any]:
|
|
20
|
+
"""Return normalized victim request defaults for the configured router."""
|
|
21
|
+
from hackagent.attacks.techniques.config import default_target
|
|
22
|
+
|
|
23
|
+
resolved = default_target()
|
|
24
|
+
if not target_config:
|
|
25
|
+
return resolved
|
|
26
|
+
|
|
27
|
+
merged = {key: value for key, value in target_config.items() if value is not None}
|
|
28
|
+
if "request_timeout" in merged and "timeout" not in merged:
|
|
29
|
+
merged["timeout"] = merged.pop("request_timeout")
|
|
30
|
+
|
|
31
|
+
resolved.update(merged)
|
|
32
|
+
return resolved
|
|
33
|
+
|
|
34
|
+
|
|
20
35
|
class HackAgent:
|
|
21
36
|
"""
|
|
22
37
|
The primary client for orchestrating security assessments with HackAgent.
|
|
@@ -28,12 +43,11 @@ class HackAgent:
|
|
|
28
43
|
- Executing automated security tests against the configured agents.
|
|
29
44
|
- Retrieving and handling test results.
|
|
30
45
|
|
|
31
|
-
It encapsulates complexities such as
|
|
32
|
-
with the backend (via `AgentRouter`), and the dynamic dispatch of various
|
|
46
|
+
It encapsulates complexities such as agent registration
|
|
47
|
+
with the local backend (via `AgentRouter`), and the dynamic dispatch of various
|
|
33
48
|
attack methodologies.
|
|
34
49
|
|
|
35
50
|
Attributes:
|
|
36
|
-
client: An `AuthenticatedClient` instance for API communication.
|
|
37
51
|
router: An `AgentRouter` instance managing the agent's representation
|
|
38
52
|
in the HackAgent backend.
|
|
39
53
|
attack_strategies: A dictionary mapping strategy names to their
|
|
@@ -50,12 +64,13 @@ class HackAgent:
|
|
|
50
64
|
raise_on_unexpected_status: bool = False,
|
|
51
65
|
timeout: Optional[float] = None,
|
|
52
66
|
metadata: Optional[Dict[str, Any]] = None,
|
|
67
|
+
target_config: Optional[Dict[str, Any]] = None,
|
|
53
68
|
adapter_operational_config: Optional[Dict[str, Any]] = None,
|
|
54
69
|
):
|
|
55
70
|
"""
|
|
56
71
|
Initializes the HackAgent client and prepares it for interaction.
|
|
57
72
|
|
|
58
|
-
This constructor sets up the
|
|
73
|
+
This constructor sets up the local storage backend, loads default
|
|
59
74
|
prompts, resolves the agent type, and initializes the agent router
|
|
60
75
|
to ensure the agent is known to the backend. It also prepares available
|
|
61
76
|
attack strategies.
|
|
@@ -73,10 +88,6 @@ class HackAgent:
|
|
|
73
88
|
String values are automatically converted to the corresponding
|
|
74
89
|
`AgentTypeEnum` member. Defaults to `AgentTypeEnum.UNKNOWN` if
|
|
75
90
|
not specified or if an invalid string is provided.
|
|
76
|
-
base_url: The base URL for the HackAgent API service.
|
|
77
|
-
api_key: The API key for authenticating with the HackAgent API.
|
|
78
|
-
If omitted, the client will attempt to retrieve it from the
|
|
79
|
-
config file (~/.config/hackagent/config.json).
|
|
80
91
|
raise_on_unexpected_status: If set to `True`, the API client will
|
|
81
92
|
raise an exception for any HTTP status codes that are not typically
|
|
82
93
|
expected for a successful operation. Defaults to `False`.
|
|
@@ -84,32 +95,69 @@ class HackAgent:
|
|
|
84
95
|
authenticated client. Defaults to `None` (which might mean a
|
|
85
96
|
default timeout from the underlying HTTP library is used).
|
|
86
97
|
metadata: Optional dictionary containing agent-specific metadata.
|
|
98
|
+
target_config: Optional default request settings for the configured
|
|
99
|
+
victim model. This is the preferred place to define target-side
|
|
100
|
+
generation defaults such as `max_tokens`, `temperature`,
|
|
101
|
+
and `timeout`.
|
|
87
102
|
adapter_operational_config: Optional configuration for the agent adapter.
|
|
88
103
|
"""
|
|
89
104
|
|
|
90
105
|
resolved_auth_token = utils.resolve_api_token(direct_api_key_param=api_key)
|
|
91
106
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
107
|
+
if resolved_auth_token:
|
|
108
|
+
from hackagent.server.client import AuthenticatedClient
|
|
109
|
+
from hackagent.server.storage.remote import RemoteBackend
|
|
95
110
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
_base_url = base_url or "https://api.hackagent.dev"
|
|
112
|
+
_client = AuthenticatedClient(
|
|
113
|
+
base_url=_base_url,
|
|
114
|
+
token=resolved_auth_token,
|
|
115
|
+
prefix="Bearer",
|
|
116
|
+
raise_on_unexpected_status=raise_on_unexpected_status,
|
|
117
|
+
timeout=timeout,
|
|
118
|
+
)
|
|
119
|
+
self.backend = RemoteBackend(_client)
|
|
120
|
+
logger.info("HackAgent using remote backend → %s", _base_url)
|
|
121
|
+
else:
|
|
122
|
+
from hackagent.server.storage.local import LocalBackend
|
|
123
|
+
|
|
124
|
+
self.backend = LocalBackend()
|
|
125
|
+
logger.info(
|
|
126
|
+
"HackAgent using local backend → ~/.local/share/hackagent/hackagent.db"
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Backward compatible raw HTTP client reference.
|
|
130
|
+
self.client = getattr(self.backend, "_client", None)
|
|
103
131
|
|
|
104
132
|
processed_agent_type = utils.resolve_agent_type(agent_type)
|
|
133
|
+
self.target_config = _resolve_target_config(target_config)
|
|
134
|
+
explicit_target_config = (
|
|
135
|
+
{
|
|
136
|
+
key: value
|
|
137
|
+
for key, value in (target_config or {}).items()
|
|
138
|
+
if value is not None
|
|
139
|
+
}
|
|
140
|
+
if target_config
|
|
141
|
+
else {}
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
router_metadata = {
|
|
145
|
+
key: value
|
|
146
|
+
for key, value in {**(metadata or {}), **explicit_target_config}.items()
|
|
147
|
+
if value is not None
|
|
148
|
+
}
|
|
149
|
+
router_operational_config = {
|
|
150
|
+
**self.target_config,
|
|
151
|
+
**(adapter_operational_config or {}),
|
|
152
|
+
}
|
|
105
153
|
|
|
106
154
|
self.router = AgentRouter(
|
|
107
|
-
|
|
108
|
-
name=name,
|
|
155
|
+
backend=self.backend,
|
|
156
|
+
name=name or endpoint, # fall back to endpoint if no name provided
|
|
109
157
|
agent_type=processed_agent_type,
|
|
110
158
|
endpoint=endpoint,
|
|
111
|
-
metadata=
|
|
112
|
-
adapter_operational_config=
|
|
159
|
+
metadata=router_metadata,
|
|
160
|
+
adapter_operational_config=router_operational_config,
|
|
113
161
|
)
|
|
114
162
|
|
|
115
163
|
# Attack strategies are lazy-loaded to improve startup time
|
|
@@ -125,19 +173,25 @@ class HackAgent:
|
|
|
125
173
|
AutoDANTurboOrchestrator,
|
|
126
174
|
BaselineOrchestrator,
|
|
127
175
|
BoNOrchestrator,
|
|
176
|
+
CipherChatOrchestrator,
|
|
177
|
+
H4rm3lOrchestrator,
|
|
178
|
+
PAPOrchestrator,
|
|
128
179
|
PAIROrchestrator,
|
|
129
180
|
FlipAttackOrchestrator,
|
|
130
181
|
TAPOrchestrator,
|
|
131
182
|
)
|
|
132
183
|
|
|
133
184
|
self._attack_strategies = {
|
|
134
|
-
"advprefix": AdvPrefixOrchestrator(
|
|
135
|
-
"autodan_turbo": AutoDANTurboOrchestrator(
|
|
136
|
-
"baseline": BaselineOrchestrator(
|
|
137
|
-
"bon": BoNOrchestrator(
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
185
|
+
"advprefix": AdvPrefixOrchestrator(hackagent_agent=self),
|
|
186
|
+
"autodan_turbo": AutoDANTurboOrchestrator(hackagent_agent=self),
|
|
187
|
+
"baseline": BaselineOrchestrator(hackagent_agent=self),
|
|
188
|
+
"bon": BoNOrchestrator(hackagent_agent=self),
|
|
189
|
+
"cipherchat": CipherChatOrchestrator(hackagent_agent=self),
|
|
190
|
+
"pair": PAIROrchestrator(hackagent_agent=self),
|
|
191
|
+
"flipattack": FlipAttackOrchestrator(hackagent_agent=self),
|
|
192
|
+
"tap": TAPOrchestrator(hackagent_agent=self),
|
|
193
|
+
"h4rm3l": H4rm3lOrchestrator(hackagent_agent=self),
|
|
194
|
+
"pap": PAPOrchestrator(hackagent_agent=self),
|
|
141
195
|
}
|
|
142
196
|
return self._attack_strategies
|
|
143
197
|
|
|
@@ -177,7 +231,7 @@ class HackAgent:
|
|
|
177
231
|
ValueError: If the 'attack_type' is missing from `attack_config` or
|
|
178
232
|
if the specified 'attack_type' is not a supported/registered
|
|
179
233
|
strategy.
|
|
180
|
-
HackAgentError: For issues during
|
|
234
|
+
HackAgentError: For issues during backend
|
|
181
235
|
agent operations, or other unexpected errors during the attack process.
|
|
182
236
|
"""
|
|
183
237
|
try:
|
|
@@ -35,6 +35,7 @@ from .registry import (
|
|
|
35
35
|
AdvPrefixOrchestrator,
|
|
36
36
|
AutoDANTurboOrchestrator,
|
|
37
37
|
BaselineOrchestrator,
|
|
38
|
+
CipherChatOrchestrator,
|
|
38
39
|
PAIROrchestrator,
|
|
39
40
|
FlipAttackOrchestrator,
|
|
40
41
|
TAPOrchestrator,
|
|
@@ -45,6 +46,7 @@ __all__ = [
|
|
|
45
46
|
"AdvPrefixOrchestrator",
|
|
46
47
|
"AutoDANTurboOrchestrator",
|
|
47
48
|
"BaselineOrchestrator",
|
|
49
|
+
"CipherChatOrchestrator",
|
|
48
50
|
"PAIROrchestrator",
|
|
49
51
|
"FlipAttackOrchestrator",
|
|
50
52
|
"TAPOrchestrator",
|
|
@@ -23,6 +23,7 @@ Usage:
|
|
|
23
23
|
NuancedEvaluator,
|
|
24
24
|
JailbreakBenchEvaluator,
|
|
25
25
|
HarmBenchEvaluator,
|
|
26
|
+
HarmBenchVariantEvaluator,
|
|
26
27
|
EVALUATOR_MAP,
|
|
27
28
|
AssertionResult,
|
|
28
29
|
# Pattern-based evaluators
|
|
@@ -48,6 +49,7 @@ from hackagent.attacks.evaluator.evaluation_step import BaseEvaluationStep
|
|
|
48
49
|
from hackagent.attacks.evaluator.judge_evaluators import (
|
|
49
50
|
EVALUATOR_MAP,
|
|
50
51
|
HarmBenchEvaluator,
|
|
52
|
+
HarmBenchVariantEvaluator,
|
|
51
53
|
JailbreakBenchEvaluator,
|
|
52
54
|
NuancedEvaluator,
|
|
53
55
|
OnTopicEvaluator,
|
|
@@ -81,6 +83,7 @@ __all__ = [
|
|
|
81
83
|
"NuancedEvaluator",
|
|
82
84
|
"JailbreakBenchEvaluator",
|
|
83
85
|
"HarmBenchEvaluator",
|
|
86
|
+
"HarmBenchVariantEvaluator",
|
|
84
87
|
"OnTopicEvaluator",
|
|
85
88
|
"EVALUATOR_MAP",
|
|
86
89
|
# Pattern evaluators
|