Skip to main content

Scan

hackagent scan <url> red-teams a website's chatbot widget through a real browser — it drives the live page, typing each prompt into the chat widget and reading the reply from the page. Because it works at the DOM level, it works against any chat UI regardless of transport (WebSocket, SSE, plain HTTP).

Usage

hackagent scan https://www.example.com
hackagent scan https://www.example.com --plan
hackagent scan https://www.example.com --headed --input-selector 'textarea'
hackagent scan https://www.example.com --config-file goals.yaml --no-tui
hackagent scan https://www.example.com --no-attack --json

Options

OptionDefaultDescription
--headedFalseShow the browser window instead of running headless
--input-selectorCSS selector pinning the chat input box, if heuristics can't find it
--reply-selectorCSS selector pinning the bot's reply element, skipping the DOM-diff heuristic
--open-selectorCSS selector for a collapsed chat-launcher bubble to click first
--accept-cookies / --no-accept-cookiesTrueAccept/dismiss a cookie-consent banner on load
--llm-fallback-modelLiteLLM model used to read the reply from the page only when DOM heuristics find nothing
--install-browser / --no-install-browserTrueAuto-download Chromium (~150 MB, one-time) if missing
--timeout45Page-load timeout in seconds
--jsonFalsePrint the target config (and plan, if any) as JSON and exit
--planFalseAgentic mode: an LLM inspects the target and chooses the attack strategy and parameters
--planner-modelollama_chat/huihui_ai/gemma-4-abliterated:12bLiteLLM model for the --plan planner (defaults to a local Ollama model, no API key needed)
--attack / --no-attackTrueRed-team the target; --no-attack just shows the resolved config
--config-fileYAML/JSON file supplying goals: plus optional attacker, judge, category_classifier, parameters, attack_type
--goalsAttack goals; repeat --goals or pass a comma-separated string
--attack-typepairAttack strategy (tap, pair, flipattack, advprefix, …); ignored when --plan picks one
--attacker-modelOverride the attacker LLM with any LiteLLM model id (e.g. openai/gpt-4o-mini)
--judge-modelOverride the judge/scorer LLM with any LiteLLM model id
--attack-timeout300Attack timeout in seconds
--no-tuiFalseRun the attack headless instead of opening the TUI
--dry-runFalseValidate the wiring without executing (implies --no-tui)

See Also

  • Attack — Run attacks via the SDK-driven eval commands (for agents you already control programmatically)
  • Agents: Guardrails — Add before/after guardrails to any attack