Each tool call is classified at declaration time as safe, compensable, or irreversible, defining exactly how it can be rolled back.
Read-only operations. No side effects. Executed without hesitation.
Writes with a known undo. Rollback is guaranteed and exactly-once.
Sending emails, payments, deletions. Gated behind human-in-the-loop.
1from undolog_sdk import undolog_tool, ToolTier, CompensationDescriptor23@undolog_tool(tier=ToolTier.SAFE)4async def read_user(id: str) -> dict:5 """Retrieve a user by ID. Read-only, no side effects."""6 row = await db.fetch_one(7 "SELECT * FROM users WHERE id = $1", id8 )9 if not row:10 raise UserNotFoundError(id)11 return dict(row)1213@undolog_tool(14 tier=ToolTier.COMPENSABLE,15 compensation=CompensationDescriptor.new("delete_user"),16)17async def create_user(payload: dict) -> dict:18 """Create a new user. Auto-compensated on failure."""19 user_id = uuid4().hex20 await db.execute(21 "INSERT INTO users (id, name, email) "22 "VALUES ($1, $2, $3)",23 user_id, payload["name"], payload["email"],24 )25 return {"id": user_id, **payload}2627@undolog_tool(tier=ToolTier.IRREVERSIBLE)28async def send_payout(amount: float, to: str) -> bool:29 """Send a payout. Cannot be undone."""30 await payout_provider.transfer(31 recipient=to,32 amount_cents=int(amount * 100),33 )34 return True35
UndoLog provides database-grade safety guarantees for every agent action: rollback, replay, and audit built in.
If an undo is triggered, it runs exactly once: even if the system crashes mid-compensation. Backed by a persistent undo log.
Every action is journaled with its inverse. Replayable. Auditable. The stack survives restarts.
Irreversible actions automatically pause. A human must explicitly sign off. No silent disasters.
UndoLog is the first product: the innermost orbit of a platform built for safe agent execution.
Install the SDK and classify your first tool call in seconds. No DSL, no scaffolding; just a single decorator.
Star on GitHub and follow along. Grounded in ACRFence research. Built from first principles.