Environment Variables
Your Google AI API key. Obtain it from Google AI Studio.
Google AI API endpoint URL. Use the default for standard Google AI access.
Optional HTTP proxy URL for network isolation (e.g.,
http://your-proxy:8080).Configuration Example
Add the following to your.env file:
Supported Models
Gemini provider offers advanced features across multiple model families:Gemini 2.5 Series (Thinking Models)
Advanced reasoning models with step-by-step analysis:- gemini-2.5-flash-thinking - Fast thinking model with extended reasoning
- gemini-2.5-pro-thinking - Advanced reasoning for complex security analysis
Gemini 2.5 Series (Standard)
High-performance models:- gemini-2.5-flash - Ultra-fast inference for real-time scanning
- gemini-2.5-pro - Flagship model for comprehensive security assessments
Gemini 2.0 Series
Next-generation experimental models:- gemini-2.0-flash-exp - Cutting-edge experimental model
- gemini-2.0-flash-thinking-exp - Experimental thinking capabilities
Gemini 1.5 Series
Proven models with large context:- gemini-1.5-flash - Fast and cost-effective
- gemini-1.5-flash-8b - Smaller, efficient variant
- gemini-1.5-pro - Powerful multimodal analysis
Features
- Thinking Capabilities: Advanced reasoning models with step-by-step analysis
- Multimodal Support: Text and image processing for comprehensive assessments
- Large Context Windows: Up to 2M tokens for analyzing extensive codebases
- Cost-Effective Options: From high-performance pro models to economical flash variants
- Real-time Performance: Ultra-fast flash models for vulnerability scanning
Context Windows
| Model Family | Context Window | Best For |
|---|---|---|
| Gemini 2.5 Pro | 2M tokens | Analyzing entire codebases and documentation |
| Gemini 2.5 Flash | 1M tokens | Large-scale security assessments |
| Gemini 1.5 Pro | 2M tokens | Comprehensive multimodal analysis |
| Gemini 1.5 Flash | 1M tokens | Cost-effective large context |
Gemini’s massive context windows make it ideal for:
- Analyzing complete application source code
- Processing extensive security documentation
- Reviewing multiple vulnerability reports simultaneously
- Comprehensive threat modeling across large systems
Model Selection by Agent Type
PentAGI automatically selects appropriate Gemini models based on requirements:| Agent Type | Recommended Model | Use Case |
|---|---|---|
| Primary Agent | gemini-2.5-pro-thinking | Core penetration testing with reasoning |
| Assistant | gemini-2.5-flash-thinking | Multi-step workflows with fast thinking |
| Generator | gemini-2.5-pro | Report and exploit generation |
| Searcher | gemini-2.5-flash | Fast information gathering |
| Coder | gemini-2.5-pro | Complex exploit development |
| Pentester | gemini-2.5-flash-thinking | Real-time penetration testing |
Advanced Configuration
Customize Gemini models using YAML configuration:Parameters
Controls randomness (0.0-2.0). Lower values make output more deterministic.
Nucleus sampling parameter (0.0-1.0). Controls diversity of output.
Top-k sampling parameter. Limits vocabulary for each step.
Maximum number of tokens to generate.
Configure safety filters. For security testing, you may need to adjust thresholds.
Pricing
Gemini offers competitive pricing with generous free tier:| Model | Free Tier | Paid Tier |
|---|---|---|
| Gemini 2.5 Flash | 15 requests/min | Higher limits |
| Gemini 2.5 Pro | 2 requests/min | Higher limits |
| Gemini 1.5 Flash | 15 requests/min | Pay per token |
| Gemini 1.5 Pro | 2 requests/min | Pay per token |
The free tier is suitable for development and small-scale testing. For production penetration testing, consider upgrading to paid tier for higher rate limits.
Vertex AI Alternative
For enterprise deployments, you can access Gemini models through Google Cloud Vertex AI:- Enhanced security with Google Cloud IAM
- VPC integration for private networking
- Enterprise SLAs and support
- Custom model tuning options
Troubleshooting
Authentication Errors
If you see authentication errors:- Verify your API key at Google AI Studio
- Ensure the API key is enabled for the Gemini API
- Check for typos in the
.envfile
Rate Limits
Google AI enforces different rate limits:- Free tier: 15 requests/min for flash models, 2 requests/min for pro models
- Paid tier: Higher limits based on quota allocation
Safety Filters Blocking Content
If legitimate security research is blocked:- Adjust safety settings in your configuration (see Advanced Configuration)
- Rephrase prompts to be more neutral
- Use thinking models which have better context understanding
Model Availability
Some models require:- Early access program enrollment for experimental models
- Specific API versions
- Geographic restrictions may apply