Skip to main content

Cyberstrike is now open source! AI-powered penetration testing for security professionals. Star on GitHub

Google (Gemini)

Google’s Gemini models offer large context windows and multimodal capabilities for security analysis.

📸 SCREENSHOT: gemini-model-select.png

Gemini model selection dialog

Available Models

ModelContextBest For
gemini-2.0-flash1MFast analysis, large codebases
gemini-2.0-flash-thinking1MComplex reasoning
gemini-1.5-pro2MMaximum context
gemini-1.5-flash1MQuick tasks

Authentication

API Key Setup

  1. Get your API key from ai.google.dev
  2. Run authentication:
Terminal window
cyberstrike auth login
# Select: Google
# Enter your API key

Environment Variable

Terminal window
export GOOGLE_API_KEY="AI..."

Configuration File

~/.cyberstrike/config.json
{
"provider": {
"google": {
"options": {
"apiKey": "{env:GOOGLE_API_KEY}"
}
}
}
}

Model Configuration

Set Default Model

~/.cyberstrike/config.json
{
"model": "google/gemini-2.0-flash"
}

Command Line Override

Terminal window
cyberstrike --model google/gemini-1.5-pro

Large Context Advantage

Gemini’s 1M-2M context window enables:

  • Analyzing entire codebases at once
  • Processing multiple files simultaneously
  • Long security assessment sessions
  • Comprehensive log analysis

Example: Full Codebase Review

> Analyze the entire src/ directory for security vulnerabilities

The model can process hundreds of files in a single request.

Multimodal Capabilities

Gemini supports image analysis:

> Analyze this screenshot for security issues

Useful for:

  • Analyzing security tool output images
  • Processing network diagrams
  • Reviewing UI for security flaws

Thinking Mode

Enable thinking mode for complex analysis:

Terminal window
cyberstrike --model google/gemini-2.0-flash-thinking

Best for:

  • Complex vulnerability chains
  • Multi-step attack planning
  • Deep code analysis

Google Vertex AI

For enterprise deployments:

Setup

Terminal window
# Authenticate with Google Cloud
gcloud auth application-default login
# Set project
gcloud config set project your-project-id

Configuration

~/.cyberstrike/config.json
{
"provider": {
"google-vertex": {
"options": {
"project": "your-project-id",
"location": "us-central1"
}
}
}
}

Available Regions

RegionLocation
us-central1Iowa
us-east4Virginia
europe-west4Netherlands
asia-northeast1Tokyo

Rate Limits

Google AI Studio limits:

TierRPMTPM
Free151,000,000
Pay-as-you-go3604,000,000

Handling Limits

{
"provider": {
"google": {
"options": {
"maxRetries": 3,
"retryDelay": 1000
}
}
}
}

Safety Settings

Configure content filtering:

{
"provider": {
"google": {
"options": {
"safetySettings": [
{
"category": "HARM_CATEGORY_DANGEROUS_CONTENT",
"threshold": "BLOCK_NONE"
}
]
}
}
}
}

Caution

Adjust safety settings carefully. Some security testing content may trigger filters.

Best Practices

Model Selection

TaskRecommended Model
Quick scansgemini-2.0-flash
Large codebasegemini-1.5-pro
Complex analysisgemini-2.0-flash-thinking
High volumegemini-1.5-flash

Leveraging Large Context

  1. Include full files instead of snippets
  2. Provide complete configuration files
  3. Include related test files
  4. Add documentation for context

Cost Optimization

  1. Use Flash models for most tasks
  2. Leverage the free tier
  3. Use context efficiently
  4. Monitor usage in Google Cloud Console

Troubleshooting

Invalid API Key

Error: API key not valid

Verify:

  • Key is from ai.google.dev
  • API is enabled
  • No extra whitespace

Quota Exceeded

Error: Quota exceeded

Solutions:

  • Wait for quota reset
  • Enable billing
  • Request quota increase

Region Not Available

Error: Model not available in region

Try different regions or use Google AI Studio instead of Vertex.