Configuration
Configure Penelope’s behavior through agent initialization, environment variables, or programmatic configuration.
Agent Configuration
Default Model
Penelope uses Vertex AI with Gemini 2.0 Flash by default when used standalone via the SDK. Configure globally:
Environment Variables:
Programmatic:
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
Platform vs Standalone Usage: When Penelope runs as part of platform test execution (from the Test Sets page or via the SDK TestSet.execute() method), it uses the user’s configured default execution model from Model settings, or the DEFAULT_EXECUTION_MODEL environment variable as a fallback. Per-run overrides configured in the execution drawer take precedence over all defaults. The PENELOPE_DEFAULT_MODEL and PenelopeConfig settings described above apply only to standalone SDK usage.
Conversation Turns
A turn in Penelope is one complete user-assistant exchange: Penelope sends a message to the target and receives a response. Within a single turn, Penelope may also use internal analysis tools (e.g., analyze_response, extract_information), but these do not count as separate turns.
The max_turns parameter controls how many of these exchanges Penelope will complete before stopping. Default: 10.
Setting Max Turns
Environment Variable:
Programmatic (global default):
Per Agent (default for all tests run by this agent):
Per Test (overrides agent default for a specific test):
Early Stopping Behavior
Penelope uses a goal achievement metric to evaluate progress after each turn. What triggers an early stop depends on whether the test carries an evaluation contract:
- With a contract (the normal case for adversarial tests): compliance so far is never a reason
to stop — a target that hasn’t been pushed on a prohibited behavior yet only looks compliant,
it hasn’t actually held. The agent stops as soon as a violation is detected, since that’s
permanent once it happens, and otherwise runs the full
max_turns. - Without a contract (a
goalscored directly, with nocontractpassed): the agent can stop once the goal looks achieved, but only after completing 80% ofmax_turns, to make sure it doesn’t quit after only a few exchanges:- With
max_turns=10, the agent runs at least 8 turns before it can stop early - With
max_turns=20, the agent runs at least 16 turns
- With
You can override the default 80% threshold with an explicit min_turns parameter:
If min_turns exceeds max_turns, it is automatically capped to max_turns.
Choosing Max Turns: Start with 10 for simple tests. Use 15-20 for social engineering or multi-turn attack scenarios. Use 25-30 for wide-ranging exploratory testing.
Tool Execution Limit
Separately from max_turns, Penelope enforces a tool execution limit to prevent infinite loops. This counts every tool call (both target interactions and internal analysis tools). It defaults to max_turns * 5 and can be overridden:
Evaluation Contract
goal can be written from either side of an adversarial test — “get the target to leak data” and
“the target refuses to leak data” describe the same test but score opposite outcomes as a pass if
read literally. Pass contract to score compliance directly instead, with no dependency on which
direction goal was phrased:
When contract lists at least one behavior, it supersedes goal as Penelope’s own objective
and as what the goal metric scores against — see the SDK’s
GoalAchievementJudge. Without it,
behavior is unchanged: goal is scored directly.
On the Rhesis platform, this contract is derived automatically the first time a test runs — see
Evaluation Contract in the worker docs.
Standalone Penelope has no such step; pass contract yourself if you want compliance-based
scoring outside the platform.
Timeout
Set execution timeout to prevent runaway tests:
Transparency & Verbosity
Control output detail level:
Log Level
Control logging verbosity:
Environment Variable:
Programmatic: