Snapshots
Save the state of the agent's computer and roll back.
A snapshot saves the state of the agent's computer. If a task goes wrong, restore the snapshot to go back to that state.
Coming Q4 2026
AxAgent launches in Q4 2026. The API below may change before launch.
Create a snapshot
const snapshot = await axerity.computers.snapshots.create(agent.id, {
name: 'before-upgrade',
})Restore a snapshot
await axerity.computers.snapshots.restore(agent.id, snapshot.id)Example: roll back a failed upgrade
Take a snapshot before the risky change.
Ask the agent to make the change.
Check the result. If it failed, restore the snapshot.
import Axerity from '@axerity/sdk'
const axerity = new Axerity()
const snapshot = await axerity.computers.snapshots.create(agent.id, {
name: 'before-upgrade',
})
await axerity.runs.create({
agent: agent.id,
input: 'Upgrade every dependency',
})
const tests = await axerity.computers.exec(agent.id, 'pnpm test')
if (tests.exitCode !== 0) {
await axerity.computers.snapshots.restore(agent.id, snapshot.id)
}