ende grants

Ende 2026.12.01

ende grants is new in this release.

ende grants reports on the module graph of the entry modules you give it: which dependencies run sandboxed, what each one may do, and whether the lockfile pins their code. It only reports. ende run and the other commands that run code are what enforce the rules.

A dependency runs sandboxed when a rule in the isolate key of ende.json matches it. The report also lists the extensions declared in ende.json, and whether the lockfile records what ende.json grants each rule and extension. Per-package permissions explains isolate rules, and Extensions explains extensions; this page covers the command.

Usage

ende grants [OPTIONS] <FILES>...

At least one entry module is required. With none, ende grants exits with code 2:

$ ende grants
error: ende grants needs <FILES>.
  Usage: ende grants [OPTIONS] <FILES>...
  Example: ende grants main.ts
  See `ende grants --help` for the options.

Examples

Show what each sandboxed dependency may do:

ende grants main.ts

Judge the rules with the flags you run with:

ende grants --allow-net main.ts

Print the report as JSON:

ende grants --json main.ts

Pass the same permission flags as ende run

What a sandbox ends up with depends on the permissions the app runs with, so ende grants judges each rule with the permission flags you pass to it. Pass the same ones you pass to ende run, or the report describes a different run.

Reading the report

The report has one entry for each JSR package version, each URL or folder rule, each origin of other remote modules, and one for the app's own code. For an app whose ende.json sandboxes a local folder:

ende.json
{
  "isolate": {
    "./vendor/tool/": { "permissions": { "read": ["./data"] } }
  }
}

the report, run with no permission flags, is:

$ ende grants main.ts
./vendor/tool/
  sandboxed:    yes
  matcher:      "./vendor/tool/"
  granted:      {"read":["./data"]}
  requested:    —
  effective:    none
  lockfile:     local (no content pin)
  approval:     not recorded

local modules (the app)
  sandboxed:    no, runs in the app
  matcher:      —
  granted:      —
  requested:    —
  effective:    the app's: import: jsr.io:443, esm.sh:443, raw.esm.sh:443, cdn.jsdelivr.net:443, raw.githubusercontent.com:443, gist.githubusercontent.com:443 (+ prompts)
  lockfile:     local (no content pin)

Approval is judged with the permission flags passed to this command: pass the same ones as `ende run`.

The sandbox's effective permissions are none because the app was given no --allow-read. Run with --allow-read, the same entry shows read access to the data folder.

Each entry has these lines:

Line Meaning
sandboxed yes when an isolate rule matches this code; otherwise it runs in the app.
matcher The isolate rule that matched.
granted The permissions that rule grants in ende.json.
requested The permissions the sandboxed code's own manifests declare, if any.
effective What the code may do in this run, given the rule and your permission flags. (+ prompts) means it may ask.
nested in For a sandbox that another rule's sandbox also imports: what it gets there.
can escape Granted permissions that can get around Ende's checks: a subprocess or native code.
process-wide Granted permissions that are shared with the whole process, not only the sandbox.
lockfile pinned, unpinned, integrity mismatch, no lockfile, or local (no content pin) for local files.
approval For a sandbox: whether the lockfile records this grant (see below).

approval is recorded, not recorded, or changed since ende.lock recorded it when the lockfile records a different grant ("changed" in the JSON output). nested in, can escape and process-wide appear only when they apply. After the entries come the extensions declared in ende.json (each with its source, grant and approval), then any isolate rules that sandbox nothing.

JSON output

--json prints the same report as one JSON document on stdout, for CI and other tools. Like Ende's other JSON output it carries a version field. For the example above:

$ ende grants --json main.ts
{
  "version": 1,
  "entries": [
    {
      "name": "./vendor/tool/",
      "kind": "local",
      "sandboxed": true,
      "matcher": "./vendor/tool/",
      "granted": {
        "read": [
          "./data"
        ]
      },
      "requested": null,
      "effective": {
        "allow": {},
        "deny": {},
        "prompts": false
      },
      "canEscape": [],
      "processWide": [],
      "lockfile": "local",
      "modules": 1,
      "approval": "not recorded"
    },
    {
      "name": "local modules (the app)",
      "kind": "local",
      "sandboxed": false,
      "matcher": null,
      "granted": null,
      "requested": null,
      "effective": {
        "allow": {
          "import": [
            "jsr.io:443",
            "esm.sh:443",
            "raw.esm.sh:443",
            "cdn.jsdelivr.net:443",
            "raw.githubusercontent.com:443",
            "gist.githubusercontent.com:443"
          ]
        },
        "deny": {},
        "prompts": true
      },
      "canEscape": [],
      "processWide": [],
      "lockfile": "local",
      "modules": 1
    }
  ],
  "extensions": [],
  "unmatchedRules": []
}

Only an entry for a sandbox has an approval field ("recorded", "not recorded" or "changed"), and only a sandbox nested in another rule's sandbox has a nestedIn object.

ende audit

ende audit is an alias of ende grants. It runs the same report and first prints a warning:

$ ende audit main.ts
Warning `ende audit` is now `ende grants`; the old name will go away in a later release.

Use ende grants in scripts. -q hides the warning.

Command line usage:

grants

Show which dependencies run sandboxed and what each may do

The approval shown for each rule is judged with the permission flags you pass to this command, so pass the same ones as ende run.

Options

--cert

Load certificate authority from PEM encoded file.

--config, -c

Configure different aspects of ende including TypeScript, linting, and code formatting. Typically the configuration file will be called ende.json or ende.jsonc and automatically detected; in that case this flag is not necessary.

--frozen-lockfile

Error out if lockfile is out of date.

--import-map

Load import map file from local file or remote URL.

--json

Output the report in JSON format.

--lock

Check the specified lock file. (If value is not provided, defaults to "./ende.lock").

--min-dep-age

(Unstable) The age in minutes, ISO-8601 duration or RFC3339 absolute timestamp (e.g. '120' for two hours, 'P2D' for two days, '2025-09-16' for cutoff date, '2025-09-16T12:00:00+00:00' for cutoff time, '0' to disable).

--no-check

Skip type-checking. If the value of "remote" is supplied, diagnostic errors from remote modules will be ignored.

--no-config

Disable automatic loading of the configuration file.

--no-lock

Disable auto discovery of the lock file.

--no-remote

Do not resolve remote modules.

--reload, -r

Reload source code cache (recompile TypeScript). With no value, reloads everything. Pass a comma-separated list of specifiers to reload only those modules; jsr:@ende/http/file-server,jsr:@ende/assert/equals reloads specific modules.

--unsafely-ignore-certificate-errors

DANGER: Disables verification of TLS certificates.

--vendor

Toggles local vendor folder usage for remote modules.