Skip to content
Agentmart
Submit a tool

agents-pay

Use when THIS agent needs to pay for x402-protected content at runtime: hitting a paywall mid-task, settling it via AgentCore Payments, and applying…

Skill by aws-agentcoreOfficial

IndexedApache-2.0★ 3,049
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/aws-agents-pay

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when THIS agent needs to pay for x402-protected content at runtime: hitting a paywall mid-task, settling it via AgentCore Payments, and applying operator-defined spend limits. Covers payment setup, policy, session budgets, and troubleshooting. Triggers on: "my agent hit a 402 while calling an API", "a tool call returned 402 Payment Required", "my agent needs to pay for x402-protected content", "let the agent pay for content, capped at $5 per session", "set a spend limit for the agent", "ProcessPayment failed", or "why did my agent refuse to pay". Not for BUILDING payment capability for end users, including wallets and framework middleware; use agents-build and references/payments.md. For non-paid APIs via Gateway use agents-connect. For inbound auth use agents-harden. For project scaffolding use agents-get-started.

Use cases: backend, cloud, security, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/agents-pay

Tools it pre-approves 2

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Read
  • Bash

What's inside

Skill name
agents-pay
Description
Use when THIS agent needs to pay for x402-protected content at runtime: hitting a paywall mid-task, settling it via AgentCore Payments, and applying operator-defined spend limits. Covers payment setup, policy, session budgets, and troubleshooting. Triggers on: "my agent hit a 402 while calling an API", "a tool call returned 402 Payment Required", "my agent needs to pay for x402-protected content", "let the agent pay for content, capped at $5 per session", "set a spend limit for the agent", "ProcessPayment failed", or "why did my agent refuse to pay". Not for BUILDING payment capability for end users, including wallets and framework middleware; use agents-build and references/payments.md. For non-paid APIs via Gateway use agents-connect. For inbound auth use agents-harden. For project scaffolding use agents-get-started.
License
Apache-2.0
Allowed tools
Read, Bash
Metadata
type: skill · author: aws-agentcore · version: 1.0.0
Instructions
526 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts
  • Pre-approves any shell command

Agent Skills spec issues

  • body: 526 lines (spec recommends under 500)
  • files: referenced but missing: references/payments.md

Files (34)

  • .gitignore
  • SKILL.md
  • .gitignore · packages/openclaw/
  • PUBLISHING.md · packages/openclaw/
  • README.md · packages/openclaw/
  • openclaw.plugin.json · packages/openclaw/
  • package-lock.json · packages/openclaw/
  • package.json · packages/openclaw/
  • agentcore_bridge.py · packages/openclaw/runtime/
  • stage-skill.mjs · packages/openclaw/scripts/
  • SKILL.md · packages/openclaw/skills/agents-pay/
  • bridge.ts · packages/openclaw/src/
  • config.ts · packages/openclaw/src/
  • index.ts · packages/openclaw/src/
  • payments.ts · packages/openclaw/src/
  • x402.ts · packages/openclaw/src/
  • v2-security-contract.json · packages/openclaw/test/fixtures/
  • security.test.mjs · packages/openclaw/test/
  • test_agentcore_bridge.py · packages/openclaw/test/
  • test_setup_openclaw.py · packages/openclaw/test/
  • tsconfig.json · packages/openclaw/
  • openclaw-setup.md · references/
  • operator-guide.md · references/
  • security-model.md · references/
  • setup.md · references/
  • troubleshooting.md · references/
  • requirements.txt
  • agents_pay_admin.py · scripts/
  • test_portability.py · scripts/
  • test_resource_resolution.py · scripts/
  • test_x402_policy.py · scripts/
  • x402_fetch.py · scripts/
  • x402_fetch_cli.py · scripts/
  • x402_policy.py · scripts/

SKILL.md (first lines)

# pay

Let an agent pay for x402-protected content without letting the agent — or
anything it reads — decide who gets paid, how much, or how often.

## The one idea that matters

**A payment decision is made in code, from a policy file, before any signing.**
Nothing the model says, and nothing inside fetched content, can authorize a
payment or raise a limit.

An instruction to a model is not an access control: it is a request that a
confused or prompt-injected model may decline. Controls must be enforced in code
at the point where payment is authorised.

So in this skill every control is executable, and the model's entire payment
surface can only spend an already-approved, bounded session — it can pay, check
remaining budget, and obtain an opaque handle for a browser navigation, and
nothing more.

## When to use

**This skill is for an agent that needs to pay for something itself, right now** —
the coding agent you are talking to, or an agent host like OpenClaw, hitting a
paywall mid-task and settling it.

- The agent you are running hits an x402 paywall (HTTP `402`) and needs the content
- You need hard spend limits on what that agent can pay, per payment and per session
- A payment was refused and you need to know which rule rejected it

### Not this skill: building a payment-capable agent

If you are **writing an agent that will take payments or pay on behalf of its own end
users** — provisioning a wallet per customer, wiring a payments plugin or middleware
into a product you are shipping — that is
the **`agents-build`** skill and its `references/payments.md`. It covers the
framework-native integrations and the per-end-user data plane.

The distinction is who spends:

| | `agents-build` → `references/payments.md` | `agents-pay` (this skill) |
|---|---|---|
| Question | "How do I give the agent I'm building the ability to pay?" | "This agent needs to pay for this thing now" |
| When | Build time, in a product you ship | Run time, in the session you are in |
| Wallet | One per end user of your product | One for this installation |
| Who approves spend | Your product's own flow | The operator, at a terminal |

Both are valid; they answer different questions. If you are shipping a payments
feature to customers, start with `agents-build`.

Do NOT use for:

- Non-paid external APIs or tools → `agents-connect`
- Inbound auth, who may invoke your agent → `agents-harden`
- Project creation or framework choice → `agents-get-started`
- Building payment capability into an agent you are shipping → `agents-build`
- Wallet custody, fiat payouts, or chargeback handling — out of scope

## Input

`$ARGUMENTS` can be:

- A task: `setup`, `wire`, `debug`, `session`, `budget`, `coinbase`, `stripe`
- A description: "pay for this API", "402 error", "why did it refuse to pay"
- Empty — the skill determines the workflow from context

## Read this before deploying

<!-- markdownlint-disable MD036 -->

**The agent must not have the ManagementRole, and must not be able to run the
admin CLI.**

The whole security model rests on that separation. Follow the official
[IAM roles for AgentCore payments](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/payments-iam-roles.html)
guide:

- A **human** uses the **ManagementRole** to create payment instruments and
  sessions. That role carries an explicit `Deny` on `ProcessPayment`.
- The **agent** runs with the **ProcessPaymentRole**, which can execute a payment
  against an already-approved session but **cannot create one**.

If the agent gets both — or gets shell access to `scripts/agents_pay_admin.py`
while holding the ManagementRole — it can mint itself a fresh budget whenever it
exhausts one, and the per-session cap stops bounding anything. AWS says it
plainly: *"Do not include PaymentSession write permissions ... and ProcessPayment
in the same role, or the caller can bypass payment limits by creating new sessions
with elevated budgets."*

Two mitigations, and you want both:

1. **IAM** is the real boundary. The runtime role must exclude
   `CreatePaymentSession` and every `Create*` setup action.
2. **The admin CLI refuses to run headless** as defence in depth —
   `new-session` requires a human typing `approve` at a TTY, and there is no
   `--yes` flag. Do not treat this as a substitute for IAM: an agent running as
   your user in an interactive terminal could still drive it.

Deploy the admin CLI outside the agent's reach where you can — a separate host,
or a workstation rather than the runtime image.

## Architecture: two paths that never touch

Payments split into an **admin path** (a human, at a terminal) and a **runtime
path** (the agent). They share resource identifiers and nothing else.

```
ADMIN PATH — human only, holds credentials
  agentcore add payment-manager / payment-connector   (provider secrets via CLI wizard)
  agents_pay_admin.py init-config                    -> ~/.agents-pay/config.json (0600)
  agents_pay_admin.py new-session                    -> budget-bounded session, typed approval
        |
        |  passes ONLY: PAYMENT_MANAGER_ARN, PAYMENT_INSTRUMENT_ID,
        |               PAYMENT_SESSION_ID, PAYMENT_USER_ID
        v
RUNTIME PATH — spend only; never create
  x402_fetch(url)                        payment_session_status()   [read-only]
        |-- load policy, vet destination      (refuse before any network I/O)
        |-- GET, no redirects, pinned IP, bounded body

From aws/agent-toolkit-for-aws, Apache-2.0.

More from aws/agent-toolkit-for-aws

Compare and alternatives

    Featured in

    Signals

    Stars
    3,049
    Forks
    394
    Open issues
    40
    Last commit (this folder)
    Aug 14, 2026 (2 months ago)

    From GitHub (fetched Oct 24, 2026).

    Details

    Version
    1.0.0
    License
    Apache-2.0
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026

    More from aws-agentcore

    Cite this page

    agents-pay skill. Agent Mart. https://agentmart.dev/skills/aws-agents-pay (last updated 2026-10-24)