Skip to content

Request for review: atomic authorizePayment (replay + budget reservation) #1

Description

@prasanthkuna

Context

x402-guard v0.1-reference implements pre-sign policy for agent payments.

Model

  1. claimReplay(fingerprint) — atomic
  2. reserveBudget(agent, amount, windows, authorizationId) — atomic
  3. Callback / payment runs
  4. commitAuthorization or releaseAuthorization

Questions

  • Is reservation-before-callback the right primitive for x402 middleware?
  • Should authorization handles be standardized across implementations?
  • Gaps in rolling-window semantics?

Proof

bun test packages/policy/src/authorize.test.ts packages/policy/src/fault-injection.test.ts

Portfolio: https://github.com/prasanthkuna/railguard-new/blob/master/docs/PORTFOLIO.md

Ask: Can you poke holes in this state machine?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions