@kaditang/402sentinel-mcp 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,7 @@ Tools — vet the **seller**:
16
16
  Tools — vet the **payment itself** (buyer-side):
17
17
  - `firewall` ($0.002) — should YOUR agent make THIS payment now? Catches fraudulent routing (payTo swapped vs the address you usually pay), drain velocity, overcharge, and injection-sourced instructions. Pass your payer wallet as `agent_id`.
18
18
  - `firewall_record` (free) — seed your agent's payment history so the firewall has a behavioural baseline.
19
+ - `firewall_outcome` (free) — after a verdict, report what actually happened (fraud / legit / …) so the firewall learns which signals are predictive and downweights noisy ones (safety signals stay deterministic).
19
20
 
20
21
  It's a thin client for the hosted service at **https://402sentinel.com** — the
21
22
  scoring model and facilitator-identification logic live server-side (closed); this
package/dist/index.js CHANGED
@@ -113,7 +113,7 @@ const TOOLS = [
113
113
  },
114
114
  {
115
115
  name: "firewall",
116
- description: "Buyer-side payment firewall: should YOUR agent make THIS payment now? Where assess_counterparty vets the seller, this vets the payment instruction in the context of your agent's own history + provenance. Returns allow/hold/block + signals: routing_anomaly (payTo swapped vs the address you usually pay for this resource = fraudulent routing), velocity_anomaly (drain), amount_anomaly (overcharge), provenance_flag (injection/untrusted source), counterparty_risk. Pass your payer wallet as agent_id. Costs $0.002. Seed history free with firewall_record.",
116
+ description: "Buyer-side payment firewall: should YOUR agent make THIS payment now? Where assess_counterparty vets the seller, this vets the payment instruction in the context of your agent's own history + provenance. Returns allow/hold/block + signals: routing_anomaly (payTo swapped vs the address you usually pay = fraudulent routing), velocity_anomaly (drain), amount_anomaly (overcharge), provenance_flag, counterparty_risk, injection_destination (if the payTo appears in the untrusted page/tool-output you're acting on, the destination was injected — pass it as context.untrusted_text), intent_mismatch (pass context.intended={payto,max_amount} so a mid-flight redirect is caught), new_counterparty_burst, recurring_flagged (poisoned-memory loop). STRONGLY recommended: pass untrusted_text + intended to catch prompt-injection payments. Pass your payer wallet as agent_id. Costs $0.002. Seed history free with firewall_record.",
117
117
  inputSchema: {
118
118
  type: "object",
119
119
  required: ["agent_id", "payment"],
@@ -135,6 +135,8 @@ const TOOLS = [
135
135
  source: { type: "string", enum: ["tool_output", "web_content", "user", "unknown"], description: "where the payTo/instruction came from" },
136
136
  metadata: { type: "object", description: "x402 description/reason strings (scanned for injection)" },
137
137
  expected_payto: { type: "string", description: "known-good address for this resource (optional)" },
138
+ untrusted_text: { type: "string", description: "the page/tool-output content you're acting on — if the payTo appears in it, the destination was injected (hard block)" },
139
+ intended: { type: "object", description: "what you meant to do: { payto, max_amount } — any deviation = mid-flight redirect (hard block)", properties: { payto: { type: "string" }, max_amount: { type: "number" } } },
138
140
  },
139
141
  },
140
142
  policy: {
@@ -175,6 +177,20 @@ const TOOLS = [
175
177
  endpoint: "/api/firewall/record",
176
178
  paid: false,
177
179
  },
180
+ {
181
+ name: "firewall_outcome",
182
+ description: "FREE. After a firewall verdict, report what actually happened so 402Sentinel learns which signals are predictive and downweights noisy ones (hard-block safety signals stay deterministic). Pass the assessment_id (fw_…) from a prior firewall call.",
183
+ inputSchema: {
184
+ type: "object",
185
+ required: ["assessment_id", "outcome"],
186
+ properties: {
187
+ assessment_id: { type: "string", description: "the fw_… id from a prior firewall call" },
188
+ outcome: { type: "string", enum: ["fraud", "confirmed_fraud", "not_delivered", "overcharged", "drained", "scam", "delivered", "legit", "fine"], description: "bad: fraud/confirmed_fraud/not_delivered/overcharged/drained/scam · good: delivered/legit/fine" },
189
+ },
190
+ },
191
+ endpoint: "/api/firewall/outcome",
192
+ paid: false,
193
+ },
178
194
  ];
179
195
  function clientOrNull() {
180
196
  if (!RAW_PK || RAW_PK.startsWith("0xYour"))
@@ -183,7 +199,7 @@ function clientOrNull() {
183
199
  return new GatewayClient({ chain: "base", privateKey: pk });
184
200
  }
185
201
  async function main() {
186
- const server = new Server({ name: "402sentinel", version: "0.3.0" }, { capabilities: { tools: {} } });
202
+ const server = new Server({ name: "402sentinel", version: "0.5.0" }, { capabilities: { tools: {} } });
187
203
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
188
204
  tools: TOOLS.map(({ name, description, inputSchema }) => ({ name, description, inputSchema })),
189
205
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaditang/402sentinel-mcp",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "MCP tools for x402 payment safety — vet the counterparty (risk score, allow/review/block, spending policy) AND vet the payment itself (buyer-side firewall: routing/drain/injection). Thin client for 402sentinel.com.",
5
5
  "type": "module",
6
6
  "bin": { "402sentinel-mcp": "./dist/index.js" },