GraalVM is several products in one installer: a JDK with the Graal JIT, Native Image, and a polyglot runtime built on Truffle. Truffle languages (JS, Python, Ruby, R, LLVM bitcode, your DSL) implement an AST interpreter with node rewriting. The Graal compiler partially evaluates that interpreter against the guest program, producing specialized machine code. Würthinger et al. described the "one VM" bet: language implementers write interpreters; the host JIT does the heavy lifting.
Polyglot is an embedding API
Context.newBuilder().allowAllAccess(false).build() is the difference between a scripting feature and a remote code execution product. Guest code can be given IO, native access, or host object bindings. Each permission you enable is an attack surface. Treat untrusted guest scripts like you treat eval on a server — usually do not.
try (Context ctx = Context.newBuilder("js")
.allowIO(false)
.build()) {
Value v = ctx.eval("js", "1 + 2");
}Values crossing the boundary are org.graalvm.polyglot.Value. Cheap for primitives; expensive if you bounce huge graphs every call. Design embeddings so hot loops stay on one side. Host interoperability (calling Java from JS) is powerful and is how people accidentally expose Runtime.getRuntime().
Native Image versus HotSpot
Truffle on Native Image (closed-world) has different limits than Truffle on HotSpot. Startup and memory can be better; peak JIT warmup on HotSpot can win for long-lived servers. Polyglot isolate options exist to separate heaps; they are not a full multi-tenant security kernel unless you also lock down the context and the process.
Do not adopt GraalVM "for polyglot" if you only needed a faster JIT. The Graal JIT can be used without embedding JS. Conversely, if the product requirement is "customers write Python hooks," Truffle Python or an external process with a tight API may both be valid; the external process has OS isolation and serialization cost.
Operational notes
Match GraalVM versions to language distributions. Polyglot engines are not infinitely thread-safe in all modes; read the context threading model. Memory accounting includes guest heaps. Debugging guest code needs Graal's inspector tooling, not only JFR.
Read the Onward! paper for why node rewriting plus PE works, then read the security section of the Polyglot reference twice. A shared VM is a performance win and a confinement problem. Name which one you bought.