AI agents can act.They shouldn't be irreversible.
Roll back reversible actions on recorded failure and gate high-risk operations (Pro) across GitHub, Slack, Stripe, and supported connectors.
AI agents fail silently.
And one small mistake can become a big one.
By the time you notice, it's already done.
One import.
Full control.
Add a safety net to the agent you already built. No rewrite. No new infrastructure.
Install & Initialize
Declare Session Intent
Wrap Action Tree
Ship Safely or Rollback
import { AgentRein } from 'agentrein'
import { Octokit } from 'octokit'
import { WebClient } from '@slack/web-api'
// 1. Initialize client with your API key
const agentrein = new AgentRein({ apiKey: process.env.AGENTREIN_API_KEY })
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN })
const slackClient = new WebClient(process.env.SLACK_TOKEN)
// 2. Create a session with declared agent intent
const session = await agentrein.newSession({
agentId: 'onboarding-agent',
intent: 'Create a GitHub issue and notify the team on Slack',
})
// 3. Wrap your existing clients — zero behavior change
const agentOctokit = agentrein.wrap(octokit, session, { connector: 'github' })
const agentSlack = agentrein.wrap(slackClient, session, { connector: 'slack' })
// 4. Agent takes actions with automatic before-state snapshotting
const issue = await agentOctokit.issues.create({
owner: 'my-org',
repo: 'my-repo',
title: 'Onboarding task',
})
await agentSlack.chat.postMessage({
channel: '#onboarding',
text: `Issue created: ${issue.data.html_url}`,
})
// 5. Complete session (or automatic LIFO rollback on failure)
await agentrein.completeSession(session)Keep the session useful when it needs attention.
Review the work, apply a policy, or recover completed writes without leaving the record of the run.
See how the product worksReverse a completed run.
AgentRein stores the compensation needed for successful writes. When a session needs to be reversed, it unwinds those actions in LIFO order.
Read the engineering deep-diveAction Timeline
3 executed steps
Block destructive Stripe
Approve refunds
Allow Slack notify
Gate repo deletes
Block tools or patterns your agent should not use.
Deterministic policy rules that allow, block, or require approval for logged agent actions.
Allow · Block · Require approvalRequire approval before a high-risk write.
Pause critical actions for human sign-off before execution with configurable timeouts and reviewer alerts.
HITL documentationstripe.refunds.create
sess_8f2a91c
{ "amount": 24000, "currency": "usd", "charge": "ch_3…" }github.repos.delete
sess_1b77e02
github.repos.delete
sess_c91a02e
Action diverges from declared intent “notify team on Slack”.
Hold for human review — do not auto-rollback.
slack.chat.postMessage
sess_c91a02e
Detect when the agent drifts from its intended goal.
Actions are scored against the session’s declared intent. High drift is surfaced for review — never rolled back automatically.
Read technical postInspect session history and audit trail.
Before and after state snapshots for every action, plus a searchable record of key and credential changes.
Session traces · Audit trailUse the systems your agent already writes to.
AgentRein wraps supported connectors so the same controls follow the work across your stack.
Contribute on GitHubStripe
Reverses customers & coupons; charges and refunds are irreversible
Slack
Unsends messages & deletes posts
GitHub
Closes issues & reverts commits
HubSpot
Restores contacts & deals
Notion
Deletes pages & restores blocks
More connectors
View all supported services & rollback tools
Let them act.
Sleep at night.
Give your AI agents room to work, and a way back when they get it wrong.