Skip to content

Safer script evaluation #6208

Open
Open

Description

@masenf

Summary

Implement safer script evaluation by running user-defined scripts in a well-defined, restrictive execution environment.

Proposed Changes

1. Restrictive evaluation environment

Evaluate scripts in a well-defined restrictive environment that only includes access to:

  • refs
  • Bundled libraries
  • state
  • queueEvents
  • addEvents

2. New script registration interface

Introduce a new interface for script execution: register a script snippet as a function that gets written out to utils/scripts.js. This provides a centralized, inspectable location for all registered script functions.

3. Python-side Var for the execution environment

Create a python-side Var that represents the execution environment, so that script snippets can reference names like refs or addEvents correctly and with proper type awareness.

Activity

  1. linear commented on Mar 24, 2026

    @linear
  2. added
    cloudhttps://cloud.reflex.dev/
    buildFor reporting issue occurring on reflex.build
    and removed
    cloudhttps://cloud.reflex.dev/
    buildFor reporting issue occurring on reflex.build
    on Mar 25, 2026
  3. removed
    cloudhttps://cloud.reflex.dev/
    reflex-enterpriseFor issues related to `reflex-enterprise`
    enhancementAnything you want improved
    on Oct 20, 2026
  4. added
    roadmaphttps://github.com/reflex-dev/reflex/issues/2727
    on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    roadmaphttps://github.com/reflex-dev/reflex/issues/2727

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions