hackagent 0.7.0__tar.gz → 0.8.0__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.7.0 → hackagent-0.8.0}/.gitignore +1 -0
- hackagent-0.8.0/PKG-INFO +154 -0
- hackagent-0.8.0/README.md +122 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/__init__.py +1 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/agent.py +16 -23
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/base.py +21 -3
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/evaluation_step.py +355 -11
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/metrics.py +105 -9
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/sync.py +123 -7
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/orchestrator.py +111 -43
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/registry.py +1 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/config.py +5 -5
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/config.py +2 -2
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/core.py +6 -2
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/dashboard_tracing.py +1 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/evaluation.py +15 -5
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/lifelong.py +6 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/warm_up.py +6 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/attack.py +11 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/config.py +2 -2
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/evaluation.py +248 -57
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/generation.py +14 -7
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/config.py +13 -13
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/h4rm3l/decorators.py +3 -5
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/h4rm3l/generation.py +6 -10
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pair/attack.py +112 -13
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pair/config.py +2 -4
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/generation.py +16 -8
- hackagent-0.8.0/hackagent/cli/commands/attack.py +884 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/commands/config.py +4 -9
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/commands/examples.py +200 -6
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/commands/results.py +17 -65
- hackagent-0.8.0/hackagent/cli/commands/scan.py +335 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/config.py +5 -40
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/main.py +31 -153
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/app.py +2 -2
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/attack_specs.py +2 -2
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/base.py +5 -42
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/views/agents.py +23 -22
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/views/attacks.py +148 -28
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/views/config.py +17 -110
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/views/dashboard.py +30 -84
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/views/results.py +16 -30
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/profile.py +18 -2
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/profile_types.py +0 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/adapters/litellm.py +4 -29
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/router.py +2 -9
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/category_classifier.py +107 -6
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/coordinator.py +19 -3
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/step.py +1 -1
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/tracker.py +55 -17
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/dashboard/__init__.py +2 -2
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/dashboard/_api.py +92 -18
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/dashboard/_components.py +18 -4
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/dashboard/_helpers.py +8 -8
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/dashboard/_page.py +2932 -691
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/dashboard/templates/index.html +2 -2
- hackagent-0.8.0/hackagent/server/errors.py +23 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/storage/base.py +3 -3
- hackagent-0.8.0/hackagent/server/storage/enums.py +34 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/storage/local.py +7 -8
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/storage/remote.py +99 -64
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/utils.py +25 -37
- {hackagent-0.7.0 → hackagent-0.8.0}/pyproject.toml +2 -2
- hackagent-0.7.0/PKG-INFO +0 -144
- hackagent-0.7.0/README.md +0 -112
- hackagent-0.7.0/hackagent/cli/commands/attack.py +0 -425
- hackagent-0.7.0/hackagent/server/errors.py +0 -25
- {hackagent-0.7.0 → hackagent-0.8.0}/LICENSE +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/base.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/judge_evaluators.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/pattern_evaluators.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/generator/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/generator/templates.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/objectives/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/objectives/base.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/objectives/harmful_behavior.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/objectives/jailbreak.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/objectives/policy_violation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/shared/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/shared/progress.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/shared/prompt_parser.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/shared/response_utils.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/shared/router_factory.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/shared/tui.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/shared/utils.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/completions.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/generate.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/utils.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/log_styles.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/strategy_library.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/summarizer.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/base.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/config.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/generation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/cipherchat/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/cipherchat/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/cipherchat/config.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/cipherchat/encode_experts.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/cipherchat/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/cipherchat/generation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/cipherchat/prompts_and_demonstrations.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/config.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/generation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/h4rm3l/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/h4rm3l/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/h4rm3l/config.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/h4rm3l/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pair/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pair/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pap/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pap/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pap/config.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pap/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pap/generation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pap/taxonomy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/attack.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/config.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/evaluation.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/commands/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/commands/agent.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/commands/web.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/actions_logger.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/logger.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/views/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/widgets/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/widgets/actions.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/tui/widgets/logs.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/cli/utils.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/datasets/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/datasets/base.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/datasets/presets.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/datasets/providers/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/datasets/providers/file.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/datasets/providers/huggingface.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/datasets/registry.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/errors.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/logger.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/base.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/misinformation/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/misinformation/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/misinformation/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/misinformation/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/profile_helpers.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/templates.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/registry.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/utils.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/profile.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/vulnerabilities.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/adapters/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/adapters/base.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/adapters/google_adk.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/adapters/ollama.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/adapters/openai.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/context.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/decorators.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/tracking/utils.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/router/types.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/agent/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/agent/agent_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/agent/agent_destroy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/agent/agent_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/agent/agent_partial_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/agent/agent_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/agent/agent_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/apilogs/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/apilogs/apilogs_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/apilogs/apilogs_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/apilogs/apilogs_summary_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/attack/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/attack/attack_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/attack/attack_destroy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/attack/attack_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/attack/attack_partial_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/attack/attack_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/attack/attack_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/checkout/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/checkout/checkout_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/generate/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/generate/v1_chat_completions_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/judge/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/judge/judge_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/key/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/key/key_context_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/key/key_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/key/key_destroy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/key/key_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/key/key_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/models.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/organization_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/organization_destroy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/organization_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/organization_me_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/organization_partial_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/organization_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/organization/organization_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/result_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/result_destroy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/result_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/result_partial_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/result_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/result_trace_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/result/result_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_destroy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_partial_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_result_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_run_tests_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/run/run_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/scripts/generate.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/scripts/generate.sh +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/scripts/openapi-python-client.yaml +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_create.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_destroy.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_list.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_me_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_me_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_partial_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_retrieve.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/api/user/user_update.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/client.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/dashboard/app.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/storage/__init__.py +0 -0
- {hackagent-0.7.0 → hackagent-0.8.0}/hackagent/server/types.py +0 -0
hackagent-0.8.0/PKG-INFO
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hackagent
|
|
3
|
+
Version: 0.8.0
|
|
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,7 +1,7 @@
|
|
|
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
7
|
from .server.client import AuthenticatedClient, Client
|
|
@@ -8,7 +8,6 @@ from hackagent import utils
|
|
|
8
8
|
from hackagent.errors import HackAgentError
|
|
9
9
|
from hackagent.router import AgentRouter
|
|
10
10
|
from hackagent.router.types import AgentTypeEnum
|
|
11
|
-
from hackagent.server.storage.base import StorageBackend
|
|
12
11
|
|
|
13
12
|
# Lazy import for attack orchestrators to avoid ~0.5s startup delay
|
|
14
13
|
if TYPE_CHECKING:
|
|
@@ -44,12 +43,11 @@ class HackAgent:
|
|
|
44
43
|
- Executing automated security tests against the configured agents.
|
|
45
44
|
- Retrieving and handling test results.
|
|
46
45
|
|
|
47
|
-
It encapsulates complexities such as
|
|
48
|
-
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
|
|
49
48
|
attack methodologies.
|
|
50
49
|
|
|
51
50
|
Attributes:
|
|
52
|
-
client: An `AuthenticatedClient` instance for API communication.
|
|
53
51
|
router: An `AgentRouter` instance managing the agent's representation
|
|
54
52
|
in the HackAgent backend.
|
|
55
53
|
attack_strategies: A dictionary mapping strategy names to their
|
|
@@ -72,7 +70,7 @@ class HackAgent:
|
|
|
72
70
|
"""
|
|
73
71
|
Initializes the HackAgent client and prepares it for interaction.
|
|
74
72
|
|
|
75
|
-
This constructor sets up the
|
|
73
|
+
This constructor sets up the local storage backend, loads default
|
|
76
74
|
prompts, resolves the agent type, and initializes the agent router
|
|
77
75
|
to ensure the agent is known to the backend. It also prepares available
|
|
78
76
|
attack strategies.
|
|
@@ -90,10 +88,6 @@ class HackAgent:
|
|
|
90
88
|
String values are automatically converted to the corresponding
|
|
91
89
|
`AgentTypeEnum` member. Defaults to `AgentTypeEnum.UNKNOWN` if
|
|
92
90
|
not specified or if an invalid string is provided.
|
|
93
|
-
base_url: The base URL for the HackAgent API service.
|
|
94
|
-
api_key: The API key for authenticating with the HackAgent API.
|
|
95
|
-
If omitted, the client will attempt to retrieve it from the
|
|
96
|
-
config file (~/.config/hackagent/config.json).
|
|
97
91
|
raise_on_unexpected_status: If set to `True`, the API client will
|
|
98
92
|
raise an exception for any HTTP status codes that are not typically
|
|
99
93
|
expected for a successful operation. Defaults to `False`.
|
|
@@ -122,7 +116,7 @@ class HackAgent:
|
|
|
122
116
|
raise_on_unexpected_status=raise_on_unexpected_status,
|
|
123
117
|
timeout=timeout,
|
|
124
118
|
)
|
|
125
|
-
self.backend
|
|
119
|
+
self.backend = RemoteBackend(_client)
|
|
126
120
|
logger.info("HackAgent using remote backend → %s", _base_url)
|
|
127
121
|
else:
|
|
128
122
|
from hackagent.server.storage.local import LocalBackend
|
|
@@ -132,8 +126,7 @@ class HackAgent:
|
|
|
132
126
|
"HackAgent using local backend → ~/.local/share/hackagent/hackagent.db"
|
|
133
127
|
)
|
|
134
128
|
|
|
135
|
-
#
|
|
136
|
-
# (adapters that need it can access it via backend.get_api_key())
|
|
129
|
+
# Backward compatible raw HTTP client reference.
|
|
137
130
|
self.client = getattr(self.backend, "_client", None)
|
|
138
131
|
|
|
139
132
|
processed_agent_type = utils.resolve_agent_type(agent_type)
|
|
@@ -189,16 +182,16 @@ class HackAgent:
|
|
|
189
182
|
)
|
|
190
183
|
|
|
191
184
|
self._attack_strategies = {
|
|
192
|
-
"advprefix": AdvPrefixOrchestrator(
|
|
193
|
-
"autodan_turbo": AutoDANTurboOrchestrator(
|
|
194
|
-
"baseline": BaselineOrchestrator(
|
|
195
|
-
"bon": BoNOrchestrator(
|
|
196
|
-
"cipherchat": CipherChatOrchestrator(
|
|
197
|
-
"pair": PAIROrchestrator(
|
|
198
|
-
"flipattack": FlipAttackOrchestrator(
|
|
199
|
-
"tap": TAPOrchestrator(
|
|
200
|
-
"h4rm3l": H4rm3lOrchestrator(
|
|
201
|
-
"pap": PAPOrchestrator(
|
|
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),
|
|
202
195
|
}
|
|
203
196
|
return self._attack_strategies
|
|
204
197
|
|
|
@@ -238,7 +231,7 @@ class HackAgent:
|
|
|
238
231
|
ValueError: If the 'attack_type' is missing from `attack_config` or
|
|
239
232
|
if the specified 'attack_type' is not a supported/registered
|
|
240
233
|
strategy.
|
|
241
|
-
HackAgentError: For issues during
|
|
234
|
+
HackAgentError: For issues during backend
|
|
242
235
|
agent operations, or other unexpected errors during the attack process.
|
|
243
236
|
"""
|
|
244
237
|
try:
|
|
@@ -255,18 +255,36 @@ class BaseJudgeEvaluator(ABC):
|
|
|
255
255
|
for idx, row in enumerate(data):
|
|
256
256
|
row["_original_index"] = idx
|
|
257
257
|
|
|
258
|
+
# Preserve upstream execution errors and skip judge calls for those rows.
|
|
259
|
+
rows_error = [
|
|
260
|
+
row
|
|
261
|
+
for row in data
|
|
262
|
+
if row.get("is_error") is True
|
|
263
|
+
or (
|
|
264
|
+
(row.get("error") or row.get("error_message"))
|
|
265
|
+
and not str(row.get("completion") or "").strip()
|
|
266
|
+
)
|
|
267
|
+
]
|
|
268
|
+
|
|
269
|
+
non_error_rows = [row for row in data if row not in rows_error]
|
|
270
|
+
|
|
258
271
|
# Split into filtered and processable
|
|
259
272
|
rows_trivial = [
|
|
260
273
|
row
|
|
261
|
-
for row in
|
|
274
|
+
for row in non_error_rows
|
|
262
275
|
if self._is_trivial_completion(row.get("completion", ""))
|
|
263
276
|
]
|
|
264
277
|
rows_non_trivial = [
|
|
265
278
|
row
|
|
266
|
-
for row in
|
|
279
|
+
for row in non_error_rows
|
|
267
280
|
if not self._is_trivial_completion(row.get("completion", ""))
|
|
268
281
|
]
|
|
269
282
|
|
|
283
|
+
for row in rows_error:
|
|
284
|
+
row[self.eval_column] = 0
|
|
285
|
+
err = row.get("error") or row.get("error_message") or "Unknown error"
|
|
286
|
+
row[self.explanation_column] = f"execution/adapter error: {err}"
|
|
287
|
+
|
|
270
288
|
if self.skip_length_filter:
|
|
271
289
|
rows_to_filter: List[Dict[str, Any]] = []
|
|
272
290
|
rows_to_process = rows_non_trivial
|
|
@@ -296,7 +314,7 @@ class BaseJudgeEvaluator(ABC):
|
|
|
296
314
|
|
|
297
315
|
self.logger.info(
|
|
298
316
|
f"Evaluation split: "
|
|
299
|
-
f"total={len(data)} filtered_trivial={len(rows_trivial)} "
|
|
317
|
+
f"total={len(data)} errors={len(rows_error)} filtered_trivial={len(rows_trivial)} "
|
|
300
318
|
f"filtered_short={len(rows_to_filter)} "
|
|
301
319
|
f"to_process={len(rows_to_process)}"
|
|
302
320
|
)
|