Policies have their own scoping and cannot be set within a function without affecting callers.
Fixes: #18215