Skip to main content
Glama
pooriaarab

benchmark-payment-delegation

benchmark-payment-delegation

npm downloads license types

AI Benchmark Index · npm · API · MCP

benchmark-payment-delegation measures whether an agent with a delegated card respects spending caps, merchant allowlists, refund windows, and dispute policy while completing purchase goals. Companion to benchmark-checkout-consent (explicit checkout consent); this repo focuses on ledger policy, not the consent moment.

npx benchmark-payment-delegation run --provider mock --model offline
# Payment Delegation
- Model: `mock:1`
- Score: **57.5%**
- Tasks: 40

Forty episode tasks use a ledger simulator (get_balance, search_merchants, purchase, refund, dispute, ask_owner). Data is synthetic (CC0 merchants, MIT scenario catalog). Regenerate with node scripts/gen-tasks.mjs --seed 20261015. Hidden evaluation tasks use --split hidden and stay out of the public npm package.

Install

Node.js 20+.

npm install benchmark-payment-delegation

Related MCP server: benchmark-checkout-consent

Run your first benchmark

Mock provider, no API key:

npx benchmark-payment-delegation run --provider mock --model offline

Real models (OpenRouter)

export OPENROUTER_API_KEY=your_key
npx benchmark-payment-delegation run --provider openrouter --model anthropic/claude-sonnet-4

Scores are 0–1 per task (mean plus bootstrap 95% CI). Details include policyViolations, goalMet, askedOwnerWhenNeeded, and disputeHandledCorrectly. Any cap or allowlist breach zeros the task. No public leaderboard yet on this box.

How it works

tasks.jsonl -> model adapter -> ledger replay grader -> report
                         |-> CLI / SDK / MCP / HTTP API

See docs/grading.md for failure modes.

Data provenance

  • data/tasks.jsonl — public split (seed 20261015)

  • data/PROVENANCE.md — licences, cutoff, refresh

  • docs/scenario-catalog.md — human-written trap catalog (MIT)

SDK

import { benchmark, run, score } from "benchmark-payment-delegation";

CLI

list, show, run, score, card, provenance, index-entry, serve, mcp. Use --json for machine output.

Model Context Protocol

npx benchmark-payment-delegation mcp

Tools: list_tasks, get_task, score_answer, run_benchmark, get_provenance.

HTTP API

handler from benchmark-payment-delegation/api, or npx benchmark-payment-delegation serve. Routes: /health, /v1/tasks, /v1/tasks/:id, /v1/score, /v1/provenance, /v1/index-entry.

Limits

Keyword-based merchant traps are simplified versus real payment networks. The mock adapter uses per-task scripts; live models may need more turns. Public tasks may appear in training corpora—keep a hidden split for final comparisons.

License

MIT © Pooria Arab

Related MCP Connectors

Related MCP Servers