Evaluating Model Vulnerabilities Across Different Providers
This tutorial guides you through assessing vulnerabilities in models from various providers using EnkryptAI’s red teaming API. We’ll cover setup and usage for OpenAI, Together, Replicate, Azure OpenAI, HuggingFace, AWS Bedrock, Google Gemini, and Anthropic Claude.Prerequisites
- Python programming basics
- Accounts with the model providers you want to test
- Python libraries: requests, os, dotenv, json
Setup
- Install required libraries:
Shell
- Set up EnkryptAI API key:
Shell
Running Red Team Tests
Use the following Python script template to run red team tests. Adjust thepayload for each provider:
Provider-Specific Configurations
Replace theendpoint_configuration in the payload with the appropriate details for each provider:
OpenAI
Python
Together
Python
Replicate
Python
Azure OpenAI
Python
HuggingFace Inference Endpoint
Python
AWS Bedrock
Python
Google Gemini
Python
Anthropic Claude
Python
- OpenAI:
export OPENAI_API_KEY="your-key" - Together:
export TOGETHER_API_KEY="your-key" - Replicate:
export REPLICATE_API_KEY="your-key" - Azure:
export AZURE_OPENAI_API_KEY="your-key" AZURE_INSTANCE="your-instance" AZURE_DEPLOYMENT_ID="your-deployment" - HuggingFace:
export HF_ENDPOINT_API_KEY="your-key" - AWS Bedrock:
export AWS_ACCESS_KEY_ID="your-key" AWS_SECRET_ACCESS_KEY="your-secret" AWS_REGION="us-east-1" - Gemini:
export GEMINI_API_KEY="your-key" - Anthropic:
export ANTHROPIC_API_KEY="your-key"

