paybondpaybond
Sign in

Recipe · Cloud spend

Approve AWS spending with agents—without unbounded cloud cost

Cap EC2 and cloud operator tools with the aws policy preset — spend verify before side effects, auto-evidence after, and defaultDeny for unregistered calls.

  1. 1Wire
  2. 2Authorize
  3. 3Smoke

You'll build

Harbor-approved AWS operations with budget caps and evidence presets

Before you start

  • paybond login
  • aws preset
  • ~3 min

Agents that manage cloud infrastructure can rack up real cost in one tool call. Paybond's aws preset gives you a reviewed starting policy: side-effecting EC2 operations are capped, read-only describe calls pass through, and default_deny: true blocks anything not registered.

Policy reference: /docs/kit/agent-policy.

  • aws policy preset

    Reviewed starting YAML: capped EC2 start, read-only describe, default_deny for unknowns.

  • spend verify before side effects

    paybond.instrument() authorizes operation and amount before start_instance runs.

  • Auto-evidence

    cost_and_completion digests bind instance results to the Harbor intent.

  • TypeScript and Python

    Same aws preset and instrument() contract in both Kit languages.

Why Paybond (not just IAM)?

IAM and SCPs control AWS principals. They do not enforce a per-agent spend limit, a per-operation permission check (capability token), or a signed completion receipt tied to a spend agreement (intent).

AWS SDK alone versus Paybond-guarded AWS agent tools
  • Starts EC2 / cloud APIs

    AWS SDK alone
    Yes — AWS SDK / CLI from the agent
    With Paybond
    Yes — same APIs, after Harbor authorize
  • Spending limits

    AWS SDK alone
    IAM / SCPs; no per-agent Harbor budget
    With Paybond
    Per-call and intent budgets on registered tools
  • Default deny

    AWS SDK alone
    Depends on IAM breadth
    With Paybond
    default_deny blocks unregistered tool names
  • Signed evidence

    AWS SDK alone
    CloudTrail / logs only
    With Paybond
    Signed cost_and_completion digests bound to the intent
  • Intent binding

    AWS SDK alone
    No Harbor intent or settlement receipt
    With Paybond
    Capability token + intentId from authenticated bind

How it works

Agents call AWS operator tools through Paybond middleware: Harbor authorize before side effects, then auto-evidence after success.

Task flow

  1. Agent tool call

    aws.ec2.start_instance (or your operator catalog)

  2. Paybond guard

    Harbor authorize against the aws preset

    • Verify spend and operation
    • default_deny unknowns
    • Deny or HITL hold
  3. AWS API runs

    Your handler calls the AWS SDK

  4. Evidence

    Auto-evidence with cost_and_completion

Agents call AWS operator tools through Paybond middleware: Harbor authorize before side effects, then auto-evidence after success.

3-minute quickstart

Smoke the aws preset sandbox contract — no AWS credentials required for this check:

Terminal
Terminal commandSwipe to inspect long lines
paybond login
paybond agent sandbox smoke \
  --preset aws \
  --operation aws.ec2.start_instance \
  --requested-spend-cents 5000 \
  --evidence-preset cost_and_completion \
  --result-body '{"status":"completed","cost_cents":5000,"instance_id":"i-smoke"}' \
  --format table

When the smoke succeeds you should see:

  • ✓ Spend approved
  • ✓ Tool completed
  • ✓ Evidence verified (cost_and_completion)

What success looks like

Example status after a Paybond-guarded AWS operator tools tool call: approved spend, requested amount, and verified cost_and_completion evidence.

What success looks like

Authorized AWS spend · illustrative

Sandbox path
Operation
aws.ec2.start_instance
Status
Approved
Requested
$50.00
Evidence
Verified
Preset
cost_and_completion

Scaffold the aws preset

Terminal
Terminal commandSwipe to inspect long lines
paybond policy init --preset aws --out paybond.policy.yaml
paybond policy presets show aws
paybond policy validate-tools --file paybond.policy.yaml --local-only

Optional: raise the budget when scaffolding:

Terminal
Terminal commandSwipe to inspect long lines
paybond policy init --preset aws --max-spend 1000 --out paybond.policy.yaml

Bundled defaults include:

ToolSide effectingCap
aws.ec2.start_instanceYes$500 per call / $500 intent budget
aws.ec2.describe_instancesNo

Wire middleware

Recommended wiring

Use the aws preset inline or from the scaffolded file with paybond.instrument().

paybond-session.ts

TS
Code exampleSwipe to inspect long lines
import { Paybond } from "@paybond/kit";

const paybond = await Paybond.open({ apiKey: process.env.PAYBOND_API_KEY! });

const instrumented = await paybond.instrument({
  policy: "aws", // or "./paybond.policy.yaml"
  tools: {
    "aws.ec2.start_instance": startInstance,
    "aws.ec2.describe_instances": describeInstances,
  },
});

Sandbox quickstart:

Terminal
Terminal commandSwipe to inspect long lines
paybond init --solution aws --max-spend-usd 500 --framework generic --non-interactive

Extend for your operator catalog

Add tools to the policy file and registry together — CI catches drift:

tools:
  aws.rds.start_instance:
    side_effecting: true
    max_spend_cents: 100000
    evidence_preset: cost_and_completion

Re-run paybond policy validate-tools --file paybond.policy.yaml --remote after paybond login to catch remote template head drift.

Production checklist

Production checklist for Paybond-guarded AWS agent spending.

Production checklist

Works with

Works with

  • Agent-agnostic
  • LangGraph
  • OpenAI
  • MCP

Ready to test?

Developer reference: /docs/kit/agent-policy.