Skip to content

[Request]: Reconcile live function and middleware guidance with trust by default #196

Closed

Description

@jimhoyd

Problem or use case

Audit of bca8ac7 on macOS/Node 26.8.2 found current documentation still teaching pre-trusted-default restrictions. npm run check passes these claims.

  • docs/yaml/functions.md:57-58 says Node APIs, npm imports, network and filesystem access do not work, immediately after a route with no sandbox declaration.
  • docs/yaml/middleware.md:26 says the chain shares one sandbox/deadline.
  • docs/MIDDLEWARE.md:49-56 says clone/streaming APIs are unavailable and native bodies are opaque without scoping that to sandboxed execution. A trusted middleware wrapping respond: {text: hello} successfully reads await response.text() and returns HELLO; the sandboxed counterpart rejects it.
  • docs/SPECIFICATION.md:214 says .js modules are ESM independently of Node package settings. Reproduced: a project with package.json containing {"type":"commonjs"} and an ESM f.js fails trusted activation; the identical sandboxed route succeeds.
  • README.md:35 and docs/FRAMEWORK.md overstate grants as the only way secrets reach trusted code; grants govern injected context, not ambient Node access.
  • docs/READINESS.md:13 still calls the activated runtime isolated.
  • test/typescript-authoring.test.ts:10 claims execution only in QuickJS while its fixture omits sandbox and executes trusted.

Proposed behavior and alternatives

Correct live guidance to describe trusted Node execution by default and scope guest limitations to sandbox: true. Keep ordinary Node resolution rather than forcing sandbox-like restrictions on trusted modules. State .mjs / type:module requirements accurately. Strengthen prose-check regression fixtures to catch these missed forms; test names must identify the mode actually exercised.

Also review the POST-plus-request.body sandbox advisory (src/readiness.ts:67): it is non-blocking and documented, but recommends isolation based on request shape, whereas authoring guidance says to decide based on code trust. This is a cleanup recommendation, not evidence of an isolation defect.

No claim that trusted host access is a vulnerability. No sandbox boundary was changed. This is a docs/tooling alignment finding, not an independent security assessment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions