Skip to content

Switch instantiate target filtering to an allowlist model for 1.4 #3258

Description

@omry

Tracking issue for the Hydra 1.4 line.

The instantiate blocklist is defense-in-depth and cannot be a complete security
boundary. For 1.4, move hydra.utils.instantiate() toward a stricter
allowlist-based model for selecting _target_ values.

Proposed direction:

  • Users declare trusted module patterns that Hydra is allowed to instantiate,
    for example:

    hydra:
      instantiate:
        allowlist:
          - my_app.*
          - sam2.*
          - hydra_plugins.*
  • The allowlist must come from trusted application code/configuration, not from
    untrusted config being instantiated.

  • Block or reject targets outside the allowlist with an actionable error.

  • Point the error to migration documentation.

  • Document how applications that consume untrusted or semi-trusted config should
    configure allowed targets.

This is expected to be a breaking change and should include migration docs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions