Repository navigation
refactor!: replace RestrictedPython code execution with Monty - #1079
Closed
vitalii-dynamiq wants to merge 1 commit into
Closed
vitalii-dynamiq wants to merge 1 commit into
vitalii-dynamiq wants to merge 1 commit into
Conversation
vitalii-dynamiq
force-pushed
the
refactor/remove-restricted-python
branch
from
October 29, 2026 14:24
e9da527 to
157cd39
Compare
Coverage Report •
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Remove the RestrictedPython-based Python and PythonCodeExecutor nodes and the RestrictedPython dependency. RestrictedPython shares the interpreter with the code it tries to restrict, so it is not a real boundary for untrusted code. Standalone open-source dynamiq now runs Python code through PythonMonty (a separate Rust interpreter) or a remote sandbox (E2B, Daytona); the Dynamiq runtime maps the former node types onto its own OS-level sandbox when that is enabled. - PythonEvaluator is kept but reimplemented on the Monty interpreter instead of RestrictedPython, so custom evaluation metrics keep working on a real isolation boundary. - GraphOrchestrator conditional edges now accept a PythonMonty node in place of the removed Python node. - The shared PythonInputSchema stays; PythonMonty and the runtime sandbox reuse it. - Tests and examples that used the Python node as a helper move to PythonMonty, or to FunctionTool where a test needs real in-process behaviour (blocking, exact exception text) that the Monty subset does not provide. BREAKING CHANGE: dynamiq.nodes.tools.Python and dynamiq.nodes.tools.PythonCodeExecutor are removed and RestrictedPython is no longer a dependency. dynamiq.evaluations.PythonEvaluator now runs user code in the Monty interpreter, which supports a subset of Python and no third-party libraries, so a metric that relied on RestrictedPython-only behaviour must be adjusted.
vitalii-dynamiq
force-pushed
the
refactor/remove-restricted-python
branch
from
October 29, 2026 15:09
157cd39 to
1e9f30d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the RestrictedPython code-execution surface in the open-source package:
dynamiq.nodes.tools.Pythonanddynamiq.nodes.tools.PythonCodeExecutor(the RestrictedPython nodes) and theRestrictedPythondependency (pyproject.toml+uv.lock).dynamiq.evaluations.PythonEvaluatoron the Monty interpreter instead of RestrictedPython, keeping its public interface, so custom evaluation metrics keep working on a real isolation boundary.GraphOrchestratorconditional edges to accept aPythonMontynode in place of the removedPythonnode.PythonInputSchema(reused byPythonMontyand the runtime sandbox node) in a slimmednodes/tools/python.py.PythonMontyis otherwise unchanged.Why
RestrictedPython shares the interpreter with the code it tries to restrict, so it is not a real boundary for untrusted code. Open-source dynamiq now runs Python code through
PythonMonty(a separate Rust interpreter) or a remote sandbox (E2B, Daytona); on the platform, the Dynamiq runtime maps the removed node types onto its OS-level sandbox.Tests and examples
Every test and example that used the
Pythonnode as a helper is migrated:PythonMontywhere the code is a simple computation (the common case).FunctionToolwhere a test needs real in-process behaviour the Monty subset does not provide — blocking (the cancellation suites' sleeping tool) or exact exception text.The full suite passes; the only failures in a network-restricted run are pre-existing
tiktoken-download splitter tests, unrelated to this change.Breaking change
dynamiq.nodes.tools.Pythonanddynamiq.nodes.tools.PythonCodeExecutorare removed and RestrictedPython is no longer a dependency.PythonEvaluatornow runs user code in the Monty interpreter, which supports a subset of Python and no third-party libraries, so a metric that relied on RestrictedPython-only behaviour must be adjusted.