Skip to main content

Targets

A target represents an AI system you want to test. Scanner supports API-based models and browser-based chat UIs.

Creating a Target

  1. Navigate to Targets in the sidebar
  2. Click New Target
  3. Fill in the target configuration (see below)
  4. Click Create Target

Target Configuration Fields

FieldRequiredDescription
NameYesDisplay name for this target
Model TypeYesThe garak generator class (e.g., rest.RestGenerator)
ModelVariesModel endpoint URL or model identifier
JSON ConfigNoAdditional generator options as JSON

Common Target Templates

OpenAI (GPT models)

FieldValue
Model Typeopenai.OpenAIGenerator
Modelgpt-4o (or any OpenAI model ID)

Set OPENAI_API_KEY as a target-specific environment variable (see Environment Variables).

OpenRouter

FieldValue
Model Typeopenai.OpenAIGenerator
Modelopenai/gpt-4o
JSON Config{"api_base": "https://openrouter.ai/api/v1"}

Set OPENROUTER_API_KEY.

Anthropic (Claude via LiteLLM)

FieldValue
Model Typelitellm.LiteLLMGenerator
Modelclaude-3-5-sonnet-20241022

Set ANTHROPIC_API_KEY.

Azure OpenAI

FieldValue
Model Typeazure.AzureOpenAIGenerator
ModelYour deployment name
JSON Config{"api_base": "https://YOUR_RESOURCE.openai.azure.com/"}

Set AZURE_API_KEY.

Ollama (Local Models)

FieldValue
Model Typeollama.OllamaGenerator
Modelllama3.2 (or any Ollama model name)

No API key needed. Ollama must be accessible from within the Docker network. If running Ollama on your host machine, use http://host.docker.internal:11434 as the base URL in your JSON config.

Hugging Face Inference API

FieldValue
Model Typehuggingface.HFInferenceAPIGenerator
Modelmistralai/Mixtral-8x7B-Instruct-v0.1

Set HF_TOKEN.

Generic REST API

For any OpenAI-compatible HTTP endpoint:

FieldValue
Model Typerest.RestGenerator
Modelhttp://your-api-host/v1/chat/completions

Mock LLM (Testing)

FieldValue
Model Typerest.RestGenerator
Modelhttp://mock-llm:9292/api/v1/mock_llm/chat

The Mock LLM ships with the Docker Compose setup and requires no API keys. See Mock LLM for details on available modes.

Per-Target API Keys

Each target can have its own set of environment variables (API keys) that override any global variables with the same name. This lets you:

  • Use different API keys per target
  • Isolate credentials for different environments
  • Test the same model with different authentication contexts

To set a per-target API key:

  1. Open the target's detail page
  2. Scroll to Environment Variables
  3. Click Add Variable
  4. Set the variable name (e.g., OPENAI_API_KEY) and value

See Environment Variables for the full list of supported variable names.

Webchat Targets

Webchat targets use Playwright browser automation to interact with chat UIs that don't expose a direct API.

info

Webchat scanning requires additional Playwright setup. This feature is marked experimental in the current release.

Managing Targets

  • Edit: Click a target name to view and edit its configuration
  • Delete: Remove a target from the target detail page
  • Test connection: Not yet available — run a scan against the Mock LLM first to validate your setup
note

Target configurations (including JSON config) are encrypted at rest using per-tenant encryption keys derived from SECRET_KEY_BASE.