SandboxedTaskTemplate
A task template that executes the function body in a Monty sandbox. For pure Python functions (no external calls), Monty executes the entire body without pausing. For functions that call other tasks or durable operations, run_monty_async handles async dispatch.
Attributes
| Attribute | Type | Description |
|---|---|---|
| task_type | string = "sandboxed-python" | The identifier for the task execution environment, defaulting to "sandboxed-python". |
| plugin_config | Optional[[SandboxedConfig](../config/sandboxedconfig.md?sid=flyte_sandbox__config_sandboxedconfig)] = null | Configuration settings for the Monty sandbox environment, initialized to a default SandboxedConfig if not provided. |
Constructor
Signature
def SandboxedTaskTemplate(
task_type: str = "sandboxed-python",
plugin_config: Optional[[SandboxedConfig](../config/sandboxedconfig.md?sid=flyte_sandbox__config_sandboxedconfig)] = None
) -> null
Parameters
| Name | Type | Description |
|---|---|---|
| task_type | str = "sandboxed-python" | The type identifier for the task. |
| plugin_config | Optional[[SandboxedConfig](../config/sandboxedconfig.md?sid=flyte_sandbox__config_sandboxedconfig)] = None | Configuration settings for the sandboxed execution environment. |
Methods
execute()
async def execute(self, *args, **kwargs) -> Any: ...
Execute the function body in a Monty sandbox.
Parameters
| Name | Type | Description |
|---|---|---|
| args | Any | Positional arguments passed to the sandboxed function. |
| kwargs | Any | Keyword arguments passed to the sandboxed function. |
Returns
| Type | Description |
|---|---|
Any | The result of the sandboxed function execution after running pre and post hooks. |
forward()
def forward(self, *args, **kwargs) -> Any: ...
Bypass Monty and call the function directly (for local/debug execution).
Parameters
| Name | Type | Description |
|---|---|---|
| args | Any | Positional arguments passed directly to the underlying function. |
| kwargs | Any | Keyword arguments passed directly to the underlying function. |
Returns
| Type | Description |
|---|---|
Any | The direct return value of the underlying Python function. |