Environment variables always take precedence over TUI configuration stored in
~/.pensar/config.json.AI Provider Configuration
Anthropic (Claude)
string
required
OpenAI
string
OpenRouter
string
AWS Bedrock
Bearer Token Authentication
string
Bearer token for Bedrock API access.
IAM Credentials Authentication
string
AWS access key ID for IAM authentication.
string
AWS secret access key for IAM authentication.
string
AWS session token for temporary credentials (optional).Required only when using temporary credentials from AWS STS.
string
default:"us-east-1"
AWS region for Bedrock API.Common regions:
us-east-1, us-west-2, eu-west-1.Local Models (vLLM)
string
vLLM server endpoint URL.Must point to an OpenAI-compatible API endpoint.
Remote Execution Providers
string
Daytona API key for remote agent execution.
string
Daytona organization ID.
string
Runloop API key for remote execution.
Debugging and Development
string
default:"false"
Enable debug logging.Outputs detailed agent execution logs to console.
string
default:"false"
Show console output in TUI development mode.Used only for TUI development.
CI/CD Configuration
GitHub Actions
Store API keys as repository secrets:.github/workflows/pentest.yml
GitLab CI
.gitlab-ci.yml
Docker
Pass environment variables to the container:.env file:
.env
Configuration Priority
When multiple configuration sources are present, Pensar Apex uses this priority order (highest to lowest):- Environment variables (highest priority)
- Command-line flags (e.g.,
--model) ~/.pensar/config.json(TUI settings)- Default values (lowest priority)
Example
Security Best Practices
Never commit API keys to version control
Never commit API keys to version control
Use Use secret management in CI/CD instead of hardcoding keys.
.gitignore to exclude environment files:.gitignore
Use separate keys for different environments
Use separate keys for different environments
Rotate API keys regularly
Rotate API keys regularly
Use IAM roles instead of static credentials (AWS)
Use IAM roles instead of static credentials (AWS)
For EC2, ECS, or Lambda deployments:Attach an IAM role with
bedrock:InvokeModel permission.Encrypt environment files
Encrypt environment files
If you must store Better: Use a secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.).
.env files locally:Common Patterns
Per-Project Configuration
Create a.env file per project:
my-project/.env
Multi-Provider Setup
Configure all providers for fallback:Testing with Different Models
Environment Variable Files
Loading with source
Loading with dotenv (Node.js)
For programmatic usage:
Troubleshooting
Environment variable not recognized
Environment variable not recognized
Verify the variable is exported:Variables must be
exported to be visible to child processes.API key works in shell but not in TUI
API key works in shell but not in TUI
Ensure the variable is exported before launching the TUI:
Variables not persisting across sessions
Variables not persisting across sessions
Add exports to your shell profile:Better: Use a secrets manager or environment manager like
direnv.AWS credentials not working
AWS credentials not working
For IAM credentials, verify all required variables:If AWS CLI works but Pensar doesn’t, check that credentials have
bedrock:InvokeModel permission.Quick Reference
*At least one AI provider key is required.
Next Steps
AI Providers
Learn about each supported provider
Model Selection
Choose the right model for your needs
Docker Setup
Use environment variables in containers
Run Pentest
Start testing with your configuration

