title: Java - "safe" scripting
body: <p>Does anyone know of any scripting for the Java platform that can be forcefully restricted to a provided function set (preferably absolutely no functions unless provided)?  I've experimented with several JSR223 compatible languages, but have been able to compromise security in all cases.</p>
  
  <p>What my system currently does:</p>
  
  <ol>
  <li>Load the requested script from the filesystem.</li>
  <li>Create a context to run the script with</li>
  <li>Run the script in the new context</li>
  </ol>
  
  <p>Even if a security manager is properly configured, what would stop malicious script content from accessing (or worse -- mutating) fields from objects that it otherwise shouldn't have access to?  This could potentially cause a bit of damage if a mistake is made or if a script is intentionally tailored for malicious behavior.</p>