diff --git a/packages/syft/src/syft/service/code/user_code_service.py b/packages/syft/src/syft/service/code/user_code_service.py index 5ba617ef62e..d70d2bdabca 100644 --- a/packages/syft/src/syft/service/code/user_code_service.py +++ b/packages/syft/src/syft/service/code/user_code_service.py @@ -357,7 +357,9 @@ def is_execution_allowed( return IsExecutionAllowedEnum.OUTPUT_POLICY_NONE try: - output_policy.is_valid(context) + is_valid = output_policy.is_valid(context) + if not is_valid: + return IsExecutionAllowedEnum.INVALID_OUTPUT_POLICY except Exception: return IsExecutionAllowedEnum.INVALID_OUTPUT_POLICY