The essence is this: you need to allow users to execute a script on the server, such that it is impossible to harm (fill the shell, climb into the database, etc.). The script will be used to process text in messages.
Is there some kind of sandbox on PCP, on the server side?