Skip to main content
Pensar Apex can be configured using environment variables. This is the recommended approach for CLI usage, CI/CD pipelines, and containerized deployments.
Environment variables always take precedence over TUI configuration stored in ~/.pensar/config.json.

AI Provider Configuration

Anthropic (Claude)

string
required
Anthropic API key for Claude models.
Get your key at console.anthropic.com.

OpenAI

string
OpenAI API key for GPT models.
Get your key at platform.openai.com/api-keys.

OpenRouter

string
OpenRouter API key for accessing multiple model providers.
Get your key at openrouter.ai.

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

These are optional enterprise features for distributed pentesting. Most users don’t need them.
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:
Or use an .env file:
.env

Configuration Priority

When multiple configuration sources are present, Pensar Apex uses this priority order (highest to lowest):
  1. Environment variables (highest priority)
  2. Command-line flags (e.g., --model)
  3. ~/.pensar/config.json (TUI settings)
  4. Default values (lowest priority)

Example

Security Best Practices

Use .gitignore to exclude environment files:
.gitignore
Use secret management in CI/CD instead of hardcoding keys.
This allows tracking usage and revoking keys per environment.
Rotate keys every 90 days or when team members leave.
For EC2, ECS, or Lambda deployments:
Attach an IAM role with bedrock:InvokeModel permission.
If you must store .env files locally:
Better: Use a secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.).

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

Verify the variable is exported:
Variables must be exported to be visible to child processes.
Ensure the variable is exported before launching the TUI:
Add exports to your shell profile:
Better: Use a secrets manager or environment manager like direnv.
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