framework.approval.ApprovalMode#

class framework.approval.ApprovalMode(value)[source]#

Bases: Enum

Enumeration of approval modes for capability-specific approval control.

Defines the available approval modes that control when human approval is required for various operations within the system. Each mode represents a different level of approval granularity, from completely disabled to requiring approval for all operations.

The modes are designed to provide flexible control over approval requirements while maintaining clear semantic meaning for each level of restriction.

Available Modes:

DISABLED: No approval required for any operations EPICS_WRITES: Approval required only for operations that write to EPICS ALL_CODE: Approval required for all code execution operations

Examples

Use in configuration:

>>> mode = ApprovalMode.EPICS_WRITES
>>> print(f"Mode value: {mode.value}")
>>> print(f"Mode name: {mode.name}")

Validate mode from string:

>>> try:
...     mode = ApprovalMode("epics_writes")
...     print(f"Valid mode: {mode}")
... except ValueError:
...     print("Invalid mode string")

Note

These modes are primarily used for Python execution approval but the pattern can be extended to other capabilities as needed.

See also

PythonExecutionApprovalConfig : Configuration class that uses this enum PythonExecutionApprovalEvaluator : Evaluator that processes these modes GlobalApprovalConfig : Global configuration that can override mode settings

DISABLED = 'disabled'#
EPICS_WRITES = 'epics_writes'#
ALL_CODE = 'all_code'#