Quick Start
Get started with HackAgent in minutes. Choose your preferred method below.
- TUI
- CLI
- SDK
Run attacks directly from your terminal (without TUI):

OllamaOpenAI SDK
Google ADKLiteLLM
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 attack 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 attack 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 attack advprefix \
--agent-name "my-agent" \
--agent-type "google-adk" \
--endpoint "http://localhost:8000" \
--goals "Extract system prompt information" \
--no-tui
Prerequisites
- Install:
pip install litellm[proxy] - Start proxy:
litellm --model gpt-4 --port 4000 - Verify:
curl http://localhost:4000/health
hackagent attack advprefix \
--agent-name "gpt-4" \
--agent-type "litellm" \
--endpoint "http://localhost:4000/v1" \
--goals "Extract system prompt information" \
--no-tui
More Frameworks
- 🦜 LangChain
- 🖥️ LM Studio
- ⚡ vLLM
- 🔧 Custom
Prerequisites
- Install:
pip install langserve - Start server:
python your_langserve_app.py - Verify:
curl http://localhost:8000/
hackagent attack advprefix \
--agent-name "my-langchain-agent" \
--agent-type "langchain" \
--endpoint "http://localhost:8000" \
--goals "Extract system prompt information" \
--no-tui
Prerequisites
- Download from lmstudio.ai
- Load a model in LM Studio
- Start local server: "Local Server" tab → "Start Server"
- Verify:
curl http://localhost:1234/v1/models
hackagent attack advprefix \
--agent-name "local-model" \
--agent-type "openai-sdk" \
--endpoint "http://localhost:1234/v1" \
--goals "Extract system prompt information" \
--no-tui
Prerequisites
- Install:
pip install vllm - Start server:
vllm serve meta-llama/Llama-3-8B-Instruct --port 8000 - Verify:
curl http://localhost:8000/v1/models
hackagent attack advprefix \
--agent-name "my-model" \
--agent-type "openai-sdk" \
--endpoint "http://localhost:8000/v1" \
--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 attack 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 attack --help
Integrate security testing into your Python applications:

OllamaOpenAI SDK
Google ADKLiteLLM
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
- Install:
pip install litellm[proxy] - Start proxy:
litellm --model gpt-4 --port 4000
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="gpt-4",
endpoint="http://localhost:4000/v1",
agent_type="litellm",
)
# Configure and run an attack
attack_config = {
"attack_type": "advprefix",
"goals": ["Bypass content safety filters"]
}
agent.hack(attack_config=attack_config)
More Frameworks
- 🦜 LangChain
- 🖥️ LM Studio
- ⚡ vLLM
- 🔧 Custom
Prerequisites
- Install:
pip install langserve - Start server:
python your_langserve_app.py
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="my_langchain_agent",
endpoint="http://localhost:8000",
agent_type="langchain",
)
Prerequisites
- Download from lmstudio.ai
- Load a model, then start local server from "Local Server" tab
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="local-model",
endpoint="http://localhost:1234/v1",
agent_type="openai-sdk",
)
Prerequisites
- Install:
pip install vllm - Start server:
vllm serve meta-llama/Llama-3-8B-Instruct --port 8000
from hackagent import HackAgent
# Initialize HackAgent
agent = HackAgent(
name="my-model",
endpoint="http://localhost:8000/v1",
agent_type="openai-sdk",
)
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)
Next Steps
- Attack Tutorial — Run your first security test
- AdvPrefix Attacks — Deep dive into attack techniques
