Skip to content

Policy gates for autonomous per-inference x402 spending? #324

Description

@felixpg13-glitch

Hi — ClawRouter's premise (agents autonomously signing transactions for inference payments) is exactly the kind of spend flow we've been testing.

We built SpendShield, an open-source authorization layer that sits between an agent and a payment rail. We just ran it through a single autonomous spend session with one policy, using real engine output:

  • normal order -> ALLOW
  • over single-transaction cap ($75 vs $50) -> DENY
  • larger transaction -> APPROVAL -> human approval -> ALLOW
  • cumulative daily budget ($55 + $10 > $60) -> DENY
  • policy changed mid-session -> versioned, auditable, and the same request re-evaluated under the new policy
  • bypass attempts with no grant / forged grant -> rail REFUSED (MALFORMED_TOKEN / INVALID_SIGNATURE)

The run also produced a tamper-evident hash chain covering authorization decisions, approvals, and policy lifecycle events.

SpendShield never holds keys or money; it only decides whether a payment is authorized before the signing/payment code runs.

For a router where an agent can spend autonomously on repeated inference calls, I'm curious whether you see two separate control layers being useful:

  1. per-call price limits
  2. cross-call / session-level spend budgets

If this feels relevant, I'd be happy to sketch or contribute a small reference integration.

Repo: felixpg13-glitch/spendshield — full dogfood output is in docs/.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions