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).
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
| Capability | AWS SDK alone | With Paybond |
|---|---|---|
| Starts EC2 / cloud APIs | Yes — AWS SDK / CLI from the agent | Yes — same APIs, after Harbor authorize |
| Spending limits | IAM / SCPs; no per-agent Harbor budget | Per-call and intent budgets on registered tools |
| Default deny | Depends on IAM breadth | default_deny blocks unregistered tool names |
| Signed evidence | CloudTrail / logs only | Signed cost_and_completion digests bound to the intent |
| Intent binding | No Harbor intent or settlement receipt | Capability token + intentId from authenticated bind |
How it works
Task flow
Agent tool call
aws.ec2.start_instance (or your operator catalog)
Paybond guard
Harbor authorize against the aws preset
- Verify spend and operation
- default_deny unknowns
- Deny or HITL hold
AWS API runs
Your handler calls the AWS SDK
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
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 tableWhen the smoke succeeds you should see:
- ✓ Spend approved
- ✓ Tool completed
- ✓ Evidence verified (
cost_and_completion)
What success looks like
What success looks like
Authorized AWS spend · illustrative
- Operation
- aws.ec2.start_instance
- Status
- Approved
- Requested
- $50.00
- Evidence
- Verified
- Preset
- cost_and_completion
Scaffold the aws preset
terminal
paybond policy init --preset aws --out paybond.policy.yaml
paybond policy presets show aws
paybond policy validate-tools --file paybond.policy.yaml --local-onlyOptional: raise the budget when scaffolding:
terminal
paybond policy init --preset aws --max-spend 1000 --out paybond.policy.yamlBundled defaults include:
| Tool | Side effecting | Cap |
|---|---|---|
aws.ec2.start_instance | Yes | $500 per call / $500 intent budget |
aws.ec2.describe_instances | No | — |
Wire middleware
Recommended wiring
Use the aws preset inline or from the scaffolded file with paybond.instrument().
paybond-session.ts
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
paybond init --solution aws --max-spend-usd 500 --framework generic --non-interactiveExtend 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
- Init the aws policy preset and validate tools
- Wire paybond.instrument({ policy: "aws", tools })
- Extend the operator catalog in YAML + registry together
- Bind intentId and capabilityToken per session in production
- Smoke with paybond agent sandbox smoke --preset aws before ship
Works with
Works with
- Agent-agnostic
- LangGraph
- OpenAI
- MCP
Ready to test?
Related guides
- Agent policy-as-code — compose domain and guardrails
- Agent-agnostic spend controls — generic tool wiring
- Agent middleware — production bind and lazy context
Developer reference: /docs/kit/agent-policy.