hackagent 0.5.0__tar.gz → 0.7.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.5.0 → hackagent-0.7.0}/.gitignore +5 -1
- {hackagent-0.5.0 → hackagent-0.7.0}/PKG-INFO +6 -5
- hackagent-0.7.0/hackagent/__init__.py +25 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/agent.py +84 -17
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/__init__.py +8 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/evaluator/__init__.py +15 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/evaluator/base.py +224 -54
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/evaluator/evaluation_step.py +245 -26
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/evaluator/judge_evaluators.py +123 -6
- hackagent-0.7.0/hackagent/attacks/evaluator/metrics.py +269 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/evaluator/sync.py +28 -32
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/orchestrator.py +292 -112
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/registry.py +27 -5
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/shared/progress.py +7 -0
- hackagent-0.7.0/hackagent/attacks/shared/prompt_parser.py +106 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/shared/router_factory.py +48 -47
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/advprefix/attack.py +118 -39
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/advprefix/completions.py +104 -98
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/advprefix/config.py +65 -58
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/advprefix/evaluation.py +27 -1
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/advprefix/generate.py +224 -153
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/__init__.py +14 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/attack.py +345 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/config.py +252 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/core.py +554 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/dashboard_tracing.py +67 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/evaluation.py +154 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/lifelong.py +466 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/log_styles.py +90 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/strategy_library.py +459 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/summarizer.py +194 -0
- hackagent-0.7.0/hackagent/attacks/techniques/autodan_turbo/warm_up.py +356 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/base.py +42 -9
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/baseline/attack.py +90 -14
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/baseline/config.py +15 -28
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/baseline/evaluation.py +114 -42
- hackagent-0.7.0/hackagent/attacks/techniques/baseline/generation.py +337 -0
- hackagent-0.7.0/hackagent/attacks/techniques/bon/__init__.py +16 -0
- hackagent-0.7.0/hackagent/attacks/techniques/bon/attack.py +279 -0
- hackagent-0.7.0/hackagent/attacks/techniques/bon/config.py +121 -0
- hackagent-0.7.0/hackagent/attacks/techniques/bon/evaluation.py +176 -0
- hackagent-0.7.0/hackagent/attacks/techniques/bon/generation.py +859 -0
- hackagent-0.7.0/hackagent/attacks/techniques/cipherchat/__init__.py +12 -0
- hackagent-0.7.0/hackagent/attacks/techniques/cipherchat/attack.py +202 -0
- hackagent-0.7.0/hackagent/attacks/techniques/cipherchat/config.py +54 -0
- hackagent-0.7.0/hackagent/attacks/techniques/cipherchat/encode_experts.py +366 -0
- hackagent-0.7.0/hackagent/attacks/techniques/cipherchat/evaluation.py +108 -0
- hackagent-0.7.0/hackagent/attacks/techniques/cipherchat/generation.py +326 -0
- hackagent-0.7.0/hackagent/attacks/techniques/cipherchat/prompts_and_demonstrations.py +331 -0
- hackagent-0.7.0/hackagent/attacks/techniques/config.py +370 -0
- hackagent-0.7.0/hackagent/attacks/techniques/flipattack/attack.py +506 -0
- hackagent-0.7.0/hackagent/attacks/techniques/flipattack/config.py +114 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/flipattack/evaluation.py +1 -1
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/flipattack/generation.py +90 -53
- hackagent-0.7.0/hackagent/attacks/techniques/h4rm3l/__init__.py +15 -0
- hackagent-0.7.0/hackagent/attacks/techniques/h4rm3l/attack.py +224 -0
- hackagent-0.7.0/hackagent/attacks/techniques/h4rm3l/config.py +183 -0
- hackagent-0.7.0/hackagent/attacks/techniques/h4rm3l/decorators.py +1242 -0
- hackagent-0.7.0/hackagent/attacks/techniques/h4rm3l/evaluation.py +185 -0
- hackagent-0.7.0/hackagent/attacks/techniques/h4rm3l/generation.py +361 -0
- hackagent-0.7.0/hackagent/attacks/techniques/pair/attack.py +930 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/pair/config.py +58 -22
- hackagent-0.7.0/hackagent/attacks/techniques/pair/evaluation.py +90 -0
- hackagent-0.7.0/hackagent/attacks/techniques/pap/__init__.py +15 -0
- hackagent-0.7.0/hackagent/attacks/techniques/pap/attack.py +228 -0
- hackagent-0.7.0/hackagent/attacks/techniques/pap/config.py +157 -0
- hackagent-0.7.0/hackagent/attacks/techniques/pap/evaluation.py +105 -0
- hackagent-0.7.0/hackagent/attacks/techniques/pap/generation.py +626 -0
- hackagent-0.7.0/hackagent/attacks/techniques/pap/taxonomy.py +540 -0
- hackagent-0.7.0/hackagent/attacks/techniques/tap/__init__.py +3 -0
- hackagent-0.7.0/hackagent/attacks/techniques/tap/attack.py +299 -0
- hackagent-0.7.0/hackagent/attacks/techniques/tap/config.py +115 -0
- hackagent-0.7.0/hackagent/attacks/techniques/tap/evaluation.py +255 -0
- hackagent-0.7.0/hackagent/attacks/techniques/tap/generation.py +941 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/commands/attack.py +2 -2
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/commands/config.py +5 -21
- hackagent-0.7.0/hackagent/cli/commands/examples.py +276 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/commands/results.py +144 -73
- hackagent-0.7.0/hackagent/cli/commands/web.py +157 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/config.py +24 -30
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/main.py +210 -62
- hackagent-0.7.0/hackagent/cli/tui/attack_specs.py +1375 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/base.py +41 -3
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/views/agents.py +28 -61
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/views/attacks.py +275 -22
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/views/config.py +70 -24
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/views/dashboard.py +133 -49
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/views/results.py +864 -408
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/datasets/base.py +2 -1
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/datasets/providers/file.py +2 -2
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/datasets/providers/huggingface.py +2 -24
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/datasets/registry.py +2 -2
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/logger.py +22 -18
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/base.py +2 -2
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/adapters/base.py +20 -13
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/adapters/google_adk.py +6 -6
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/adapters/litellm.py +11 -11
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/adapters/ollama.py +20 -17
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/adapters/openai.py +126 -7
- hackagent-0.7.0/hackagent/router/router.py +466 -0
- hackagent-0.7.0/hackagent/router/tracking/category_classifier.py +418 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/tracking/context.py +11 -44
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/tracking/coordinator.py +231 -100
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/tracking/decorators.py +8 -4
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/tracking/step.py +44 -189
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/tracking/tracker.py +180 -193
- hackagent-0.7.0/hackagent/router/tracking/utils.py +110 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/types.py +32 -0
- hackagent-0.7.0/hackagent/server/__init__.py +0 -0
- hackagent-0.7.0/hackagent/server/api/agent/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/agent/agent_create.py +12 -13
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/agent/agent_destroy.py +11 -8
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/agent/agent_list.py +20 -20
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/agent/agent_partial_update.py +31 -28
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/agent/agent_retrieve.py +15 -12
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/agent/agent_update.py +16 -14
- hackagent-0.7.0/hackagent/server/api/apilogs/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/apilogs/apilogs_list.py +20 -20
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/apilogs/apilogs_retrieve.py +15 -12
- hackagent-0.7.0/hackagent/server/api/apilogs/apilogs_summary_retrieve.py +219 -0
- hackagent-0.7.0/hackagent/server/api/attack/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/attack/attack_create.py +12 -13
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/attack/attack_destroy.py +11 -8
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/attack/attack_list.py +20 -20
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/attack/attack_partial_update.py +31 -28
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/attack/attack_retrieve.py +15 -12
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/attack/attack_update.py +16 -14
- hackagent-0.7.0/hackagent/server/api/checkout/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/checkout/checkout_create.py +58 -54
- hackagent-0.7.0/hackagent/server/api/generate/__init__.py +1 -0
- hackagent-0.7.0/hackagent/server/api/generate/v1_chat_completions_create.py +329 -0
- hackagent-0.7.0/hackagent/server/api/judge/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/judge/judge_create.py +64 -57
- hackagent-0.7.0/hackagent/server/api/key/__init__.py +1 -0
- hackagent-0.7.0/hackagent/server/api/key/key_context_retrieve.py +143 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/key/key_create.py +12 -13
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/key/key_destroy.py +11 -8
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/key/key_list.py +20 -20
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/key/key_retrieve.py +15 -12
- hackagent-0.7.0/hackagent/server/api/models.py +829 -0
- hackagent-0.7.0/hackagent/server/api/organization/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/organization/organization_create.py +41 -43
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/organization/organization_destroy.py +11 -8
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/organization/organization_list.py +20 -20
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/organization/organization_me_retrieve.py +11 -11
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/organization/organization_partial_update.py +60 -56
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/organization/organization_retrieve.py +15 -12
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/organization/organization_update.py +45 -44
- hackagent-0.7.0/hackagent/server/api/result/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/result/result_create.py +12 -13
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/result/result_destroy.py +11 -8
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/result/result_list.py +50 -69
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/result/result_partial_update.py +27 -24
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/result/result_retrieve.py +15 -12
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/result/result_trace_create.py +18 -16
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/result/result_update.py +16 -14
- hackagent-0.7.0/hackagent/server/api/run/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_create.py +12 -13
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_destroy.py +11 -8
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_list.py +78 -79
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_partial_update.py +31 -24
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_result_create.py +18 -16
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_retrieve.py +15 -12
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_run_tests_create.py +12 -13
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/run/run_update.py +16 -14
- hackagent-0.7.0/hackagent/server/api/scripts/generate.py +334 -0
- hackagent-0.7.0/hackagent/server/api/scripts/generate.sh +131 -0
- hackagent-0.7.0/hackagent/server/api/scripts/openapi-python-client.yaml +14 -0
- hackagent-0.7.0/hackagent/server/api/user/__init__.py +1 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_create.py +41 -55
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_destroy.py +11 -8
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_list.py +20 -20
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_me_retrieve.py +11 -11
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_me_update.py +41 -55
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_partial_update.py +60 -56
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_retrieve.py +15 -12
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/user/user_update.py +45 -56
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/client.py +93 -77
- hackagent-0.7.0/hackagent/server/dashboard/__init__.py +23 -0
- hackagent-0.7.0/hackagent/server/dashboard/_api.py +136 -0
- hackagent-0.7.0/hackagent/server/dashboard/_components.py +290 -0
- hackagent-0.7.0/hackagent/server/dashboard/_helpers.py +137 -0
- hackagent-0.7.0/hackagent/server/dashboard/_page.py +4294 -0
- hackagent-0.7.0/hackagent/server/dashboard/app.py +75 -0
- hackagent-0.7.0/hackagent/server/dashboard/templates/index.html +1288 -0
- hackagent-0.7.0/hackagent/server/errors.py +25 -0
- hackagent-0.7.0/hackagent/server/storage/__init__.py +0 -0
- hackagent-0.7.0/hackagent/server/storage/base.py +239 -0
- hackagent-0.7.0/hackagent/server/storage/local.py +718 -0
- hackagent-0.7.0/hackagent/server/storage/remote.py +869 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/types.py +8 -5
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/utils.py +21 -17
- {hackagent-0.5.0 → hackagent-0.7.0}/pyproject.toml +38 -14
- hackagent-0.5.0/hackagent/__init__.py +0 -15
- hackagent-0.5.0/hackagent/api/agent/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/apilogs/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/attack/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/checkout/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/generate/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/generate/generate_create.py +0 -254
- hackagent-0.5.0/hackagent/api/judge/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/key/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/organization/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/prompt/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/prompt/prompt_create.py +0 -172
- hackagent-0.5.0/hackagent/api/prompt/prompt_destroy.py +0 -105
- hackagent-0.5.0/hackagent/api/prompt/prompt_list.py +0 -186
- hackagent-0.5.0/hackagent/api/prompt/prompt_partial_update.py +0 -186
- hackagent-0.5.0/hackagent/api/prompt/prompt_retrieve.py +0 -164
- hackagent-0.5.0/hackagent/api/prompt/prompt_update.py +0 -186
- hackagent-0.5.0/hackagent/api/result/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/run/__init__.py +0 -4
- hackagent-0.5.0/hackagent/api/user/__init__.py +0 -4
- hackagent-0.5.0/hackagent/attacks/evaluator/metrics.py +0 -124
- hackagent-0.5.0/hackagent/attacks/techniques/baseline/generation.py +0 -269
- hackagent-0.5.0/hackagent/attacks/techniques/flipattack/attack.py +0 -242
- hackagent-0.5.0/hackagent/attacks/techniques/flipattack/config.py +0 -121
- hackagent-0.5.0/hackagent/attacks/techniques/flipattack/evaluation.py.bak +0 -285
- hackagent-0.5.0/hackagent/attacks/techniques/flipattack/flip_attack.py +0 -239
- hackagent-0.5.0/hackagent/attacks/techniques/pair/attack.py +0 -628
- hackagent-0.5.0/hackagent/cli/tui/attack_specs.py +0 -664
- hackagent-0.5.0/hackagent/models/__init__.py +0 -112
- hackagent-0.5.0/hackagent/models/agent.py +0 -224
- hackagent-0.5.0/hackagent/models/agent_request.py +0 -130
- hackagent-0.5.0/hackagent/models/api_token_log.py +0 -186
- hackagent-0.5.0/hackagent/models/attack.py +0 -156
- hackagent-0.5.0/hackagent/models/attack_request.py +0 -83
- hackagent-0.5.0/hackagent/models/checkout_session_request_request.py +0 -77
- hackagent-0.5.0/hackagent/models/checkout_session_response.py +0 -61
- hackagent-0.5.0/hackagent/models/choice.py +0 -81
- hackagent-0.5.0/hackagent/models/choice_message.py +0 -69
- hackagent-0.5.0/hackagent/models/evaluation_status_enum.py +0 -17
- hackagent-0.5.0/hackagent/models/generate_error_response.py +0 -61
- hackagent-0.5.0/hackagent/models/generate_request_request.py +0 -211
- hackagent-0.5.0/hackagent/models/generate_success_response.py +0 -115
- hackagent-0.5.0/hackagent/models/generic_error_response.py +0 -71
- hackagent-0.5.0/hackagent/models/message_request.py +0 -69
- hackagent-0.5.0/hackagent/models/organization.py +0 -104
- hackagent-0.5.0/hackagent/models/organization_minimal.py +0 -70
- hackagent-0.5.0/hackagent/models/organization_request.py +0 -72
- hackagent-0.5.0/hackagent/models/paginated_agent_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_api_token_log_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_attack_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_organization_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_prompt_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_result_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_run_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_user_api_key_list.py +0 -122
- hackagent-0.5.0/hackagent/models/paginated_user_profile_list.py +0 -122
- hackagent-0.5.0/hackagent/models/patched_agent_request.py +0 -129
- hackagent-0.5.0/hackagent/models/patched_attack_request.py +0 -93
- hackagent-0.5.0/hackagent/models/patched_organization_request.py +0 -72
- hackagent-0.5.0/hackagent/models/patched_prompt_request.py +0 -126
- hackagent-0.5.0/hackagent/models/patched_result_request.py +0 -238
- hackagent-0.5.0/hackagent/models/patched_run_request.py +0 -139
- hackagent-0.5.0/hackagent/models/patched_user_profile_request.py +0 -100
- hackagent-0.5.0/hackagent/models/prompt.py +0 -221
- hackagent-0.5.0/hackagent/models/prompt_request.py +0 -127
- hackagent-0.5.0/hackagent/models/result.py +0 -295
- hackagent-0.5.0/hackagent/models/result_list_evaluation_status.py +0 -17
- hackagent-0.5.0/hackagent/models/result_request.py +0 -233
- hackagent-0.5.0/hackagent/models/run.py +0 -234
- hackagent-0.5.0/hackagent/models/run_list_status.py +0 -15
- hackagent-0.5.0/hackagent/models/run_request.py +0 -134
- hackagent-0.5.0/hackagent/models/status_enum.py +0 -15
- hackagent-0.5.0/hackagent/models/step_type_enum.py +0 -17
- hackagent-0.5.0/hackagent/models/trace.py +0 -122
- hackagent-0.5.0/hackagent/models/trace_request.py +0 -95
- hackagent-0.5.0/hackagent/models/usage.py +0 -77
- hackagent-0.5.0/hackagent/models/user_api_key.py +0 -201
- hackagent-0.5.0/hackagent/models/user_api_key_request.py +0 -74
- hackagent-0.5.0/hackagent/models/user_profile.py +0 -136
- hackagent-0.5.0/hackagent/models/user_profile_minimal.py +0 -78
- hackagent-0.5.0/hackagent/models/user_profile_request.py +0 -100
- hackagent-0.5.0/hackagent/router/router.py +0 -1019
- {hackagent-0.5.0 → hackagent-0.7.0}/LICENSE +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/README.md +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/base.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/evaluator/pattern_evaluators.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/generator/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/generator/templates.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/objectives/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/objectives/base.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/objectives/harmful_behavior.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/objectives/jailbreak.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/objectives/policy_violation.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/shared/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/shared/response_utils.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/shared/tui.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/shared/utils.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/advprefix/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/advprefix/utils.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/baseline/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/flipattack/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/attacks/techniques/pair/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/commands/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/commands/agent.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/actions_logger.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/app.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/logger.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/views/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/widgets/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/widgets/actions.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/tui/widgets/logs.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/cli/utils.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/datasets/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/datasets/presets.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/datasets/providers/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/errors.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/craft_adversarial_data/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/craft_adversarial_data/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/craft_adversarial_data/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/craft_adversarial_data/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/credential_exposure/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/credential_exposure/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/credential_exposure/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/credential_exposure/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/excessive_agency/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/excessive_agency/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/excessive_agency/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/excessive_agency/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/input_manipulation_attack/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/input_manipulation_attack/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/input_manipulation_attack/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/input_manipulation_attack/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/jailbreak/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/jailbreak/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/jailbreak/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/jailbreak/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/malicious_tool_invocation/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/malicious_tool_invocation/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/malicious_tool_invocation/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/malicious_tool_invocation/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/misinformation/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/misinformation/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/misinformation/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/misinformation/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/model_evasion/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/model_evasion/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/model_evasion/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/model_evasion/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/profile_helpers.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/profile_types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/prompt_injection/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/prompt_injection/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/prompt_injection/templates.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/prompt_injection/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/prompt_injection/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/public_facing_application_exploitation/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/public_facing_application_exploitation/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/public_facing_application_exploitation/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/public_facing_application_exploitation/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/registry.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/sensitive_information_disclosure/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/sensitive_information_disclosure/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/sensitive_information_disclosure/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/sensitive_information_disclosure/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/system_prompt_leakage/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/system_prompt_leakage/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/system_prompt_leakage/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/system_prompt_leakage/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/utils.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/vector_embedding_weaknesses_exploit/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/vector_embedding_weaknesses_exploit/profile.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/vector_embedding_weaknesses_exploit/types.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/risks/vector_embedding_weaknesses_exploit/vulnerabilities.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/adapters/__init__.py +0 -0
- {hackagent-0.5.0 → hackagent-0.7.0}/hackagent/router/tracking/__init__.py +0 -0
- {hackagent-0.5.0/hackagent → hackagent-0.7.0/hackagent/server}/api/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hackagent
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: HackAgent is an open-source security toolkit to detect vulnerabilities of your AI Agents.
|
|
5
5
|
Author-email: AI Security Lab <ais@ai4i.it>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -15,18 +15,19 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
|
-
Requires-Dist: attrs>=21.0.0
|
|
19
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
|
|
20
22
|
Requires-Dist: litellm>=1.69.2
|
|
23
|
+
Requires-Dist: nicegui>=2.0
|
|
21
24
|
Requires-Dist: openai>=1.0.0
|
|
22
|
-
Requires-Dist: pydantic>=2.0
|
|
25
|
+
Requires-Dist: pydantic[email]>=2.0
|
|
23
26
|
Requires-Dist: python-dateutil>=2.8.0
|
|
24
27
|
Requires-Dist: pyyaml>=6.0.0
|
|
25
28
|
Requires-Dist: requests>=2.31.0
|
|
26
29
|
Requires-Dist: rich>=14.0.0
|
|
27
30
|
Requires-Dist: textual>=1.0.0
|
|
28
|
-
Provides-Extra: datasets
|
|
29
|
-
Requires-Dist: datasets>=2.14.0; extra == 'datasets'
|
|
30
31
|
Description-Content-Type: text/markdown
|
|
31
32
|
|
|
32
33
|
<div align="center">
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Copyright 2026 - AI4I. All rights reserved.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
"""A client library for accessing HackAgent API"""
|
|
5
|
+
|
|
6
|
+
from .agent import HackAgent
|
|
7
|
+
from .server.client import AuthenticatedClient, Client
|
|
8
|
+
from .logger import setup_package_logging
|
|
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
|
|
13
|
+
|
|
14
|
+
# Configure RichHandler for all hackagent.* loggers on first import.
|
|
15
|
+
setup_package_logging()
|
|
16
|
+
|
|
17
|
+
__all__ = (
|
|
18
|
+
"AgentTypeEnum",
|
|
19
|
+
"AuthenticatedClient",
|
|
20
|
+
"Client",
|
|
21
|
+
"HackAgent",
|
|
22
|
+
"LocalBackend",
|
|
23
|
+
"RemoteBackend",
|
|
24
|
+
"StorageBackend",
|
|
25
|
+
)
|
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
# Copyright 2026 - AI4I. All rights reserved.
|
|
2
2
|
# SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
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
|
|
11
|
+
from hackagent.server.storage.base import StorageBackend
|
|
12
12
|
|
|
13
13
|
# Lazy import for attack orchestrators to avoid ~0.5s startup delay
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
15
|
pass
|
|
16
16
|
|
|
17
|
-
logger =
|
|
17
|
+
logger = get_logger(__name__)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _resolve_target_config(target_config: Optional[Dict[str, Any]]) -> Dict[str, Any]:
|
|
21
|
+
"""Return normalized victim request defaults for the configured router."""
|
|
22
|
+
from hackagent.attacks.techniques.config import default_target
|
|
23
|
+
|
|
24
|
+
resolved = default_target()
|
|
25
|
+
if not target_config:
|
|
26
|
+
return resolved
|
|
27
|
+
|
|
28
|
+
merged = {key: value for key, value in target_config.items() if value is not None}
|
|
29
|
+
if "request_timeout" in merged and "timeout" not in merged:
|
|
30
|
+
merged["timeout"] = merged.pop("request_timeout")
|
|
31
|
+
|
|
32
|
+
resolved.update(merged)
|
|
33
|
+
return resolved
|
|
18
34
|
|
|
19
35
|
|
|
20
36
|
class HackAgent:
|
|
@@ -50,6 +66,7 @@ class HackAgent:
|
|
|
50
66
|
raise_on_unexpected_status: bool = False,
|
|
51
67
|
timeout: Optional[float] = None,
|
|
52
68
|
metadata: Optional[Dict[str, Any]] = None,
|
|
69
|
+
target_config: Optional[Dict[str, Any]] = None,
|
|
53
70
|
adapter_operational_config: Optional[Dict[str, Any]] = None,
|
|
54
71
|
):
|
|
55
72
|
"""
|
|
@@ -84,32 +101,70 @@ class HackAgent:
|
|
|
84
101
|
authenticated client. Defaults to `None` (which might mean a
|
|
85
102
|
default timeout from the underlying HTTP library is used).
|
|
86
103
|
metadata: Optional dictionary containing agent-specific metadata.
|
|
104
|
+
target_config: Optional default request settings for the configured
|
|
105
|
+
victim model. This is the preferred place to define target-side
|
|
106
|
+
generation defaults such as `max_tokens`, `temperature`,
|
|
107
|
+
and `timeout`.
|
|
87
108
|
adapter_operational_config: Optional configuration for the agent adapter.
|
|
88
109
|
"""
|
|
89
110
|
|
|
90
111
|
resolved_auth_token = utils.resolve_api_token(direct_api_key_param=api_key)
|
|
91
112
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
113
|
+
if resolved_auth_token:
|
|
114
|
+
from hackagent.server.client import AuthenticatedClient
|
|
115
|
+
from hackagent.server.storage.remote import RemoteBackend
|
|
95
116
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
117
|
+
_base_url = base_url or "https://api.hackagent.dev"
|
|
118
|
+
_client = AuthenticatedClient(
|
|
119
|
+
base_url=_base_url,
|
|
120
|
+
token=resolved_auth_token,
|
|
121
|
+
prefix="Bearer",
|
|
122
|
+
raise_on_unexpected_status=raise_on_unexpected_status,
|
|
123
|
+
timeout=timeout,
|
|
124
|
+
)
|
|
125
|
+
self.backend: StorageBackend = RemoteBackend(_client)
|
|
126
|
+
logger.info("HackAgent using remote backend → %s", _base_url)
|
|
127
|
+
else:
|
|
128
|
+
from hackagent.server.storage.local import LocalBackend
|
|
129
|
+
|
|
130
|
+
self.backend = LocalBackend()
|
|
131
|
+
logger.info(
|
|
132
|
+
"HackAgent using local backend → ~/.local/share/hackagent/hackagent.db"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# Keep self.client as the raw HTTP client for backward compat
|
|
136
|
+
# (adapters that need it can access it via backend.get_api_key())
|
|
137
|
+
self.client = getattr(self.backend, "_client", None)
|
|
103
138
|
|
|
104
139
|
processed_agent_type = utils.resolve_agent_type(agent_type)
|
|
140
|
+
self.target_config = _resolve_target_config(target_config)
|
|
141
|
+
explicit_target_config = (
|
|
142
|
+
{
|
|
143
|
+
key: value
|
|
144
|
+
for key, value in (target_config or {}).items()
|
|
145
|
+
if value is not None
|
|
146
|
+
}
|
|
147
|
+
if target_config
|
|
148
|
+
else {}
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
router_metadata = {
|
|
152
|
+
key: value
|
|
153
|
+
for key, value in {**(metadata or {}), **explicit_target_config}.items()
|
|
154
|
+
if value is not None
|
|
155
|
+
}
|
|
156
|
+
router_operational_config = {
|
|
157
|
+
**self.target_config,
|
|
158
|
+
**(adapter_operational_config or {}),
|
|
159
|
+
}
|
|
105
160
|
|
|
106
161
|
self.router = AgentRouter(
|
|
107
|
-
|
|
108
|
-
name=name,
|
|
162
|
+
backend=self.backend,
|
|
163
|
+
name=name or endpoint, # fall back to endpoint if no name provided
|
|
109
164
|
agent_type=processed_agent_type,
|
|
110
165
|
endpoint=endpoint,
|
|
111
|
-
metadata=
|
|
112
|
-
adapter_operational_config=
|
|
166
|
+
metadata=router_metadata,
|
|
167
|
+
adapter_operational_config=router_operational_config,
|
|
113
168
|
)
|
|
114
169
|
|
|
115
170
|
# Attack strategies are lazy-loaded to improve startup time
|
|
@@ -122,16 +177,28 @@ class HackAgent:
|
|
|
122
177
|
# Import here to avoid circular imports and improve startup time
|
|
123
178
|
from hackagent.attacks.registry import (
|
|
124
179
|
AdvPrefixOrchestrator,
|
|
180
|
+
AutoDANTurboOrchestrator,
|
|
125
181
|
BaselineOrchestrator,
|
|
182
|
+
BoNOrchestrator,
|
|
183
|
+
CipherChatOrchestrator,
|
|
184
|
+
H4rm3lOrchestrator,
|
|
185
|
+
PAPOrchestrator,
|
|
126
186
|
PAIROrchestrator,
|
|
127
187
|
FlipAttackOrchestrator,
|
|
188
|
+
TAPOrchestrator,
|
|
128
189
|
)
|
|
129
190
|
|
|
130
191
|
self._attack_strategies = {
|
|
131
192
|
"advprefix": AdvPrefixOrchestrator(hack_agent=self),
|
|
193
|
+
"autodan_turbo": AutoDANTurboOrchestrator(hack_agent=self),
|
|
132
194
|
"baseline": BaselineOrchestrator(hack_agent=self),
|
|
195
|
+
"bon": BoNOrchestrator(hack_agent=self),
|
|
196
|
+
"cipherchat": CipherChatOrchestrator(hack_agent=self),
|
|
133
197
|
"pair": PAIROrchestrator(hack_agent=self),
|
|
134
198
|
"flipattack": FlipAttackOrchestrator(hack_agent=self),
|
|
199
|
+
"tap": TAPOrchestrator(hack_agent=self),
|
|
200
|
+
"h4rm3l": H4rm3lOrchestrator(hack_agent=self),
|
|
201
|
+
"pap": PAPOrchestrator(hack_agent=self),
|
|
135
202
|
}
|
|
136
203
|
return self._attack_strategies
|
|
137
204
|
|
|
@@ -33,13 +33,21 @@ The module integrates with the HackAgent backend for result tracking and reporti
|
|
|
33
33
|
from .registry import (
|
|
34
34
|
ATTACK_REGISTRY,
|
|
35
35
|
AdvPrefixOrchestrator,
|
|
36
|
+
AutoDANTurboOrchestrator,
|
|
36
37
|
BaselineOrchestrator,
|
|
38
|
+
CipherChatOrchestrator,
|
|
37
39
|
PAIROrchestrator,
|
|
40
|
+
FlipAttackOrchestrator,
|
|
41
|
+
TAPOrchestrator,
|
|
38
42
|
)
|
|
39
43
|
|
|
40
44
|
__all__ = [
|
|
41
45
|
"ATTACK_REGISTRY",
|
|
42
46
|
"AdvPrefixOrchestrator",
|
|
47
|
+
"AutoDANTurboOrchestrator",
|
|
43
48
|
"BaselineOrchestrator",
|
|
49
|
+
"CipherChatOrchestrator",
|
|
44
50
|
"PAIROrchestrator",
|
|
51
|
+
"FlipAttackOrchestrator",
|
|
52
|
+
"TAPOrchestrator",
|
|
45
53
|
]
|
|
@@ -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
|
|
@@ -33,6 +34,10 @@ Usage:
|
|
|
33
34
|
calculate_success_rate,
|
|
34
35
|
calculate_per_goal_metrics,
|
|
35
36
|
generate_summary_report,
|
|
37
|
+
calculate_confidence_score,
|
|
38
|
+
calculate_majority_vote_asr,
|
|
39
|
+
calculate_fleiss_kappa,
|
|
40
|
+
calculate_per_judge_strictness,
|
|
36
41
|
# Server sync
|
|
37
42
|
sync_evaluation_to_server,
|
|
38
43
|
update_single_result,
|
|
@@ -44,8 +49,10 @@ from hackagent.attacks.evaluator.evaluation_step import BaseEvaluationStep
|
|
|
44
49
|
from hackagent.attacks.evaluator.judge_evaluators import (
|
|
45
50
|
EVALUATOR_MAP,
|
|
46
51
|
HarmBenchEvaluator,
|
|
52
|
+
HarmBenchVariantEvaluator,
|
|
47
53
|
JailbreakBenchEvaluator,
|
|
48
54
|
NuancedEvaluator,
|
|
55
|
+
OnTopicEvaluator,
|
|
49
56
|
)
|
|
50
57
|
from hackagent.attacks.evaluator.metrics import (
|
|
51
58
|
calculate_confidence_score,
|
|
@@ -53,6 +60,9 @@ from hackagent.attacks.evaluator.metrics import (
|
|
|
53
60
|
calculate_success_rate,
|
|
54
61
|
generate_summary_report,
|
|
55
62
|
group_by_goal,
|
|
63
|
+
calculate_majority_vote_asr,
|
|
64
|
+
calculate_fleiss_kappa,
|
|
65
|
+
calculate_per_judge_strictness,
|
|
56
66
|
)
|
|
57
67
|
from hackagent.attacks.evaluator.pattern_evaluators import (
|
|
58
68
|
KeywordEvaluator,
|
|
@@ -73,6 +83,8 @@ __all__ = [
|
|
|
73
83
|
"NuancedEvaluator",
|
|
74
84
|
"JailbreakBenchEvaluator",
|
|
75
85
|
"HarmBenchEvaluator",
|
|
86
|
+
"HarmBenchVariantEvaluator",
|
|
87
|
+
"OnTopicEvaluator",
|
|
76
88
|
"EVALUATOR_MAP",
|
|
77
89
|
# Pattern evaluators
|
|
78
90
|
"PatternEvaluator",
|
|
@@ -84,6 +96,9 @@ __all__ = [
|
|
|
84
96
|
"calculate_per_goal_metrics",
|
|
85
97
|
"generate_summary_report",
|
|
86
98
|
"group_by_goal",
|
|
99
|
+
"calculate_majority_vote_asr",
|
|
100
|
+
"calculate_fleiss_kappa",
|
|
101
|
+
"calculate_per_judge_strictness",
|
|
87
102
|
# Sync
|
|
88
103
|
"sync_evaluation_to_server",
|
|
89
104
|
"update_single_result",
|