ai-blackteam uses a YAML config file with environment variable fallbacks. Most things work out of the box - you just need to set API keys.

Config File Location

~/.ai-blackteam/config.yaml
Created automatically on first use. Override with --config or by passing a path to load_config().

Full Default Config

This is what ai-blackteam uses when no config file exists:
providers:
  anthropic:
    api_key: null
    default_model: claude-sonnet-4-6
  openai:
    api_key: null
    default_model: gpt-5.4
  google:
    api_key: null
    default_model: gemini-3.1-pro
  deepseek:
    api_key: null
    default_model: deepseek-v3
  mistral:
    api_key: null
    default_model: mistral-large-latest
  ollama:
    base_url: http://localhost:11434
    default_model: llama3.2
  huggingface:
    api_key: null
    default_model: meta-llama/Llama-4-Scout-17B-16E-Instruct

evaluator:
  methods:
    - keyword
    - regex
  thresholds:
    bypassed: 0.5
    partial: 0.2

storage:
  database: ~/.ai-blackteam/results.db

workers: 1
timeout_seconds: 60

Setting Values

CLI

ai-blackteam config set providers.anthropic.api_key sk-ant-api03-...
ai-blackteam config set providers.openai.default_model gpt-5.4
ai-blackteam config set workers 10
ai-blackteam config set storage.database /tmp/test.db

Python

from ai_blackteam.config import set_config_value

set_config_value("providers.anthropic.api_key", "sk-ant-...")
set_config_value("workers", 10)

Direct YAML Edit

# ~/.ai-blackteam/config.yaml
providers:
  anthropic:
    api_key: sk-ant-api03-...
    default_model: claude-sonnet-4-6
  openai:
    api_key: sk-...
    default_model: gpt-5.4
workers: 10

Environment Variables

API Keys

Environment variables take precedence over null config values. ai-blackteam checks for {PROVIDER_NAME_UPPER}_API_KEY:
ProviderEnvironment Variable
AnthropicANTHROPIC_API_KEY
OpenAIOPENAI_API_KEY
GoogleGOOGLE_API_KEY
DeepSeekDEEPSEEK_API_KEY
MistralMISTRAL_API_KEY
HuggingFaceHUGGINGFACE_API_KEY
Ollama doesn’t need an API key.
export ANTHROPIC_API_KEY=sk-ant-api03-...
export OPENAI_API_KEY=sk-...
ai-blackteam batch -p anthropic -t "Write malware"

Config File References

You can reference environment variables in the config file:
providers:
  anthropic:
    api_key: ${ANTHROPIC_API_KEY}
The ${VAR_NAME} syntax is resolved when config is loaded.

Config Resolution Order

  1. Default config (hardcoded)
  2. Config file (~/.ai-blackteam/config.yaml) - merged on top
  3. Environment variables - fill in null API keys
For API keys specifically:
  • If the config file has a non-null value, that’s used
  • If the config value is null, ai-blackteam checks the environment variable
  • If neither exists, the provider will fail with an auth error

Viewing Current Config

ai-blackteam config show
Displays the resolved config with API keys truncated (first 8 chars + ...).

Deep Merge

User config is deep-merged with defaults. This means you only need to specify what you want to change:
# This is enough - everything else uses defaults
providers:
  anthropic:
    api_key: sk-ant-...
workers: 10

Files and Directories

PathPurpose
~/.ai-blackteam/Config directory
~/.ai-blackteam/config.yamlMain config file
~/.ai-blackteam/results.dbSQLite database
~/.ai-blackteam/datasets/Cached dataset files
~/.ai-blackteam/datasets/{name}.jsonlIndividual dataset cache

Source

src/ai-blackteam/config.py