Skip to content

Align safety guard and docs with the real Sprites MCP API - #1

Merged
aezell merged 2 commits into
mainfrom
fix/guard-accuracy-and-api-alignment
Aug 7, 2026
Merged

Align safety guard and docs with the real Sprites MCP API#1
aezell merged 2 commits into
mainfrom
fix/guard-accuracy-and-api-alignment

Conversation

@aezell

@aezell aezell commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Reviewed the plugin against the Claude Code plugin docs and the authoritative tool reference in superfly/sprites-mcp. The structure was already correct — claude plugin validate passed, the hook matcher used the right mcp__plugin_sprites_sprites__… scoped form, and the 18 tools in the skill matched the server exactly. The problems were in the content: the guard fired on parameters that don't exist, and several doc statements didn't match the real API.

Guard and API alignment (64f8dee)

The exposure confirmation never fired. It looked for public_url, is_public, make_public, and expose_*. The real service_create schema is service_name, cmd, args, needs, http_port, duration — none of those keys exist, so the branch was unreachable. Worse, the unit test asserted against an invented public_url: true, so the suite was green on a fiction.

The actual exposure signal is http_port: per the services docs, without it "the proxy routes to port 8080, not to your service." The guard now keys on that.

Also in this commit:

  • Dropped guard patterns for tools that have never existed (delete_sprite, restore_sprite, delete_checkpoint, privilege/resource policy), anchored the three real ones, and gave each its own confirmation reason instead of one generic string.
  • checkpoint_create takes comment, not reason — the skill had the wrong parameter name, which is exactly the kind of thing that produces an invalid tool call.
  • Documented that policy_network_update replaces the entire rule set. Nothing told the model to read the current policy back first, so a "block one domain" request could silently drop every existing rule.
  • Corrected the blanket "treat every Sprite URL as potentially internet-accessible" claim. Per concepts/networking.mdx, URL auth defaults to sprite, and no MCP tool in this plugin can flip it — that is a separate --url-auth public change. The accurate framing keeps the real constraint (anything on http_port is reachable there) without a warning the model learns to discount.
  • Noted that Sprite-level tools are generated from the Sprite environment API and can change between versions, so the live tool list wins over the map in the skill.
  • Reworked the guard tests to use real parameters, and added coverage for checkpoint_restore, policy_network_update, service_create without a port, and a read-only service_get.

Manifest, CI, and asset tidy-up (0b8151f)

  • CI now runs claude plugin validate --strict for both the plugin and the marketplace, pinned to CLI 2.1.224. The README already told contributors to run it; now a stale or misspelled manifest field fails the build. Verified locally that --strict passes on this tree and that validate runs clean against an empty CLAUDE_CONFIG_DIR, so it won't hang the runner.
  • Marketplace manifest: metadata.description → top-level description (the former is only accepted for backward compatibility), plus $schema and owner.url.
  • The logo asset was unreferenced — there is no icon field in the plugin or marketplace schema — so it shipped in every install for nothing. It is now shown in the plugin README, and the repository checker resolves src paths in HTML tags so that reference is covered by the same broken-link check as Markdown links.
  • Removed the empty argument-hint from the status skill.

Verification

13 tests, check_repository.py, compileall, and claude plugin validate --strict on both manifests all pass.

Worth a second opinion

  • No fallback for renamed destructive tools. Fly's docs say the Sprite-level tool list can change between environment versions, so a future rename like checkpoint_rollback would slip past the guard silently. The skill instructs Claude to confirm anyway. A loose restore|destroy|delete catch-all would trade some false prompts for that coverage.
  • CLI pinned rather than floating. This matches the repo's SHA-pinning discipline and keeps CI deterministic, but a schema change won't surface until someone bumps the pin.

aezell added 2 commits August 7, 2026 09:21
The PreToolUse guard and the bundled skill documented parameters and tools
that the hosted MCP server does not expose, so the exposure confirmation
never fired and the skill could emit invalid calls.

- Detect service exposure via `http_port` on `service_create`, which is what
  actually puts a service behind the Sprite's URL. The previous patterns
  looked for `public_url`/`is_public`/`expose_*`, none of which exist in the
  service schema, so that branch was unreachable.
- Drop guard patterns for tools that have never existed (`delete_sprite`,
  `restore_sprite`, `delete_checkpoint`, privilege/resource policy) and anchor
  the remaining ones. Give each its own confirmation reason.
- Correct `checkpoint_create` guidance to the `comment` parameter, not `reason`.
- Document that `policy_network_update` replaces the entire rule set, and tell
  the skill to read merged rules back from `policy_network_get` first.
- Replace the blanket "every Sprite URL is potentially internet-accessible"
  claim: URLs are auth-gated by default and no tool here can make one public.
- Note that Sprite-level tools are generated from the Sprite environment API
  and may change, so the live tool list wins over the map in the skill.
- Rework the guard tests to use real tool parameters; the exposure test had
  been asserting against an invented `public_url` field.
- Run `claude plugin validate --strict` for both the plugin and the marketplace
  in CI, pinned to CLI 2.1.224. The README already told contributors to run it;
  now a misspelled or stale manifest field fails the build instead of shipping.
- Move the marketplace description to the top-level `description` field, which
  supersedes the backward-compatible `metadata.description`, and add the
  schemastore `$schema` plus the owner URL.
- Reference the previously unused logo from the plugin README, and teach the
  repository checker to resolve `src` paths in HTML tags so that reference is
  covered by the same broken-link check as Markdown links.
- Drop the empty `argument-hint` from the status skill; the key is only useful
  when the skill actually takes arguments.
@aezell
aezell merged commit 66d8514 into main Aug 7, 2026
1 check passed
@aezell
aezell deleted the fix/guard-accuracy-and-api-alignment branch August 7, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant