Background processing for a rule-based system (and sideboxing)

Pointers:

IMO either use an embedded script engine (like https://github.com/rvirding/luerl), or have a separate small machine to which you delegate possibly unsafe external code.

Somebody used a pretty cheap setup to achieve something similar: How to setup an Elixir sandbox for a nerves project in 2 simple steps with Nanobox