v1.1.1 shipping · MIT license · zero telemetry · Hash-chained, signed evidence. survives Visa & Mastercard rule cycles · Stripe-first · adapters intentionally absent at v1.1.1 · Patent-pending audit primitive · runs on your infrastructure · v1.1.1 shipping · MIT license · zero telemetry · Hash-chained, signed evidence. survives Visa & Mastercard rule cycles · Stripe-first · adapters intentionally absent at v1.1.1 · Patent-pending audit primitive · runs on your infrastructure
AgentGuard Chargeback
Open-source · v1.1.1 · MIT

Stop hand-typing
chargeback evidence
at 3am 3 milliseconds.

AgentGuard CB is an open-source, MIT-licensed TypeScript SDK that deterministically compiles structured chargeback evidence from your existing Stripe, Shopify, and CRM data. then stages it in Stripe with submit:false for your team to review and submit.

Hash-chained, Ed25519-signed, GDPR-controller-of-nothing. Runs on your infrastructure. No LLM. No telemetry. Stripe, Visa, and Mastercard are referenced nominatively. this Software is not affiliated with or endorsed by any of them.

View on GitHub Read the legal posture
deterministic typed hash-chained human-reviewed no LLM no telemetry
~/merchant/agentguard-cb live

      

Output staged via stripe.disputes.update with submit:false. Your team submits.

01 · The 3am ritual

The current chargeback workflow is five tabs and a Word doc.

A dispute notification fires. The on-call merchant ops person opens five dashboards, copy-pastes screenshots into a Word document, exports a PDF, and uploads it to the Stripe dashboard before the deadline. Every dispute. Every time. The evidence is unsigned, untyped, untracked.

FIG.01: current state · ad-hoc evidence pipeline
Five dashboards funneling into a Word document, then to Stripe CHARGEBACK · $189.00 Stripe Dashboard Shopify · order data CRM · email thread DELIVERED 10:24 AM · signature Carrier · proof of delivery Auth logs · IP, device, 3DS evidence_final_FINAL.docx [screenshot] [paste] 3:14 AM · v7 Stripe dashboard Drop file here SUBMIT deadline: 7 days
unsigned
No cryptographic proof the evidence wasn't tampered with between collection and submission.
untyped
Free-form prose. No schema. Card networks parse it as a blob, not a structured submission.
untracked
Zero audit trail. If someone asks "who edited the screenshot at 3:14am?", the answer is silence.
02 · How it works

Three deterministic steps. Zero LLM.

A typed pipeline that ingests structured data, compiles a hash-chained evidence object, and stages it in Stripe with submit:false. leaving the final submit decision with a human on your team.

STEP 01 ingest

Pull structured data from your sources.

Adapters for Stripe (charges, refunds, 3DS, radar), Shopify (orders, fulfillments, IP), and any HTTPS endpoint that speaks JSON. Each record is fingerprinted with SHA-256 at ingest time.

  • Typed Zod schemas, exhaustive on Stripe v2024-12-18
  • Deterministic. same input ⇒ same hash, byte-for-byte
  • Adapters: Stripe-only at v1.1.1 (intentional)
// 1 · ingest. typed, deterministic, fingerprinted
import { agentguardCb } from '@merchantguard/agentguard-cb';

const dd = agentguardCb({
  stripe: { apiKey: process.env.STRIPE_SECRET_KEY },
  signingKey: process.env.DD_ED25519_KEY,
});

const snapshot = await dd.ingest({
  disputeId: 'dp_3Lk7P9X8nM4',
  sources:   ['stripe', 'shopify', 'carrier', 'auth_log'],
});
// snapshot.contentHash → "sha256:7e4a…c19d"
STEP 02 compile

Compile a typed, hash-chained evidence object.

The compiler walks the snapshot, fills the Stripe evidence schema (receipts, shipping documentation, customer communication, service date), and chains every field's source hash into a verifiable audit log. The output is a single Ed25519-signed envelope.

  • Patent-pending audit primitive
  • Every field traceable to its source record
  • Tamper-evident. break any link, signature fails
// 2 · compile. Merkle-chained, Ed25519-signed
const evidence = await dd.compile(snapshot, {
  reason: 'product_not_received',
  policy: './policies/refund-v3.md',
});

// evidence.envelope = {
//   schema: 'stripe.dispute_evidence/v1',
//   fields: { receipt, shipping_documentation, … },
//   merkleRoot: 'sha256:9c…f2a1',
//   signature:  'ed25519:7c4a…d3e9',
//   signer:     'fp:b1c8…',
//   timestamp:  '2026-04-30T03:14:09Z',
// }
STEP 03 stage

Stage in Stripe with submit:false.

The compiled evidence is uploaded to Stripe via disputes.update with submit:false. Your team reviews it in the Stripe dashboard and submits when satisfied. AgentGuard CB never submits on your behalf.

  • Surfaces Stripe-reported eligibility statuses (qualified, requires_action, not_qualified)
  • Final submit decision is always human
  • Audit log records who submitted, when, with what hash
// 3 · stage. submit:false leaves the human in the loop
const staged = await dd.stage(evidence, {
  submit: false,
});

// staged = {
//   stripeDisputeId: 'dp_3Lk7P9X8nM4',
//   evidenceHash:    'sha256:9c…f2a1',
//   stripeStatus:    'requires_action',  // surfaced from Stripe
//   eligibility:     'qualified',         // surfaced from Stripe
//   reviewUrl:       'https://dashboard.stripe.com/disputes/…',
// }

// → human reviewer opens reviewUrl, clicks Submit when satisfied
04 · Audit trail

Hash-chained, Ed25519-signed.
Step through the log.

Every action (ingest, compile, sign, stage, human submit) is appended to a hash-chained log. Each entry's prevHash binds it to the entry before it. Break any link and the signature over the chain head fails.

Patent-pending audit primitive. Runs on your infrastructure. Verified end-to-end before it touches a single chargeback.

audit.log · dp_3Lk7P9X8nM4
1 / 6
CHAIN HEAD sha256:- SIG ed25519:-

The chain is portable. Export it as a single JSON file, hand it to your auditor, your acquiring bank, or opposing counsel. the signature verifies against the published Ed25519 public key without any MerchantGuard-side service.

05 · Install

Three CTAs. No demos. No forms.

Open-source means every link is a link. There's nothing to schedule, no email to capture, no sandbox to provision. npm install, fork the repo, read the legal docs.

REQUIREMENTS
Runtime
Node ≥ 20.0 · TypeScript ≥ 5.4
PSP
Stripe (v1.1.1)
Signing
Ed25519 keypair (you generate, you hold)
Storage
Anything that speaks read/write: Postgres, S3, fs
License
MIT · DCO sign-off
Telemetry
none · nothing · zero
QUICKSTART
# 1. install
$ npm install @merchantguard/agentguard-cb

# 2. generate signing key
$ npx agentguard-cb keygen > .dd.ed25519

# 3. ingest your first dispute
$ npx agentguard-cb ingest dp_xxx --sources=stripe,shopify

# 4. compile + stage (submit:false)
$ npx agentguard-cb stage dp_xxx
→ staged. review at https://dashboard.stripe.com/disputes/dp_xxx

Read the docs first. AgentGuard CB does not submit chargeback evidence on your behalf. The final submit decision rests with a human reviewer on your team. and with your counsel where the dispute warrants it.