Add apply security policy function.