Any chance you could incorporate capability based security? The concept isn't widely known, but a system based on it would offer bulletproof sandboxing, as the default permissions to do anything are none.
The use of capabilities offers a way to handle authentication without a lot of grief for accessing remote resources... the capability IS permission, so there's no need for usernames/passwords, etc.
Imagine you give a task a list of URLs (to make it simple) at startup.. that list is the ONLY set of resources it is allowed to access. No matter how confused or rogue the task gets, it can't corrupt anything else, or store trojans anywhere.