Skip to content

Conversation

@Nitya-Choudhary
Copy link

Fixes #9391

What changed

  • Updated UserCodeService.is_execution_allowed() to respect the boolean return
    value of output_policy.is_valid().
  • Execution is now allowed only when is_valid() returns True.
  • Execution is correctly rejected when is_valid() returns False or raises
    an exception.

Why this change is needed

Previously, output_policy.is_valid() was called only for its side effects.
If it returned False, execution was still allowed, which bypassed output
policy enforcement. This fix ensures output policies are properly enforced
as intended.

Tests added

  • Added unit tests to verify execution is allowed for valid output policies.
  • Added unit tests to verify execution is rejected for invalid output policies.

Impact

  • Improves correctness and security of output policy validation.
  • No breaking changes to public APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UserCodeService.is_execution_allowed() allows invalid output policy execution

1 participant