The idea of a secure virtual environment for running contracts is good. Moxie is simple virtual machine with 14 general-purpose registers, a stack pointer and a program counter.
Jeff Garzik has proof-of-concept moxie sandbox called moxiebox. You give it a compiled moxie ELF binary, and a file of input data. You optionally request where to receive a file of output data. The sandbox will will return with an exit code 0 on success and nonzero if there's an error.
