1. A computer-implemented method, comprising: executing a first piece of code of a thread of a sandboxed application that is written to a secured memory, wherein code of the sandboxed application comprises untrusted code that has been previously validated; receiving, as a result of executing the first piece of code, a request from the thread of the sandboxed application to dynamically insert a new piece of code into the untrusted code of the sandboxed application during runtime; and in response to receiving the request: writing the new piece of code to a portion of the secured memory that cannot be executed by the sandboxed application; validating the new piece of code; and in response to a successful validation, writing the validated piece of code to a portion of the secured memory that can be executed by the sandboxed application.