Repository navigation
Scope guest limitations to sandbox: true in live guidance (#196) - #210
Merged
Merged
Conversation
Live documentation still taught the pre-0.4.0-alpha.2 restrictions as
unconditional, and the prose gate passed them because none of its rules
matched the forms used. Each claim below was checked against the source
and, where it was about runtime behavior, reproduced.
- docs/yaml/functions.md listed Node APIs, npm imports, network and
filesystem as unavailable directly under a route declaring no sandbox,
where all four work. Rewritten to say so and to scope the removal to
the opt-in.
- docs/yaml/middleware.md said the chain shares "one sandbox/deadline".
It shares the route's execution mode, which on the default route is
not a sandbox.
- docs/MIDDLEWARE.md presented the guest Response contract -- no
clone(), opaque native bodies -- as the middleware contract. Confirmed:
a trusted chain wrapping `respond: {text: hello}` reads the body and
returns HELLO, and has clone(); the sandboxed counterpart 502s.
- docs/SPECIFICATION.md said .js is ESM independently of Node package
settings. Reproduced: with {"type":"commonjs"} an ESM f.js fails
trusted activation while the same sandboxed route serves 200.
- README.md and docs/FRAMEWORK.md made grants the only path by which a
secret reaches code. Grants govern the injected env/secrets context,
not ambient Node access. The FRAMEWORK.md edit is confined to that
sentence (#200 is editing that file concurrently).
- docs/READINESS.md called the activated runtime isolated.
- docs/TOOLING.md summarized `get_context`'s constraints as "no guest
network, no Node APIs" while src/context.ts has emitted the
trusted-default wording for both since the reversal.
- The cookbook/recipe envelope middleware comment claimed native bodies
are opaque in a project that declares no sandbox.
- test/typescript-authoring.test.ts named itself "executes only in
QuickJS" over a fixture that omits sandbox and therefore ran trusted.
scripts/check-trust-model-prose.ts gains six rules for the forms that
slipped through, reads test names (a name is a claim) alongside comments,
and carries a regression fixture per rule -- the sentence that shipped
plus the wording that replaced it -- so a later loosening fails the gate
rather than silently reopening the hole. Every rule must have a fixture.
src/readiness.ts:67's POST-plus-request.body advisory is left alone; the
recommendation is recorded on the live decision list instead.
Co-Authored-By: Claude Opus 5 <[email protected]>
docs/CODEBASE-AUDIT-2026-09-20.md landed on main while this branch was open. It quotes the very wording this change corrects -- finding 4 reproduces the pre-trusted-default claims verbatim as its evidence -- so the new grants-are-the-only-path rule reads the quotation as guidance and fails. The file is a dated review of one commit and is not edited as its findings are fixed, which is what the historical-file marker is for. The marker carries a comment saying why, so it is not read later as a silenced live contradiction. Co-Authored-By: Claude Opus 5 <[email protected]>
jimhoyd
force-pushed
the
claude/issue-196-trust-docs
branch
from
September 20, 2026 03:18
a2646fe to
ac8f6f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #196.
Live documentation still taught the pre-0.4.0-alpha.2 restrictions as unconditional facts about the runtime.
npm run checkpassed them because none of the prose gate's rules matched the forms used.Every claim the issue listed was verified against current source before being touched, and the runtime-behavior ones were reproduced.
Confirmed and fixed
docs/yaml/functions.md:57-58— Node APIs, npm imports, network and filesystem "do not" worksrc/trusted-functions.tsimports the module directly with no allowlist; a trusted function readingnode:fs,os.hostnameandfetchserved 200 with all three present.docs/yaml/middleware.md:26— the chain shares "one sandbox/deadline"docs/MIDDLEWARE.md:49-56— noclone(), native bodies opaquerespond: {text: hello}returnsHELLOand hasclone(); the identicalsandbox: trueroute 502s on each.docs/SPECIFICATION.md:214—.jsis ESM independently of Node package settings{"type":"commonjs"}, an ESMf.jsfails trusted activation ("Function initialization failed"); the identicalsandbox: trueroute serves 200..mjsworks in both modes.README.md:35,docs/FRAMEWORK.md:47— grants as the only path for secretsenv/secretscontext; trusted in-process code reaches the host environment on its own. Both rewritten to say which one is meant.docs/READINESS.md:13— "the same isolated runtime"test/typescript-authoring.test.ts:10— "executes only in QuickJS"sandbox, so it exercises the trusted path. Renamed to name the mode it actually runs.Found by the new rules, not in the issue
docs/TOOLING.md:84summarizedget_context'sconstraintsas "no guest network, no Node APIs" whilesrc/context.tshas emitted the correct trusted-default notes for both since the reversal. The emitted data was right; only the doc describing it was stale.envelope.mjscomment claimed native bodies are opaque, in projects that declare nosandboxand where that middleware can in fact read them.Prose gate
scripts/check-trust-model-prose.tskeeps its existing design and opt-out markers, and gains:guest-only-execution,unscoped-no-node-access,chain-shares-a-sandbox,unscoped-response-limits,isolated-runtime,grants-are-the-only-path);test/it/describeintest/is read alongside comments — never the fixture source those calls embed;Advisory review (recommendation only, not changed)
src/readiness.ts:67's POST-plus-request.bodynudge keys on request shape, whiledocs/AI-AUTHORING.mdtells authors to decide on code trust — so it can read as "untrusted input implies sandbox", the reasoning that guidance explicitly rejects. It is non-blocking and it already offerssandboxReasonas an equal answer, so it still earns its place as a prompt to record a decision. Recommendation: keep the trigger, restate the message as a request to record the trust decision rather than a hint that the route may need isolation. Recorded ondocs/OPEN-DECISIONS.mdrather than acted on here.Scope
Docs and tooling only. No sandbox boundary changed, and trusted host access is described as the documented default capability it is, never as a vulnerability. The
docs/FRAMEWORK.mdedit is confined to the one trust/secrets sentence, leaving #200's concurrent work on that file untouched.Verification
npm run lintclean.npm run check: all steps pass exceptcheck-workspace-links, which fails because this worktree has nonode_modules— environmental, unrelated. Every subsequent step was run individually and passes.npm test: 517/523 pass. The 5 failures are alltest/install.test.ts, from the same missingnode_modules(the spawnedscripts/build.tscannot resolve its dependencies). Unrelated to this change.npm run typecheckstill fails onscripts/release.ts(@types/semver), pre-existing and unrelated.🤖 Generated with Claude Code