Run JavaScript you can’t quite trust.
jsrt is an open-source JavaScript host in Rust. V8 runs the script through deno_core; the host owns deny-by-default capabilities, the lifecycle and the error classification.
WHAT IT IS
A host that owns
the important parts
Deny by default
A script can only do what its manifest declares. No manifest: compute and print, and nothing else.
CapabilitiesEvery ending classified
A timeout, a thrown error and a refusal are different things. Each has its own HostError class and its own exit code.
Honest errorsA real process boundary
jsrt supervise wraps the worker in CPU, RSS, wall-clock and output budgets. Secrets are redacted and terminal escapes neutralised on forwarded output.
SupervisionThe engine is borrowed
V8 executes the script through deno_core, the crate Deno builds on. The Rust host owns the grants, the lifecycle and the error classes.
V8 inside
THE PROOF
Measured, not claimed
v1.0.0 shipped 2026-11-19 (the changelog). Its load evidence is committed next to the code: the numbers below all come from the release's own CI run —the load matrix — on a 4-core Xeon 8573C Linux runner at commit 8dc8d32.
1,000,000
of 1,000,000 refusals classified
every ungated op call in one ungranted run refused, and every refusal a named CapabilityError — nothing slipped through unclassified, in 6.7 s.
Measured by the refusal-flood scenario — the recorded run
1,000,000
requests served
every GET answered ok through rt.serve at 75,148 rps (p50 424 µs, 32 keep-alive connections); at 128 the listener saturated flat at 76,619 rps — latency queued, nothing collapsed, zero errors.
Measured by the serve and saturation scenarios — the recorded run
1,000
supervised respawns
spawn→ready→SIGTERM cycles of a serve worker, each classified exit 6 (operator-sigterm) with zero orphans — and the forwarded-output report stayed bounded by rotating a generation.
Measured by the supervise-churn scenario — the recorded run
51.5 ns
an op call
a million rt.now() calls in 74.4 ms of wall time; about 47 ns of it is the Rust-to-V8 boundary after the loop baseline.
Measured by the op-boundary scenario — the recorded run
Every way a run ends has a class and a code
- 0ok
- 2usage
- 3load
- 4syntax
- 5exception
- 6terminated
- 7capability
- 8host
The full contract, with each failure demoed live — the CLI reference
One reproducible CI environment, not production capacity — the load matrix's own honesty rule. Failed runs are kept in the same directory, not re-run to a nicer number.
HOW IT WORKS
Three parts, one contract
Declare
A manifest names the only doors a run may use: read paths, net destinations, a KV store, a serve address. Anything not declared does not exist.
Run
V8 executes the script through deno_core. Every privileged call is a Rust op that checks the grant — a refusal is a named CapabilityError, catchable by the script itself.
Bound
jsrt supervise puts the worker under CPU, RSS, wall-clock and output budgets, redacts secrets and neutralises terminal escapes — then reports how it ended as JSON.
QUICK START
Built from source, in minutes
There are no published binaries yet: v1.0.0 is built from source with the pinned toolchain (Rust 1.99.1 through rustup; the first build downloads ~95 MB of prebuilt V8).
Build it, run a script
git clone https://github.com/akira-shirase-oss/js-runtime.git
cd js-runtime
rustup toolchain install || rustup show
cargo build --release --locked -p jsrt
export PATH="$PWD/target/release:$PATH"
jsrt run hello.jshello from jsrt 1.0.0 on v8Grant it, or be refused
{
"net": ["app.example.com:443"]
}jsrt run fetch.js
jsrt: capability: CapabilityError: fetch denied: app.example.com:443
is not a declared net destinationjsrt.manifest.json beside the entry grants exactly one net destination; without it the fetch is refused before the network is asked — and the refusal names only what the script asked for. On macOS with Homebrew's cargo, first export PATH="$(brew --prefix rustup)/bin:$PATH".