Skip to Content
PenelopeConfiguration

Configuration

Configure Penelope’s behavior through agent initialization, environment variables, or programmatic configuration.

Agent Configuration

agent_config.py
from rhesis.sdk.models import AnthropicLLM
from rhesis.penelope import PenelopeAgent

agent = PenelopeAgent(
    # Optional: Model (defaults to Vertex AI / gemini-2.0-flash)
    model=AnthropicLLM(),
    # Optional: Stopping conditions
    max_iterations=20,  # Defaults to 10
    timeout_seconds=300,  # No timeout by default
    # Observability
    enable_transparency=True,
    verbose=True,
    # Optional: Custom tools
    tools=[],
)

Default Model

Penelope uses Vertex AI with Gemini 2.0 Flash by default. Configure globally:

Environment Variables:

Terminal
export PENELOPE_DEFAULT_MODEL=anthropic
export PENELOPE_DEFAULT_MODEL_NAME=claude-4

Programmatic:

config.py
from rhesis.penelope import PenelopeConfig

PenelopeConfig.set_default_model("anthropic", "claude-4")

# Now all agents use this default
agent = PenelopeAgent()  # Uses anthropic/claude-4

Supported Providers

Penelope works with any Rhesis SDK model:

  • vertex_ai - Google Vertex AI (Gemini models)
  • anthropic - Anthropic (Claude models)
  • openai - OpenAI (GPT models)
  • openai_compatible - Any OpenAI-compatible API
different_models.py
from rhesis.sdk.models import VertexAILLM, AnthropicLLM, OpenAILLM

# Vertex AI
agent = PenelopeAgent(model=VertexAILLM(model_name="gemini-pro"))

# Anthropic
agent = PenelopeAgent(model=AnthropicLLM(model_name="claude-4"))

# OpenAI
agent = PenelopeAgent(model=OpenAILLM(model_name="gpt-4"))

Max Iterations

Default: 10. Configure globally or per-agent:

Environment Variable:

Terminal
export PENELOPE_DEFAULT_MAX_ITERATIONS=20

Programmatic:

config.py
from rhesis.penelope import PenelopeConfig

PenelopeConfig.set_default_max_iterations(20)
agent = PenelopeAgent()  # Uses 20

Per Agent:

agent.py
agent = PenelopeAgent(max_iterations=30)  # Overrides defaults

Choosing Max Iterations: Start with 10 for simple tests. Increase to 20-30 for complex multi-turn scenarios or exploratory testing.

Timeout

Set execution timeout to prevent runaway tests:

timeout.py
agent = PenelopeAgent(
    timeout_seconds=300,  # 5 minutes
    max_iterations=50,
)

result = agent.execute_test(
    target=target,
    goal="Complex long-running test",
)

# result.status will be 'timeout' if time limit exceeded

Transparency & Verbosity

Control output detail level:

output_control.py
# Full transparency - see all reasoning
agent = PenelopeAgent(
    enable_transparency=True,  # Show reasoning boxes
    verbose=True,  # Print all details
)

# Quiet mode - minimal output
agent = PenelopeAgent(
    enable_transparency=False,
    verbose=False,
)

# Results only - no execution details
agent = PenelopeAgent(verbose=False)

Test-Level Configuration

Override settings per test:

test_config.py
# Different max_turns for specific test
result = agent.execute_test(
    target=target,
    goal="Short simple test",
    max_turns=5,  # Override agent's max_iterations for this test
)

Log Level

Control logging verbosity:

Environment Variable:

Terminal
export PENELOPE_LOG_LEVEL=DEBUG  # DEBUG, INFO, WARNING, ERROR, CRITICAL

Programmatic:

logging.py
from rhesis.penelope import PenelopeConfig

PenelopeConfig.set_log_level("DEBUG")  # Shows all logs including external libraries
PenelopeConfig.set_log_level("INFO")  # Standard logging (default)
PenelopeConfig.set_log_level("WARNING")  # Only warnings and errors

Complete Configuration Example

complete_config.py
from rhesis.sdk.models import AnthropicLLM
from rhesis.penelope import PenelopeAgent, PenelopeConfig

# Global defaults
PenelopeConfig.set_default_model("anthropic", "claude-4")
PenelopeConfig.set_default_max_iterations(20)
PenelopeConfig.set_log_level("INFO")

# Agent with custom config
agent = PenelopeAgent(
    model=AnthropicLLM(model_name="claude-4"),
    max_iterations=30,
    timeout_seconds=600,
    enable_transparency=True,
    verbose=True,
    tools=[],  # Add custom tools here
)

# Execute test
result = agent.execute_test(
    target=target,
    goal="Comprehensive test",
    instructions="Detailed instructions...",
    context={"environment": "staging"},
    max_turns=25,  # Test-specific override
)

Next: Learn how to Extend Penelope with custom tools and architecture details, or explore Examples for practical use cases.