Repository navigation
Update stale skill files and surface sandbox in explain/context - #134
Merged
Merged
Conversation
Three skill files (skills/urlcode/SKILL.md, .claude/skills/urlcode-authoring and its packaging/claude-plugin generated copy) still described the sandbox as an unconditional property of every function/middleware route, predating #127's trusted-by-default trust model. State the actual default (trusted, unsandboxed, full Node access) and scope the "no fetch/Node/filesystem/ timers" language to sandbox: true routes, matching docs/AI-AUTHORING.md's established phrasing. The .claude/skills copy is hand-edited (source of truth); the plugin copy is regenerated via npm run docs:plugin. Also add the route's actual `sandbox` boolean to `explain`'s handler output and to `context`'s per-route listing, so an agent never has to infer the default. The MCP explain/get_context tools call the same underlying functions and pick this up with no separate changes needed. Add explain test coverage for both a sandboxed route (recipes/webhook-receiver) and a trusted one (cookbook). Reword two README mentions of urlcode-docs' "sandboxed middleware" to make explicit that's its own sandbox: true opt-in, not core's default, since it reads ambiguously to a quick skim. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_018neC2tYKPxMPbzZf1wNctr
jimhoyd
pushed a commit
that referenced
this pull request
Sep 19, 2026
Part 1: an optional `sandboxReason` string on function/middleware routes, ajv-validated (max 500 chars, schemas/urlcode.schema.json) and stored on the compiled route alongside `sandbox`. It applies regardless of whether `sandbox` is true or false, so an author can record why a route needs isolation or why it is safe to trust. Surfaced next to the existing `sandbox` boolean in `explain`'s handler output and `context`'s per-route listing, the same way #134 added `sandbox` there. recipes/webhook-receiver now declares it, replacing what was only a source comment. Part 2: a non-blocking advisory in `urlcode audit`: a route that runs project code, accepts POST with a declared `request.body` policy, and declares neither `sandbox: true` nor `sandboxReason` is flagged under a new `advisories` array on the audit report ("consider whether this route needs sandbox: true"). It never affects `ready` or the CLI's exit code — same non-blocking spirit as the rest of `audit`'s reporting. Update docs/AI-AUTHORING.md's "Deciding when a route needs sandbox: true" and regenerate docs/YAML-REFERENCE.md and llms-full.txt. Add regression tests: schema accept/reject including the length cap, explain/context surfacing, and the audit heuristic firing/staying silent without changing readiness. Claude-Session: https://claude.ai/code/session_018neC2tYKPxMPbzZf1wNctr Co-Authored-By: Claude Sonnet 5 <[email protected]>
jimhoyd
added a commit
that referenced
this pull request
Sep 19, 2026
Part 1: an optional `sandboxReason` string on function/middleware routes, ajv-validated (max 500 chars, schemas/urlcode.schema.json) and stored on the compiled route alongside `sandbox`. It applies regardless of whether `sandbox` is true or false, so an author can record why a route needs isolation or why it is safe to trust. Surfaced next to the existing `sandbox` boolean in `explain`'s handler output and `context`'s per-route listing, the same way #134 added `sandbox` there. recipes/webhook-receiver now declares it, replacing what was only a source comment. Part 2: a non-blocking advisory in `urlcode audit`: a route that runs project code, accepts POST with a declared `request.body` policy, and declares neither `sandbox: true` nor `sandboxReason` is flagged under a new `advisories` array on the audit report ("consider whether this route needs sandbox: true"). It never affects `ready` or the CLI's exit code — same non-blocking spirit as the rest of `audit`'s reporting. Update docs/AI-AUTHORING.md's "Deciding when a route needs sandbox: true" and regenerate docs/YAML-REFERENCE.md and llms-full.txt. Add regression tests: schema accept/reject including the length cap, explain/context surfacing, and the audit heuristic firing/staying silent without changing readiness. Claude-Session: https://claude.ai/code/session_018neC2tYKPxMPbzZf1wNctr Co-authored-by: Claude <[email protected]>
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.
Context
Follow-up to #127 (trusted-by-default
function/middleware,sandbox: trueopt-in). An audit found three gaps in the doc/tooling rollout:1. Three stale skill files
skills/urlcode/SKILL.md.claude/skills/urlcode-authoring/SKILL.mdpackaging/claude-plugin/skills/urlcode-authoring/SKILL.mdNone mentioned "trusted" or the new default; they described the sandbox limits (no
fetch, Node, filesystem, timers) as unconditional. Updated all three to state the actual default (trusted, unsandboxed, full Node/network/filesystem access) and scope the sandbox limits tosandbox: trueroutes, matchingdocs/AI-AUTHORING.md's established phrasing ("untrusted input, an unreviewed contribution, a particularly sensitive secret").Judgment call:
skills/urlcode/SKILL.mdand.claude/skills/urlcode-authoring/SKILL.mdare not byte-identical to each other today — they're two genuinely different skills with different names, descriptions and structure (confirmed via diff and viascripts/generate-claude-plugin.ts, which only syncs.claude/skills/{urlcode-authoring,urlcode-operations}intopackaging/claude-plugin/). So I kept.claude/skills/urlcode-authoring/SKILL.mdand its generatedpackaging/claude-plugincopy in sync vianpm run docs:plugin(the existing convention), and editedskills/urlcode/SKILL.mdseparately with matching phrasing/terminology rather than forcing three files that were never identical into byte-identical lockstep.2.
sandboxmissing fromexplain/context/MCP outputsrc/explain.ts: thefunctionhandler case inhandlerOfnow always includessandboxas an explicit boolean (route.sandbox===true), never omitted.src/context.ts:ProjectContext.routes[]entries now also carrysandbox: booleanper route.src/mcp.tsneeded no changes — itsexplain/get_contexttools callexplainRoute/buildContextdirectly with no separate response shaping, so they pick up both fixes automatically.src/explain-cli.ts'sexplain --projectdetail view printsJSON.stringify(explanation.handler), so it also picks up the field with no code change.test/explain.test.ts: a new test assertssandbox: falseon the cookbook's trusted/hello/{name}function route andsandbox: trueonrecipes/webhook-receiver's/webhookroute (which already declaressandbox: true). Also updated the existing full-objectdeepEqualassertion to include the new field.3. README wording
Reworded two mentions of urlcode-docs' "sandboxed middleware" (~L145-148, ~L258-259) to "its own sandbox-opted-in (
sandbox: true) middleware" — accurate either way, but the original reads ambiguously on a quick skim as if middleware is sandboxed by default.Verification
npm run typecheck— passnpm run lint— passnpm run check(schema/reference/llms-full/cookbook-index/claude-plugin generation and staleness checks) — pass, including the claude-plugin sync checknpm test— 488 tests, 486 pass, 2 skipped (pre-existing, TLS-related), 0 failnpm run build— passnpm run test:package— passNo schema changes, so no
docs:referenceregeneration was needed.🤖 Generated with Claude Code
https://claude.ai/code/session_018neC2tYKPxMPbzZf1wNctr
Generated by Claude Code