Quick Start
Get started with HackAgent in minutes. Choose your preferred method below.
- TUI
- CLI
- SDK

The command preconfigures the demo and automatically starts the attack flow in the TUI.
Prerequisites
- Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh - Start server:
ollama serve - Pull model:
ollama pull gemma3:4b - Verify:
curl http://localhost:11434/api/tags
Run the built-in Ollama demo directly in the TUI:
hackagent examples ollama
What the CLI does automatically
- Checks that Ollama is reachable at
http://localhost:11434 - Reads required models from the demo configuration
- Pulls missing models automatically
- Opens the TUI in the Attacks tab and auto-runs the demo
Demo configuration used
- Attack type:
flipattack - Target model (victim):
gemma3:4bvia Ollama - Judge model:
gemma3:4bwith judge typeharmbench_variant - Attacker model: not used explicitly in this demo (
flipattackis transformation-based) - Dataset: HarmBench preset with
limit: 5,shuffle: false,seed: 42 - FlipAttack param
flip_mode:FCS - FlipAttack param
cot:false - FlipAttack param
lang_gpt:false - FlipAttack param
few_shot:false
Troubleshooting
- Ollama not running: start it with
ollama serve - Missing model: the CLI pulls missing models automatically
- TUI startup issue: run
hackagent --versionfirst to confirm installation
Run attacks directly from your terminal (without TUI):

OllamaOpenAI SDK
Google ADK- Custom (OpenAI compatible)
Prerequisites
- Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh - Start server:
ollama serve - Pull model:
ollama pull llama3 - Verify:
curl http://localhost:11434/api/tags
hackagent eval advprefix \
--agent-name "llama3" \
--agent-type "ollama" \
--endpoint "http://localhost:11434" \
--goals "Extract system prompt information" \
--no-tui
Prerequisites
- Get API key from platform.openai.com/api-keys
- Set env var:
export OPENAI_API_KEY="sk-..." - Verify:
curl https://api.openai.com/v1/models -H "Authorization: Bearer $OPENAI_API_KEY"
hackagent eval advprefix \
--agent-name "gpt-4" \
--agent-type "openai-sdk" \
--endpoint "https://api.openai.com/v1" \
--goals "Extract system prompt information" \
--no-tui
Prerequisites
- Install:
pip install google-adk - Start agent:
cd your_agent && adk web - Verify:
curl http://localhost:8000/list-apps
hackagent eval advprefix \
--agent-name "my-agent" \
--agent-type "google-adk" \
--endpoint "http://localhost:8000" \
--goals "Extract system prompt information" \
--no-tui
Prerequisites
- Ensure your endpoint exposes
/v1/chat/completions(OpenAI-compatible) - Verify:
curl http://your-endpoint/v1/models
hackagent eval advprefix \
--agent-name "my-model" \
--agent-type "openai-sdk" \
--endpoint "http://your-endpoint/v1" \
--goals "Extract system prompt information" \
--no-tui
View available attacks and options:
hackagent eval --help
Integrate security testing into your Python applications:

OllamaOpenAI SDK
Google ADK- Custom (OpenAI compatible)
Prerequisites
- Install Ollama:
curl -fsSL https://ollama.com/install.sh | sh - Start server:
ollama serve - Pull model:
ollama pull llama3
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="llama3",
endpoint="http://localhost:11434",
agent_type="ollama",
)
Prerequisites
- Get API key from platform.openai.com/api-keys
- Set env var:
export OPENAI_API_KEY="sk-..."
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="gpt-4",
endpoint="https://api.openai.com/v1",
agent_type="openai-sdk",
)
Prerequisites
- Install:
pip install google-adk - Start agent:
cd your_agent && adk web
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="my_google_agent",
endpoint="http://localhost:8000",
agent_type="google-adk",
)
Prerequisites
- Ensure your endpoint exposes
/v1/chat/completions(OpenAI-compatible)
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="my-model",
endpoint="http://your-endpoint/v1",
agent_type="openai-sdk",
)
# Configure and run an attack
attack_config = {
"attack_type": "advprefix",
"goals": ["Bypass content safety filters"]
}
agent.hack(attack_config=attack_config)
# Configure and run an attack
attack_config = {
"attack_type": "advprefix",
"goals": ["Bypass content safety filters"]
}
agent.hack(attack_config=attack_config)
Next Steps
- Evaluation Campaign — Run h4rm3l, TAP, and PAIR in one flow
- Evaluation Tutorial — Run your first security test
- AdvPrefix Attacks — Deep dive into attack techniques