Currently all the security checks run in the main thread. Would be preferable to have an async executor so that, in case of long-running tasks, the main thread does not get blocked.