# auto

Canonical URL: https://developers.iagenify.com/sdk/agent/modes/auto/
Language: en

`mode: "auto"`

File changes are applied without asking — they keep a previous version. Commands, data and DNS are still asked, because none of the three can be undone.

Status: writes go through · exec still asked · storage still asked

The line auto draws is not « safe / unsafe » but **recoverable / not recoverable**. A file the engine wrote has its previous version kept and its deletions go to a recycle bin; a dropped collection, a changed DNS record and a command that already ran have none of that.

## What changes from ask {#what}

| Category | ask | auto |
| --- | --- | --- |
| `write` | asked | **allowed** |
| exec | asked | asked |
| `storage` | asked | asked |
| `dns` | asked | asked |
| `send` · `publish` · `money` | asked | asked |

Exactly one row moves. Everything else is as it was — which is the point: auto is not « fewer questions », it is « no questions about files ».

## What makes a write recoverable {#recoverable}

- `write` and `edit` on an existing file keep the previous content under `.versions/`.
- `delete` moves to `.trash/<timestamp>/` rather than removing.
- [Checkpoints](/sdk/agent/checkpoints) keep the whole workspace as it was before each of your messages.

> **Auto is what checkpoints were built for**
>
> Letting file changes through is comfortable only if going back is one call. With checkpoints on — they are, unless you turn them off — rewind(n) puts the workspace back exactly as it was before a message.

## A command is still asked, and that is deliberate {#bash}

`bash` can do anything the account on that machine can do, including things far outside the workspace. It stays in the asked column in auto; `always` on a given command is remembered on disk, so a command you approve once is free in later sessions too.

## Where it fits {#use}

```javascript
// A refactor across a project you trust, with commands still gated
const agent = api.agents.create({
  runtime: "local", machine: pc, model: "gemini-3.5-flash",
  mode: "auto",
  onPermission: async ({ category, args }) => {
    if (category === "exec" && /^(npm test|npm run build)$/.test(args.command)) return "always";
    return "deny";
  },
});
```

- [Checkpoints](/sdk/agent/checkpoints): Going back when a write was wrong.
- [Persistence](/sdk/agent/permissions/persistence): What « always » remembers, and for how long.

```python
import re

# A refactor across a project you trust, with commands still gated
def on_permission(request):
    if request["category"] == "exec" and re.fullmatch(r"npm test|npm run build", request["args"].get("command", "")):
        return "always"
    return "deny"

agent = api.agents.create(runtime="local", machine=pc, model="gemini-3.5-flash",
                          mode="auto", on_permission=on_permission)
```
