Anthropic (Claude)
Anthropicβs Claude models provide advanced reasoning capabilities for security analysis. This guide covers configuration and best practices.
πΈ SCREENSHOT: anthropic-model-select.png
Anthropic model selection dialog
Available Models
| Model | Context | Best For |
|---|---|---|
| claude-sonnet-4-20250514 | 200K | General security testing |
| claude-opus-4-5-20251101 | 200K | Complex analysis, research |
| claude-3-5-haiku-20241022 | 200K | Quick scans, high volume |
Authentication
API Key Setup
- Get your API key from console.anthropic.com
- Run the authentication command:
cyberstrike auth login# Select: Anthropic# Enter your API keyEnvironment Variable
export ANTHROPIC_API_KEY="sk-ant-api03-..."Add to your shell profile for persistence:
echo 'export ANTHROPIC_API_KEY="sk-ant-..."' >> ~/.zshrcConfiguration File
{ "provider": { "anthropic": { "options": { "apiKey": "{env:ANTHROPIC_API_KEY}" } } }}Model Configuration
Set Default Model
{ "model": "anthropic/claude-sonnet-4-20250514"}Command Line Override
cyberstrike --model anthropic/claude-opus-4-5-20251101In-Session Switching
/model# Select Claude modelExtended Thinking
Enable extended thinking for complex security analysis:
{ "provider": { "anthropic": { "options": { "thinking": { "type": "enabled", "budgetTokens": 10000 } } } }}When to Use Extended Thinking
- Complex vulnerability chains
- Multi-step attack planning
- Code review with deep analysis
- Architecture security review
Token Usage
Monitor Usage
/costDisplays:
Session Token UsageβββββββββββββββββββInput: 45,230 tokensOutput: 12,450 tokensCache: 32,100 tokens (read)Total: $0.42Prompt Caching
Anthropic supports prompt caching for repeated context:
{ "provider": { "anthropic": { "options": { "cacheControl": true } } }}Rate Limits
Anthropic applies rate limits based on your tier:
| Tier | Requests/min | Tokens/min |
|---|---|---|
| Free | 5 | 20,000 |
| Build | 50 | 80,000 |
| Scale | 1,000 | 400,000 |
Handling Rate Limits
Cyberstrike automatically handles rate limits with exponential backoff:
{ "provider": { "anthropic": { "options": { "maxRetries": 3, "retryDelay": 1000 } } }}Best Practices
Model Selection
| Task | Recommended Model |
|---|---|
| Quick recon | claude-3-5-haiku |
| Web app testing | claude-sonnet-4 |
| Complex exploits | claude-opus-4-5 |
| Code review | claude-sonnet-4 |
Cost Optimization
- Use Haiku for repetitive tasks
- Enable prompt caching
- Use
/compactfor long sessions - Limit context with focused prompts
Security
- Never commit API keys to repositories
- Use environment variables
- Rotate keys periodically
- Monitor usage on Anthropic dashboard
Troubleshooting
Invalid API Key
Error: Invalid API keyVerify your key:
- Starts with
sk-ant-api03- - No trailing whitespace
- Key is active in console
Rate Limit Exceeded
Error: Rate limit exceededSolutions:
- Wait and retry
- Upgrade your tier
- Use smaller context
Model Not Available
Error: Model not foundCheck model ID is correct and available in your region.
Tip
Use Claude Sonnet for most security testing tasks. Reserve Opus for complex analysis requiring deeper reasoning.
Related Documentation
- Providers Overview - All supported providers
- Configuration - Full configuration options
- Authentication - Setup guide