AgentGuard workflows
Workflow quickstart
Copy this pattern when one agent run can span many model calls.
import { agentguard } from '@agentguard-run/spend'
await agentguard.workflow({
name: 'migrate_legacy_payments',
budget_cap_usd: 500,
duration_cap_hours: 72,
checkpoint_every_outcomes: 50,
}, async (wf) => {
for (const record of records) {
await wf.outcome('migrate_payment', () => migratePayment(record))
}
})Receipt-chain rule
Every receipt stores the previous receipt hash. Resume is refused if any signature, parent receipt, or chain hash fails validation.