Skip to content

feat(skills): gate-my-tool — one-command install of a CredentAgent gate - #170

Open
TheBlackBit wants to merge 1 commit into
mainfrom
feat/17-gate-my-tool-skill
Open

feat(skills): gate-my-tool — one-command install of a CredentAgent gate#170
TheBlackBit wants to merge 1 commit into
mainfrom
feat/17-gate-my-tool-skill

Conversation

@TheBlackBit

Copy link
Copy Markdown
Collaborator

In plain terms

This adds a recipe file that a coding agent (like Claude Code) can follow to protect an online shop's "buy" button in one run. A developer with an existing agent-facing server can say "gate my checkout tool", and the agent wires in CredentAgent so the purchase only completes after the human proves the required credential (their age, a payment authorization) from their phone — instead of the developer reading the docs and wiring it by hand.

What you're approving

  • One new file: .claude/skills/gate-my-tool/SKILL.md — a "skill", i.e. a packaged instruction set coding agents in this repo can invoke. No library code changes, nothing ships to npm, no user-facing change.
  • Worst case if the instructions were wrong: an agent following them would wire the gate incorrectly. That risk is covered — the skill was verified by following it step by step against a sample server (see below), and it requires the security-bypass test as part of the install.
  • Closes Claude skill gate-my-tool — one-command install of a CredentAgent gate #17 (the roadmap item asking for exactly this one-command install).

How to test

Read the skill and check the code snippets against the real API:

cat .claude/skills/gate-my-tool/SKILL.md

Then confirm the repo still builds and tests green (the change is documentation-only):

npm run build && npm run test

Expected: build succeeds; 38 test files, 605 tests pass.


For reviewers — the detail

What the skill teaches, step by step. Pointed at an MCP server (a server exposing tools to AI agents) whose registerTool handler completes a consequential action ungated:

  1. Locate the settling write (the fulfillment/charge) — that is what moves behind the gate.
  2. Wire credentagent.orders.serve(app) once at startup, and move fulfillment into the order.settled event.
  3. Rewrite the tool handler to price the order server-side from the host's catalog (security invariant 2 — never trust client input), open a gated order with credentagent.orders.create({ order, policy }), and return the approve link + requires manifest instead of completing.
  4. Add a get-order-status poll tool over credentagent.orders.retrieve (the three execution contexts: tool mints the link, the human proves on the page, the agent polls).
  5. Write the bypass test (delegating to the existing write-bypass-test skill): an unverified age-restricted checkout must stay pending and unfulfilled — and the test must go red if the gate is reverted.

It also carries the honesty fence (trust_level: "presence-only-demo" — a flow demo, not a real safety control) and a red-flags table mirroring the style of the existing add-ceremony-rail skill.

Decision table: the skill defaults to the orders facade and points hosts that already own their catalog/order stores and checkout route at defineHost(...) + examples/bring-your-own-host.mjs.

How it was verified (the issue's "done when", executed). A fixture MCP server with an ungated checkout was built; baseline confirmed it settled a 21+ item with zero proof. Applying the skill's steps verbatim produced a gated tool where the same unverified checkout returns the approve URL + manifest, retrieve() stays { ok: false, pending: true }, and fulfillment never runs. Load-bearing proof: reverting the handler to the ungated write turned the bypass test red; restoring it, green. Every API call in the snippets was checked against the source (orders.create{ id, approveUrl, manifest }, empty-id minting in orders.ts, the GateOrder shape in types.ts) and the MCP result shape against SDK 1.29.

Also in this change: issue #17 itself was rewritten (title + body) for the CredentAgent rename and to drop its stale claim that the old discovery surface (llms.txt + /.well-known/attestomcp.json) still ships — it was removed during the rename.

🤖 Generated with Claude Code

…te (#17)

Adds the .claude/skills/gate-my-tool skill: pointed at an MCP server whose
registerTool handler completes a consequential action ungated, it walks an
agent through the orders wiring (serve once, create per purchase, poll door),
deriving the policy from the catalog, and requires the bypass test proven
red-when-removed (write-bypass-test).

Verified by applying the skill verbatim to a fixture MCP server (ungated
checkout settling a 21+ item with no proof): after the skill, the unverified
checkout returns approveUrl + requires manifest, retrieve() stays pending,
fulfillment never runs — and reverting the handler to the ungated write turns
the bypass test red.

Closes #17

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Ever Morales <ever.morales@koombea.com>
@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
credentagent-demo Ready Ready Preview Aug 7, 2026 3:05am

@TheBlackBit
TheBlackBit requested a review from dzuluaga August 7, 2026 03:08
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.

Claude skill gate-my-tool — one-command install of a CredentAgent gate

1 participant