API Reference — Probes¶
probes
¶
Probe factories.
Probes test for the presence of desired behavior. When the evaluator detects the expected behavior, the result is SAFE.
Probes
¶
Factory methods for probe test executions.
behavior
staticmethod
¶
behavior(
*,
prompt: str,
evaluator: Evaluator,
max_turns: int = 25,
event_handlers: list[ExecutionEventHandler]
| None = None,
) -> BaseExecution
behavior(
*,
prompts: list[str],
evaluator: Evaluator,
max_turns: int = 25,
event_handlers: list[ExecutionEventHandler]
| None = None,
) -> BaseExecution
behavior(
*,
driver: PromptDriver,
evaluator: Evaluator,
max_turns: int = 25,
event_handlers: list[ExecutionEventHandler]
| None = None,
) -> BaseExecution
behavior(
*,
prompt=None,
prompts=None,
driver=None,
evaluator,
max_turns=25,
event_handlers=None,
)
Probe whether the agent exhibits desired behavior.
Exactly one of prompt, prompts, or driver must be
provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prompt
|
str | None
|
A single prompt string. |
None
|
prompts
|
list[str] | None
|
A list of prompt strings. |
None
|
driver
|
PromptDriver | None
|
A pre-built prompt driver. |
None
|
evaluator
|
Evaluator
|
What behavior to check for. |
required |
max_turns
|
int
|
Maximum prompt-response exchanges before returning ERROR. Defaults to 25. |
25
|
event_handlers
|
list[ExecutionEventHandler] | None
|
Optional additional handlers. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
BaseExecution |
BaseExecution
|
Ready to execute with execute_async(adapter=...). |
Raises:
| Type | Description |
|---|---|
ValueError
|
If more than one or none of |
Source code in rampart/probes/__init__.py
SingleTurnExecution
¶
Bases: BaseExecution
Executes a probe: send prompts, evaluate, resolve as probe.
Inherits BaseExecution. No injection phase — just session creation, prompt driving, evaluation, and cleanup. The lifecycle skeleton (including InfrastructureError handling) is owned by BaseExecution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
driver
|
PromptDriver
|
How to drive the conversation. |
required |
evaluator
|
Evaluator
|
What behavior to check for. |
required |
max_turns
|
int
|
Maximum prompt-response exchanges before returning ERROR. Defaults to 25. |
25
|
event_handlers
|
list[ExecutionEventHandler] | None
|
Additional handlers beyond the framework defaults. |
None
|
Source code in rampart/probes/_single_turn.py
| Python | |
|---|---|
strategy_name
property
¶
Identifies this as a probe execution in results and reports.