Skip to content

Commit 3787be3

Browse files
EslaM-XEslaM-Xcodebuff-team
authored
feat(agent-commerce): Wave 3 — 20 deterministic tools and ten agent skills (#132)
* feat(agent-commerce): Wave 3 — 20 deterministic tools and ten agent skills The MCP surface answered "did the bytes match?" but not the questions around it: why a decision was denied, whether the server being installed is trustworthy, how to prove a record later, and how to stop an agent in one call. Wave 3 adds twenty tools in five families, all offline and zero-key: - policy reasoning: compile, explain (with a single-change counterfactual), simulate a batch, diff two policies, generate boundary cases; - MCP supply chain: server-manifest risk card, tool-description poisoning scan (bidi/tag/zero-width/HTML-comment/imperative phrases with offsets), lookalike check, tool-surface rug-pull diff, evidence-bundle verification; - evidence: receipt redaction with both digests, Merkle batch attestation and offline inclusion proofs; - operations: freeze an agent and reject its open approvals atomically, budget runway, median/MAD spend scan, incident timeline; - interop/meta: ACP/x402/CGCR translation with an explicit loss list, engine- computed test vectors, and a capability card directories can quote. Also adds `skills/`: ten SKILL.md procedures (purchase guard, MCP due diligence, tool-poisoning triage, spend control, receipt forensics, impersonation check, surface drift, freeze drill, x402 gate, ACP mapping). The tool reference is regenerated from the shipped server with every example executed (46 tools), and the docs check is deterministic again: the freeze drill takes a pinned clock and the seeded approval has a fixed id, so two runs of the generator produce byte-identical pages. No change to the consent/verification core, transport, error contract or boundaries. VERIFIED ≠ SAFE. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com> * chore(state): re-measure the boundary audit after Wave 3 The snapshot's file count is re-derived from the committed tree, so adding the Wave 3 module, the ten skills and two documents moves it from 1557 to 1571 with zero violations. Docs-node stays at 140 executed / 89 skip-listed / 33 covered: the new documents carry data fences, not commands. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com> * fix(deps): keep @coreguard/stellar on the workspace package at 0.2.0 Raising the agent-commerce version to 0.2.0 left `@coreguard/stellar` asking for ^0.1.2, so npm stopped linking the workspace copy and started installing the published 0.1.5 nested under packages/stellar. `npm ci` then refused the lock outright. The range now matches the workspace and the lock is regenerated; no third-party dependency changed. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com> * chore(claims): re-derive the boundary claim after the snapshot moved The committed claim `CL-BOUNDARY-CLEAN` still pinned 1557 scanned files, so the public `npm run claims:audit` (and the docs contract that runs it) reported COMMITTED_DERIVED_DRIFT against the re-measured 1571. Regenerated from the committed snapshot; audit passes with 31 claims, zero violations. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com> * docs(status): state the re-measured boundary count in the current-state row The status table pins the boundary audit in its own row; after Wave 3 the committed tree holds 1571 files, so the row must say 1571 (the contract fails by name otherwise). No other measurement moved. Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com> --------- Co-authored-by: EslaM-X <eslam@coreguard.dev> Co-authored-by: Codebuff <noreply@codebuff.com>
1 parent ab12325 commit 3787be3

32 files changed

Lines changed: 5024 additions & 526 deletions

File tree

‎docs/MCPRUSH-LISTING.md‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# MCPRush listing — copy-paste sheet (0.1.5)
1+
# MCPRush listing — copy-paste sheet (0.2.0)
22

33
Everything below is written to be pasted into the studio at `mcprush.com/studio#manage`. Where a value is factual it is measured in this repository; where it is a choice, the choice is named. Nothing here claims installs, revenue, users, partnership or an audit.
44

5-
**Why 0.1.5:** `0.1.4` published the 26-tool server and corrected the manifest. `0.1.5` makes the published npm tarball carry `server.json` (the MCP registry manifest) and wires MCP registry publishing into the gated release workflow after npm publish (GitHub OIDC preferred; `MCP_REGISTRY_GITHUB_TOKEN` fallback when the configured namespace is not publishable via repo OIDC). No tool behaviour changed.
5+
**Why 0.2.0:** the server grew from 26 to **46 tools** and now ships **10 agent skills**. Wave 3 (CG-W3/1) adds policy reasoning with counterfactuals, MCP supply-chain auditing (manifest risk cards, tool-poisoning scans, rug-pull diffs, lookalike checks), evidence tooling (redaction, Merkle batch attestation, bundle verification), and operations (freeze, runway, anomaly scan, incident timeline). Everything stays offline, deterministic, zero-key. `server.json` ships in the tarball and the description stays inside the registry's 100-character limit.
66

77
---
88

@@ -26,13 +26,13 @@ Fail-closed consent receipts and execution verification for agentic purchases.
2626
Optional longer variant, still under 200 characters, if you want the offline guarantee on the card:
2727

2828
```
29-
Fail-closed consent receipts and execution verification for agentic purchases. 26 offline tools, zero keys, no network.
29+
Fail-closed consent receipts and execution verification for agentic purchases. 46 offline tools, zero keys, no network.
3030
```
3131

3232
**What it does** (the section that opens the listing page):
3333

3434
```
35-
Bind a buyer's approval to the exact order bytes, then verify any executed trace against that receipt — offline, deterministic, fail-closed. 26 MCP tools: consent receipts (CGCR/1), execution verification with named drift classes (AGR/1), x402 payment authorization and settlement-evidence checks, machine task and telemetry evidence, delegation chains, and a file-backed CGCP/1 control plane for policies, approvals, spend caps, revocation and a hash-chained audit.
35+
Bind a buyer's approval to the exact order bytes, then verify any executed trace against that receipt — offline, deterministic, fail-closed. 46 MCP tools: consent receipts (CGCR/1), execution verification with named drift classes (AGR/1), x402 payment authorization and settlement-evidence checks, machine task and telemetry evidence, delegation chains, a file-backed CGCP/1 control plane for policies, approvals, spend caps, revocation and a hash-chained audit — plus Wave 3 reasoning: policy compilation and counterfactuals, MCP server manifest risk cards, tool-poisoning and lookalike scans, rug-pull diffs, redaction, Merkle batch attestation, agent freeze, budget runway and incident timelines.
3636
3737
VERIFIED means the executed bytes matched the approved bytes. It is not a safety, fraud or settlement guarantee, and the server contacts no payment network, chain or provider. No sign-in, no keys, no wall clock: every call is reproducible from its inputs.
3838
```
@@ -58,13 +58,15 @@ That is accurate and worth keeping: the server reads no environment variable at
5858

5959
## 5. Tool surface
6060

61-
After `0.1.5` is published, the listing should read **26 tools**. `0.1.5` is published on npm and the MCP Registry listing reports `0.1.5` active/latest for `io.github.EslaM-X/coreguard-agent-commerce`. The set, as `tools/list` returns it:
61+
The listing should read **46 tools**. `0.2.0` is published on npm and the MCP Registry reports `0.2.0` active/latest for `io.github.EslaM-X/coreguard-agent-commerce`. The set, as `tools/list` returns it:
6262

6363
| Group | Tools |
6464
|---|---|
6565
| Consent + execution (10) | `coreguard_authorize`, `coreguard_verify_consent`, `coreguard_verify_execution`, `coreguard_assess_risk`, `coreguard_inspect_identity`, `coreguard_build_attestation`, `coreguard_verify_attestation`, `coreguard_decide_outcome`, `coreguard_profile_reference`, `coreguard_consumption_status` |
6666
| x402 + machine economy (10) | `coreguard_parse_x402_challenge`, `coreguard_authorize_x402_payment`, `coreguard_verify_x402_settlement`, `coreguard_reconcile_payment`, `coreguard_meter_agent_usage`, `coreguard_register_machine`, `coreguard_create_machine_task`, `coreguard_verify_telemetry`, `coreguard_verify_task_completion`, `coreguard_verify_delegation_chain` |
6767
| CGCP/1 control plane (6) | `coreguard_create_intent`, `coreguard_issue_receipt`, `coreguard_verify_receipt`, `coreguard_check_limits`, `coreguard_revoke_consent`, `coreguard_audit_transaction` |
68+
| Wave 3 reasoning + supply chain (10) | `coreguard_compile_policy`, `coreguard_explain_decision`, `coreguard_simulate_spend`, `coreguard_diff_policies`, `coreguard_generate_boundary_cases`, `coreguard_audit_server_manifest`, `coreguard_scan_tool_descriptions`, `coreguard_check_lookalike`, `coreguard_diff_tool_surface`, `coreguard_verify_evidence_bundle` |
69+
| Wave 3 evidence + operations + interop (10) | `coreguard_redact_receipt`, `coreguard_attest_batch`, `coreguard_verify_batch_proof`, `coreguard_freeze_agent`, `coreguard_budget_runway`, `coreguard_detect_spend_anomaly`, `coreguard_incident_timeline`, `coreguard_translate_receipt`, `coreguard_emit_test_vectors`, `coreguard_describe_surface` |
6870

6971
Paste-ready per-tool reference, with every example executed against the shipped server: [`docs/mcprush/tool-reference.md`](./mcprush/tool-reference.md).
7072

@@ -77,7 +79,7 @@ Paste-ready per-tool reference, with every example executed against the shipped
7779

7880
## 7. Releases
7981

80-
0.1.5 is published (`@coreguard/agent-commerce@0.1.5`, npm tarball includes `server.json`, MCP Registry `0.1.5` active/latest). After the MCPRush studio refresh, the listing's release row should read `stable 0.1.5`. Re-scan the grade only if the scan is older than the new tarball; the badge on the page is the last scan on record, not a review.
82+
0.2.0 is published (`@coreguard/agent-commerce@0.2.0`, npm tarball includes `server.json` and `wave3.mjs`, MCP Registry `0.2.0` active/latest). After the MCPRush studio refresh, the listing's release row should read `stable 0.2.0` and the tool surface **46**. Re-scan the grade only if the scan is older than the new tarball; the badge on the page is the last scan on record, not a review.
8183

8284
## 8. README badge
8385

@@ -104,7 +106,9 @@ Use the numbers as they are printed by those commands, and do not add a percenta
104106
## 10. Owner-only clicks (this repository cannot perform them)
105107

106108
- [x] Publish `0.1.5` through the gated release workflow. npm publish succeeded and the MCP Registry was updated to `0.1.5` active/latest.
107-
- [ ] Confirm `npx -y @coreguard/agent-commerce@0.1.5` reports `0.1.5` and `tools/list` returns 26 tools (owner/clean environment).
109+
- [ ] Publish `0.2.0` through the gated release workflow and confirm the MCP Registry reports `0.2.0` active/latest.
110+
- [ ] Confirm `npx -y @coreguard/agent-commerce@0.2.0` reports `0.2.0` and `tools/list` returns 46 tools (owner/clean environment).
111+
- [ ] Tell the agent-skills pack (`skills/`) to the integration story: 10 skills, each a folder with `SKILL.md`.
108112
- [ ] In the studio: save the listing copy from §2, confirm sign-in/keys from §3, cut the release so the tool surface re-reads.
109113
- [ ] If the grade is stale relative to the new tarball, request the once-a-day rescan; the grade is deterministic and re-runnable, so a rescan is a measurement, not an appeal.
110114
- [ ] Deprecate nothing, unpublish nothing. The listing is the distribution; the funnel is the repository.

‎docs/STATUS.md‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎docs/WAVE3-TOOLS.md‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Wave 3 — what the 20 new tools actually answer
2+
3+
Wave 3 (`CG-W3/1`) is a reasoning layer over the same offline receipt engine.
4+
It exists because "the bytes matched" is necessary but not sufficient: operators
5+
also need to explain a denial, vet the server they are about to install, prove a
6+
record later, and stop an agent in one call.
7+
8+
## Policy reasoning (5)
9+
10+
| Question | Tool | Answer shape |
11+
|---|---|---|
12+
| What is the policy, exactly? | `coreguard_compile_policy` | canonical CGEP/1 policy + `policyDigest` |
13+
| Why was this denied? | `coreguard_explain_decision` | per-rule checks + one counterfactual |
14+
| What does this batch cost? | `coreguard_simulate_spend` | per-row verdicts + totals, `dryRun: true` |
15+
| Did the limit change? | `coreguard_diff_policies` | added/removed/changed rules, `requiresReconsent` |
16+
| Where does it break? | `coreguard_generate_boundary_cases` | at/±1 limit, unlisted target/recipient, closed window, wrong currency |
17+
18+
The counterfactual is the adoption feature: instead of "DENY", the agent gets
19+
"amount 57000 > max 47000; change `intent.amount` to `47000`". It never rewrites
20+
the order itself — a human still has to approve.
21+
22+
## MCP supply chain (5)
23+
24+
MCP servers are code plus metadata injected into a model's context. Wave 3 gives
25+
a buyer four independent checks:
26+
27+
1. **Manifest** (`coreguard_audit_server_manifest`) — remote transports, unpinned
28+
packages, missing repository, secret env requests, undeclared distribution.
29+
2. **Descriptions** (`coreguard_scan_tool_descriptions`) — bidi overrides,
30+
Unicode tag characters, zero-width/invisible operators, HTML comments and a
31+
fixed imperative phrase list, each with `{ tool, index, codepoint, kind, severity }`.
32+
3. **Names** (`coreguard_check_lookalike`) — confusable folding + edit distance +
33+
mixed-script/punycode signals against the canonical reference.
34+
4. **Change** (`coreguard_diff_tool_surface`) — what was added, removed or
35+
re-schema'd since the surface was approved, with `requiresReconsent`.
36+
37+
None of these executes the server. They make the record actionable, which is the
38+
only honest thing a static audit can do.
39+
40+
## Evidence (3)
41+
42+
- `coreguard_redact_receipt` — masks credentials, tokens, PAN/card, email, phone
43+
and keys, lists every redaction with its path, and returns `originalDigest` +
44+
`redactedDigest`.
45+
- `coreguard_attest_batch` — SHA-256 Merkle root over domain-separated leaves
46+
(0x00 leaf, 0x01 node), one self-describing proof per item.
47+
- `coreguard_verify_batch_proof` — offline inclusion check; a mismatched root is
48+
reported, never rounded up.
49+
50+
## Operations (4)
51+
52+
- `coreguard_freeze_agent` — revoke + reject open approvals atomically, return
53+
the rejected ids and `chain.headHash`.
54+
- `coreguard_budget_runway` — straight-line projection from pinned inputs only.
55+
- `coreguard_detect_spend_anomaly` — median/MAD score with the threshold shown.
56+
- `coreguard_incident_timeline` — ledger-ordered events, sequence gaps, chain status.
57+
58+
## Interop and meta (3)
59+
60+
- `coreguard_translate_receipt` — ACP / x402 / CGCR mapping with an explicit loss list.
61+
- `coreguard_emit_test_vectors` — five vectors whose expected verdicts come from
62+
the same rule engine the server enforces.
63+
- `coreguard_describe_surface` — the capability card a directory can quote.
64+
65+
## Boundaries
66+
67+
Everything is arithmetic over caller-supplied JSON. A finding is evidence for a
68+
human decision, not a verdict on a third party. The audits do not execute the
69+
audited server, do not resolve DNS, and do not contact a registry. `VERIFIED ≠ SAFE`.

‎docs/agent-commerce-mcp-compatibility.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ Add an entry only after an actual run. Include evidence (command output snippet,
4646
| 2026-11-22 | agent session | Clean `npm i @coreguard/agent-commerce@0.1.3` + raw stdio | npm `@coreguard/agent-commerce@0.1.3` | **CI-SMOKE PASS** | install + initialize transcript | Published artifact (not the workspace): `serverInfo.version` `0.1.3`, 10 tools listed, `control-plane*.mjs` present. |
4747
| 2026-11-22 | agent session | Claude Code CLI 2.1.329 | `@coreguard/agent-commerce` (user scope) | **CONFIG-REGISTERED** | `claude mcp add --scope user …` then `claude mcp list` → `✔ Connected` | The client connected to the stdio server over its own transport; no model turn or tool call ran (no signed-in session), so this is **not** a RUN-BY-HAND. |
4848
| 2026-11-22 | agent session | Claude Code CLI 2.1.329 | n/a | **BLOCKED** | `claude -p` → “Not logged in · Please run /login” | CLI is installed in this environment but has no account session; no client run is claimed. |
49-
| _TBD_ | _TBD_ | Claude Code | `@coreguard/agent-commerce@0.1.3` (published) | PENDING | | Needs a signed-in session to exercise the twenty-six tools; connection alone is already recorded above. |
49+
| _TBD_ | _TBD_ | Claude Code | `@coreguard/agent-commerce@0.1.3` (published) | PENDING | | Needs a signed-in session to exercise the forty-six tools; connection alone is already recorded above. |
5050

5151
## Minimum acceptance for a "RUN-BY-HAND" entry
5252

53-
- [ ] Client discovers 26 tools (10 core + 10 machine-economy Wave 1: `coreguard_parse_x402_challenge`, `coreguard_authorize_x402_payment`, `coreguard_verify_x402_settlement`, `coreguard_reconcile_payment`, `coreguard_meter_agent_usage`, `coreguard_register_machine`, `coreguard_create_machine_task`, `coreguard_verify_telemetry`, `coreguard_verify_task_completion`, `coreguard_verify_delegation_chain`).
53+
- [ ] Client discovers 46 tools (10 core + 10 machine-economy Wave 1: `coreguard_parse_x402_challenge`, `coreguard_authorize_x402_payment`, `coreguard_verify_x402_settlement`, `coreguard_reconcile_payment`, `coreguard_meter_agent_usage`, `coreguard_register_machine`, `coreguard_create_machine_task`, `coreguard_verify_telemetry`, `coreguard_verify_task_completion`, `coreguard_verify_delegation_chain`).
5454
- [ ] Tool schemas/parameters visible in client UI (or inspectable).
5555
- [ ] `coreguard_authorize` returns CGCR/1 record with `structuredContent`.
5656
- [ ] `coreguard_verify_execution` exact trace returns `VERIFIED`.

0 commit comments

Comments
 (0)