Autonomous Agent Flight Recorder & Rollback Engine

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.

LangChain
Mastra
Vercel
OpenAI
Anthropic
Groq
LangGraph

AI agents fail silently.
And one small mistake can become a big one.

Stripe

Invoice generated with the wrong amount.

GitHub

A record deleted in production.

Slack

A message sent to the wrong customer.

By the time you notice, it's already done.

What if you could undo it?

One import.
Full control.

Add a safety net to the agent you already built. No rewrite. No new infrastructure.

01

Install & Initialize

$ npm install agentrein
02

Declare Session Intent

agentrein.newSession()
03

Wrap Action Tree

├──github.issues.create()snapshot recorded
└──slack.chat.postMessage()audit logged
04

Ship Safely or Rollback

agentrein.completeSession()
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 works
Rollback

Reverse 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-dive
Session detail
cmv6050hz0
Reverted
1 failed2 rolled back

Action Timeline

3 executed steps

github.issues.createCREATE
Rolled back
142ms
slack.chat.postMessageCREATE
Rolled back
89ms
notion.pages.createCREATE
Request timed out
Failed
Policies & Guardrails

Block destructive Stripe

BLOCK
Patternstripe.*.delete

Approve refunds

REQUIRE APPROVAL
Patternstripe.refunds.create
Conditionamount.gt:100

Allow Slack notify

ALLOW
Patternslack.chat.postMessage

Gate repo deletes

REQUIRE APPROVAL
Patterngithub.repos.delete
Policy engine

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 approval
Approvals

Require approval before a high-risk write.

Pause critical actions for human sign-off before execution with configurable timeouts and reviewer alerts.

HITL documentation
Needs Approval
Pending

stripe.refunds.create

sess_8f2a91c

ApproveReject
Payload Summary:
{ "amount": 24000, "currency": "usd", "charge": "ch_3…" }
Pending

github.repos.delete

sess_1b77e02

ApproveReject
Drift & Intent
Pending

github.repos.delete

sess_c91a02e

High drift (78%)
Model Reason:

Action diverges from declared intent “notify team on Slack”.

Remediation Suggestion:

Hold for human review — do not auto-rollback.

Success

slack.chat.postMessage

sess_c91a02e

Low drift (12%)
Intent drift

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 post
Audit trail

Inspect 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 trail
Audit log
TimestampEvent TypeDescriptionSession IDActorResult
Oct 22, 2026, 11:42:08 AM
PendingAction
stripe.refunds.createevt_9a21billing-agent
Pending approval
Oct 22, 2026, 11:41:55 AM
SuccessAction
slack.chat.postMessageevt_9a20billing-agent
Success
Oct 22, 2026, 11:41:40 AM
SuccessAction
git.createRefevt_9a1fbilling-agent
Success
Oct 22, 2026, 11:40:12 AM
SuccessCredential
credential.rotatedevt_9a1eyasmin
Success
Oct 22, 2026, 11:38:01 AM
SuccessKey
api_key.createdevt_9a1dyasmin
Success

Use the systems your agent already writes to.

AgentRein wraps supported connectors so the same controls follow the work across your stack.

Contribute on GitHub

Stripe

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

+4 more

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.