Humanbound website
Documentation
Local Engine

Provider Configuration

Configure the LLM provider the local engine uses for attack generation and response evaluation — bring your own API key.

The local engine needs an LLM provider for attack generation and response evaluation, and you bring your own API key. Provider settings resolve in order — CLI flags override environment variables, which override the config file at ~/.humanbound/config.yaml. Six providers are supported (OpenAI, Anthropic Claude, Google Gemini, Azure OpenAI, Grok, and Ollama for fully-local isolation); Azure requires a full endpoint URL with ?api-version=.

Configuration Methods

Provider is resolved in this order (first match wins):

  1. CLI flags (one-off override)
  2. Environment variables (CI/CD)
  3. Config file (~/.humanbound/config.yaml)

Environment Variables

export HB_PROVIDER=openai
export HB_API_KEY=sk-proj-...
export HB_MODEL=gpt-4.1        # optional for openai and ollama only (see below)

HB_MODEL (or hb config set model …) is optional only for openai (default gpt-4.1) and ollama (default llama3.1:8b). Every other provider needs an explicit model; for Azure OpenAI that is your deployment name.

Config File

hb config set provider openai
hb config set api-key sk-proj-...
hb config set model gpt-4.1

# View current config
hb config

Config is stored at ~/.humanbound/config.yaml. Never sent to Humanbound.

Environment variables and the config file don't mix

When HB_PROVIDER is set, the config file is not read at all, so an endpoint or model saved with hb config set is ignored. Set everything through environment variables, or everything through the config file.

Supported Providers

ProviderHB_PROVIDERKey prefixNotes
OpenAIopenaisk-Default model gpt-4.1. Optional HB_ENDPOINT for OpenAI-compatible APIs
Anthropicanthropic or claudesk-ant-HB_MODEL required
GooglegeminiHB_MODEL required
Azure OpenAIazureopenaiRequires HB_ENDPOINT with ?api-version=; HB_MODEL = deployment name
Grok (xAI)grokHB_MODEL required
OllamaollamaNot neededFull local isolation; default model llama3.1:8b

Azure OpenAI

Azure requires the full endpoint URL including the api-version:

export HB_PROVIDER=azureopenai
export HB_API_KEY=your-azure-key
export HB_MODEL=your-deployment   # required: the Azure deployment name
export HB_ENDPOINT="https://your-resource.openai.azure.com/openai/deployments/your-deployment/chat/completions?api-version=2025-01-01-preview"

OpenRouter and other OpenAI-compatible APIs

The openai provider accepts a base URL in HB_ENDPOINT, so any service that speaks the OpenAI chat completions API works, including OpenRouter, LiteLLM and vLLM:

export HB_PROVIDER=openai
export HB_API_KEY=sk-or-...                      # the service's key, not an OpenAI key
export HB_ENDPOINT=https://openrouter.ai/api/v1  # base URL; /chat/completions is added
export HB_MODEL=anthropic/claude-haiku-4.5       # the service's model ID

With no HB_ENDPOINT, requests go to api.openai.com as before. If you switch from Ollama to OpenAI with hb config, clear the old endpoint with hb config set endpoint "", or requests will go to the Ollama URL. An HB_ENDPOINT left in your shell does the same thing, so unset HB_ENDPOINT too.

Ollama (Full Isolation)

For zero external network calls — everything runs locally:

# Install
pip install "humanbound[engine]"

# Start ollama
ollama serve
ollama pull llama3.1:8b

# Configure
export HB_PROVIDER=ollama
export HB_MODEL=llama3.1:8b   # optional, this is the default

# Run test (only calls: your bot + local ollama)
hb test --endpoint ./config.json --scope ./scope.json --wait
Ollama quality

Local models produce lower-quality attacks and evaluations than GPT-4 or Claude. For best results, use a cloud provider. Use ollama when isolation is more important than accuracy.

After Login: Humanbound Provider

When logged in, every Humanbound account includes an LLM provider — no external API key required. Tests run on the platform automatically use it:

hb login
hb connect --endpoint ./config.json
hb test --wait
# Uses Humanbound's LLM provider — no HB_PROVIDER or HB_API_KEY needed

You can still use your own provider on the platform by adding it via hb providers create.