hackagent 0.6.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.
Files changed (303) hide show
  1. {hackagent-0.6.0 → hackagent-0.8.0}/.gitignore +2 -6
  2. hackagent-0.8.0/PKG-INFO +154 -0
  3. hackagent-0.8.0/README.md +122 -0
  4. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/__init__.py +8 -2
  5. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/agent.py +85 -31
  6. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/__init__.py +2 -0
  7. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/__init__.py +3 -0
  8. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/base.py +187 -37
  9. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/evaluation_step.py +498 -18
  10. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/judge_evaluators.py +65 -4
  11. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/metrics.py +109 -12
  12. hackagent-0.8.0/hackagent/attacks/evaluator/sync.py +322 -0
  13. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/orchestrator.py +318 -217
  14. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/registry.py +13 -1
  15. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/shared/router_factory.py +37 -45
  16. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/attack.py +10 -7
  17. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/completions.py +12 -12
  18. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/config.py +65 -64
  19. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/evaluation.py +27 -1
  20. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/generate.py +68 -27
  21. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/attack.py +35 -12
  22. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/config.py +102 -71
  23. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/core.py +102 -46
  24. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/dashboard_tracing.py +1 -1
  25. hackagent-0.8.0/hackagent/attacks/techniques/autodan_turbo/evaluation.py +164 -0
  26. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/lifelong.py +117 -10
  27. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/strategy_library.py +183 -27
  28. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/summarizer.py +2 -1
  29. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/warm_up.py +64 -12
  30. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/base.py +22 -3
  31. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/attack.py +39 -7
  32. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/config.py +17 -30
  33. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/evaluation.py +331 -68
  34. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/generation.py +126 -53
  35. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/attack.py +8 -5
  36. hackagent-0.8.0/hackagent/attacks/techniques/bon/config.py +121 -0
  37. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/evaluation.py +1 -1
  38. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/generation.py +30 -11
  39. hackagent-0.8.0/hackagent/attacks/techniques/cipherchat/__init__.py +12 -0
  40. hackagent-0.8.0/hackagent/attacks/techniques/cipherchat/attack.py +202 -0
  41. hackagent-0.8.0/hackagent/attacks/techniques/cipherchat/config.py +54 -0
  42. hackagent-0.8.0/hackagent/attacks/techniques/cipherchat/encode_experts.py +366 -0
  43. hackagent-0.8.0/hackagent/attacks/techniques/cipherchat/evaluation.py +108 -0
  44. hackagent-0.8.0/hackagent/attacks/techniques/cipherchat/generation.py +326 -0
  45. hackagent-0.8.0/hackagent/attacks/techniques/cipherchat/prompts_and_demonstrations.py +331 -0
  46. hackagent-0.8.0/hackagent/attacks/techniques/config.py +370 -0
  47. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/attack.py +28 -40
  48. hackagent-0.8.0/hackagent/attacks/techniques/flipattack/config.py +114 -0
  49. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/evaluation.py +1 -1
  50. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/generation.py +33 -1
  51. hackagent-0.8.0/hackagent/attacks/techniques/h4rm3l/__init__.py +15 -0
  52. hackagent-0.8.0/hackagent/attacks/techniques/h4rm3l/attack.py +224 -0
  53. hackagent-0.8.0/hackagent/attacks/techniques/h4rm3l/config.py +183 -0
  54. hackagent-0.8.0/hackagent/attacks/techniques/h4rm3l/decorators.py +1240 -0
  55. hackagent-0.8.0/hackagent/attacks/techniques/h4rm3l/evaluation.py +185 -0
  56. hackagent-0.8.0/hackagent/attacks/techniques/h4rm3l/generation.py +357 -0
  57. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pair/attack.py +451 -80
  58. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pair/config.py +56 -22
  59. hackagent-0.8.0/hackagent/attacks/techniques/pair/evaluation.py +90 -0
  60. hackagent-0.8.0/hackagent/attacks/techniques/pap/__init__.py +15 -0
  61. hackagent-0.8.0/hackagent/attacks/techniques/pap/attack.py +228 -0
  62. hackagent-0.8.0/hackagent/attacks/techniques/pap/config.py +157 -0
  63. hackagent-0.8.0/hackagent/attacks/techniques/pap/evaluation.py +105 -0
  64. hackagent-0.8.0/hackagent/attacks/techniques/pap/generation.py +626 -0
  65. hackagent-0.8.0/hackagent/attacks/techniques/pap/taxonomy.py +540 -0
  66. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/attack.py +7 -7
  67. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/config.py +14 -101
  68. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/evaluation.py +1 -1
  69. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/generation.py +80 -16
  70. hackagent-0.8.0/hackagent/cli/commands/attack.py +884 -0
  71. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/commands/config.py +8 -29
  72. hackagent-0.8.0/hackagent/cli/commands/examples.py +470 -0
  73. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/commands/results.py +67 -75
  74. hackagent-0.8.0/hackagent/cli/commands/scan.py +335 -0
  75. hackagent-0.8.0/hackagent/cli/commands/web.py +157 -0
  76. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/config.py +25 -66
  77. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/main.py +205 -179
  78. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/app.py +2 -2
  79. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/attack_specs.py +583 -13
  80. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/base.py +21 -20
  81. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/views/agents.py +46 -78
  82. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/views/attacks.py +408 -35
  83. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/views/config.py +35 -82
  84. hackagent-0.8.0/hackagent/cli/tui/views/dashboard.py +352 -0
  85. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/views/results.py +864 -422
  86. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/datasets/providers/huggingface.py +0 -22
  87. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/profile.py +18 -2
  88. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/profile_types.py +0 -1
  89. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/adapters/base.py +20 -13
  90. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/adapters/google_adk.py +4 -4
  91. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/adapters/litellm.py +13 -38
  92. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/adapters/ollama.py +18 -15
  93. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/adapters/openai.py +90 -17
  94. hackagent-0.8.0/hackagent/router/router.py +459 -0
  95. hackagent-0.8.0/hackagent/router/tracking/category_classifier.py +519 -0
  96. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/tracking/context.py +4 -4
  97. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/tracking/coordinator.py +130 -26
  98. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/tracking/step.py +35 -97
  99. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/tracking/tracker.py +143 -106
  100. hackagent-0.8.0/hackagent/server/__init__.py +0 -0
  101. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/models.py +3 -1
  102. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/scripts/generate.py +6 -16
  103. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/scripts/openapi-python-client.yaml +3 -0
  104. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/client.py +93 -77
  105. hackagent-0.8.0/hackagent/server/dashboard/__init__.py +23 -0
  106. hackagent-0.8.0/hackagent/server/dashboard/_api.py +210 -0
  107. hackagent-0.8.0/hackagent/server/dashboard/_components.py +304 -0
  108. hackagent-0.8.0/hackagent/server/dashboard/_helpers.py +137 -0
  109. hackagent-0.8.0/hackagent/server/dashboard/_page.py +6535 -0
  110. hackagent-0.8.0/hackagent/server/dashboard/app.py +75 -0
  111. hackagent-0.8.0/hackagent/server/dashboard/templates/index.html +1288 -0
  112. hackagent-0.8.0/hackagent/server/errors.py +23 -0
  113. hackagent-0.8.0/hackagent/server/storage/__init__.py +0 -0
  114. hackagent-0.8.0/hackagent/server/storage/base.py +239 -0
  115. hackagent-0.8.0/hackagent/server/storage/enums.py +34 -0
  116. hackagent-0.8.0/hackagent/server/storage/local.py +717 -0
  117. hackagent-0.8.0/hackagent/server/storage/remote.py +904 -0
  118. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/types.py +8 -5
  119. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/utils.py +30 -47
  120. {hackagent-0.6.0 → hackagent-0.8.0}/pyproject.toml +15 -16
  121. hackagent-0.6.0/PKG-INFO +0 -145
  122. hackagent-0.6.0/README.md +0 -112
  123. hackagent-0.6.0/hackagent/attacks/evaluator/sync.py +0 -210
  124. hackagent-0.6.0/hackagent/attacks/techniques/autodan_turbo/evaluation.py +0 -174
  125. hackagent-0.6.0/hackagent/attacks/techniques/bon/config.py +0 -227
  126. hackagent-0.6.0/hackagent/attacks/techniques/flipattack/config.py +0 -203
  127. hackagent-0.6.0/hackagent/cli/commands/attack.py +0 -425
  128. hackagent-0.6.0/hackagent/cli/tui/views/dashboard.py +0 -322
  129. hackagent-0.6.0/hackagent/router/router.py +0 -1035
  130. {hackagent-0.6.0 → hackagent-0.8.0}/LICENSE +0 -0
  131. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/base.py +0 -0
  132. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/evaluator/pattern_evaluators.py +0 -0
  133. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/generator/__init__.py +0 -0
  134. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/generator/templates.py +0 -0
  135. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/objectives/__init__.py +0 -0
  136. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/objectives/base.py +0 -0
  137. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/objectives/harmful_behavior.py +0 -0
  138. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/objectives/jailbreak.py +0 -0
  139. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/objectives/policy_violation.py +0 -0
  140. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/shared/__init__.py +0 -0
  141. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/shared/progress.py +0 -0
  142. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/shared/prompt_parser.py +0 -0
  143. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/shared/response_utils.py +0 -0
  144. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/shared/tui.py +0 -0
  145. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/shared/utils.py +0 -0
  146. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/__init__.py +0 -0
  147. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/__init__.py +0 -0
  148. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/advprefix/utils.py +0 -0
  149. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/__init__.py +0 -0
  150. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/autodan_turbo/log_styles.py +0 -0
  151. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/baseline/__init__.py +0 -0
  152. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/bon/__init__.py +0 -0
  153. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/flipattack/__init__.py +0 -0
  154. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/pair/__init__.py +0 -0
  155. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/attacks/techniques/tap/__init__.py +0 -0
  156. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/__init__.py +0 -0
  157. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/commands/__init__.py +0 -0
  158. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/commands/agent.py +0 -0
  159. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/__init__.py +0 -0
  160. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/actions_logger.py +0 -0
  161. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/logger.py +0 -0
  162. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/views/__init__.py +0 -0
  163. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/widgets/__init__.py +0 -0
  164. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/widgets/actions.py +0 -0
  165. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/tui/widgets/logs.py +0 -0
  166. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/cli/utils.py +0 -0
  167. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/datasets/__init__.py +0 -0
  168. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/datasets/base.py +0 -0
  169. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/datasets/presets.py +0 -0
  170. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/datasets/providers/__init__.py +0 -0
  171. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/datasets/providers/file.py +0 -0
  172. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/datasets/registry.py +0 -0
  173. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/errors.py +0 -0
  174. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/logger.py +0 -0
  175. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/__init__.py +0 -0
  176. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/base.py +0 -0
  177. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/__init__.py +0 -0
  178. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/profile.py +0 -0
  179. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/types.py +0 -0
  180. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/craft_adversarial_data/vulnerabilities.py +0 -0
  181. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/__init__.py +0 -0
  182. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/profile.py +0 -0
  183. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/types.py +0 -0
  184. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/credential_exposure/vulnerabilities.py +0 -0
  185. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/__init__.py +0 -0
  186. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/profile.py +0 -0
  187. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/types.py +0 -0
  188. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/excessive_agency/vulnerabilities.py +0 -0
  189. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/__init__.py +0 -0
  190. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/profile.py +0 -0
  191. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/types.py +0 -0
  192. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/input_manipulation_attack/vulnerabilities.py +0 -0
  193. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/__init__.py +0 -0
  194. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/types.py +0 -0
  195. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/jailbreak/vulnerabilities.py +0 -0
  196. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/__init__.py +0 -0
  197. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/profile.py +0 -0
  198. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/types.py +0 -0
  199. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/malicious_tool_invocation/vulnerabilities.py +0 -0
  200. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/misinformation/__init__.py +0 -0
  201. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/misinformation/profile.py +0 -0
  202. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/misinformation/types.py +0 -0
  203. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/misinformation/vulnerabilities.py +0 -0
  204. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/__init__.py +0 -0
  205. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/profile.py +0 -0
  206. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/types.py +0 -0
  207. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/model_evasion/vulnerabilities.py +0 -0
  208. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/profile_helpers.py +0 -0
  209. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/__init__.py +0 -0
  210. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/profile.py +0 -0
  211. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/templates.py +0 -0
  212. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/types.py +0 -0
  213. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/prompt_injection/vulnerabilities.py +0 -0
  214. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/__init__.py +0 -0
  215. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/profile.py +0 -0
  216. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/types.py +0 -0
  217. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/public_facing_application_exploitation/vulnerabilities.py +0 -0
  218. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/registry.py +0 -0
  219. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/__init__.py +0 -0
  220. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/profile.py +0 -0
  221. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/types.py +0 -0
  222. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/sensitive_information_disclosure/vulnerabilities.py +0 -0
  223. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/__init__.py +0 -0
  224. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/profile.py +0 -0
  225. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/types.py +0 -0
  226. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/system_prompt_leakage/vulnerabilities.py +0 -0
  227. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/utils.py +0 -0
  228. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/__init__.py +0 -0
  229. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/profile.py +0 -0
  230. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/types.py +0 -0
  231. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/risks/vector_embedding_weaknesses_exploit/vulnerabilities.py +0 -0
  232. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/__init__.py +0 -0
  233. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/adapters/__init__.py +0 -0
  234. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/tracking/__init__.py +0 -0
  235. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/tracking/decorators.py +0 -0
  236. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/tracking/utils.py +0 -0
  237. {hackagent-0.6.0 → hackagent-0.8.0}/hackagent/router/types.py +0 -0
  238. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/__init__.py +0 -0
  239. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/agent/__init__.py +0 -0
  240. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/agent/agent_create.py +0 -0
  241. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/agent/agent_destroy.py +0 -0
  242. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/agent/agent_list.py +0 -0
  243. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/agent/agent_partial_update.py +0 -0
  244. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/agent/agent_retrieve.py +0 -0
  245. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/agent/agent_update.py +0 -0
  246. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/apilogs/__init__.py +0 -0
  247. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/apilogs/apilogs_list.py +0 -0
  248. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/apilogs/apilogs_retrieve.py +0 -0
  249. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/apilogs/apilogs_summary_retrieve.py +0 -0
  250. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/attack/__init__.py +0 -0
  251. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/attack/attack_create.py +0 -0
  252. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/attack/attack_destroy.py +0 -0
  253. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/attack/attack_list.py +0 -0
  254. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/attack/attack_partial_update.py +0 -0
  255. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/attack/attack_retrieve.py +0 -0
  256. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/attack/attack_update.py +0 -0
  257. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/checkout/__init__.py +0 -0
  258. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/checkout/checkout_create.py +0 -0
  259. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/generate/__init__.py +0 -0
  260. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/generate/v1_chat_completions_create.py +0 -0
  261. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/judge/__init__.py +0 -0
  262. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/judge/judge_create.py +0 -0
  263. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/key/__init__.py +0 -0
  264. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/key/key_context_retrieve.py +0 -0
  265. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/key/key_create.py +0 -0
  266. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/key/key_destroy.py +0 -0
  267. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/key/key_list.py +0 -0
  268. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/key/key_retrieve.py +0 -0
  269. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/__init__.py +0 -0
  270. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/organization_create.py +0 -0
  271. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/organization_destroy.py +0 -0
  272. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/organization_list.py +0 -0
  273. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/organization_me_retrieve.py +0 -0
  274. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/organization_partial_update.py +0 -0
  275. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/organization_retrieve.py +0 -0
  276. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/organization/organization_update.py +0 -0
  277. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/__init__.py +0 -0
  278. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/result_create.py +0 -0
  279. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/result_destroy.py +0 -0
  280. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/result_list.py +0 -0
  281. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/result_partial_update.py +0 -0
  282. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/result_retrieve.py +0 -0
  283. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/result_trace_create.py +0 -0
  284. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/result/result_update.py +0 -0
  285. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/__init__.py +0 -0
  286. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_create.py +0 -0
  287. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_destroy.py +0 -0
  288. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_list.py +0 -0
  289. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_partial_update.py +0 -0
  290. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_result_create.py +0 -0
  291. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_retrieve.py +0 -0
  292. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_run_tests_create.py +0 -0
  293. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/run/run_update.py +0 -0
  294. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/scripts/generate.sh +0 -0
  295. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/__init__.py +0 -0
  296. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/user_create.py +0 -0
  297. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/user_destroy.py +0 -0
  298. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/user_list.py +0 -0
  299. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/user_me_retrieve.py +0 -0
  300. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/user_me_update.py +0 -0
  301. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/user_partial_update.py +0 -0
  302. {hackagent-0.6.0/hackagent → hackagent-0.8.0/hackagent/server}/api/user/user_retrieve.py +0 -0
  303. {hackagent-0.6.0/hackagent → hackagent-0.8.0/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
- db_index/
138
- # BoN reference codebase (cloned repo, not imported)
139
- hackagent/attacks/techniques/bon/original_codebase/
140
-
141
- ATTACK_INTEGRATION_HANDOUT.md
136
+ .copilotignore
137
+ tests/e2e/attacks/
@@ -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
+ ![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)
47
+ ![License](https://img.shields.io/badge/license-Apache%202.0-green)
48
+ ![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)
49
+ [![Commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
50
+ ![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)
51
+ ![Test Coverage](https://img.shields.io/codecov/c/github/AISecurityLab/hackagent)
52
+ ![CI Status](https://img.shields.io/github/actions/workflow/status/AISecurityLab/hackagent/ci.yml)
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
+ [![Google ADK](https://img.shields.io/badge/Google-ADK-green?style=for-the-badge&logo=google)](https://google.github.io/adk-docs/)
107
+ [![OpenAI SDK](https://img.shields.io/badge/OpenAI-SDK-412991?style=for-the-badge&logo=openai)](https://platform.openai.com/docs)
108
+ [![LiteLLM](https://img.shields.io/badge/LiteLLM-blue?style=for-the-badge&logo=github)](https://github.com/BerriAI/litellm)
109
+ [![LangChain](https://img.shields.io/badge/LangChain-1C3C3C?style=for-the-badge)](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
+ ![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)
15
+ ![License](https://img.shields.io/badge/license-Apache%202.0-green)
16
+ ![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)
17
+ [![Commitizen](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
18
+ ![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)
19
+ ![Test Coverage](https://img.shields.io/codecov/c/github/AISecurityLab/hackagent)
20
+ ![CI Status](https://img.shields.io/github/actions/workflow/status/AISecurityLab/hackagent/ci.yml)
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
+ [![Google ADK](https://img.shields.io/badge/Google-ADK-green?style=for-the-badge&logo=google)](https://google.github.io/adk-docs/)
75
+ [![OpenAI SDK](https://img.shields.io/badge/OpenAI-SDK-412991?style=for-the-badge&logo=openai)](https://platform.openai.com/docs)
76
+ [![LiteLLM](https://img.shields.io/badge/LiteLLM-blue?style=for-the-badge&logo=github)](https://github.com/BerriAI/litellm)
77
+ [![LangChain](https://img.shields.io/badge/LangChain-1C3C3C?style=for-the-badge)](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 accessing HackAgent API"""
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 API authentication, agent registration
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 authenticated API client, loads default
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
- # Use default base_url if not provided
93
- if base_url is None:
94
- base_url = "https://api.hackagent.dev"
107
+ if resolved_auth_token:
108
+ from hackagent.server.client import AuthenticatedClient
109
+ from hackagent.server.storage.remote import RemoteBackend
95
110
 
96
- self.client = AuthenticatedClient(
97
- base_url=base_url,
98
- token=resolved_auth_token,
99
- prefix="Bearer",
100
- raise_on_unexpected_status=raise_on_unexpected_status,
101
- timeout=timeout,
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
- client=self.client,
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=metadata,
112
- adapter_operational_config=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(hack_agent=self),
135
- "autodan_turbo": AutoDANTurboOrchestrator(hack_agent=self),
136
- "baseline": BaselineOrchestrator(hack_agent=self),
137
- "bon": BoNOrchestrator(hack_agent=self),
138
- "pair": PAIROrchestrator(hack_agent=self),
139
- "flipattack": FlipAttackOrchestrator(hack_agent=self),
140
- "tap": TAPOrchestrator(hack_agent=self),
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 API interaction, problems with backend
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