# write

Canonical URL: https://developers.iagenify.com/sdk/agent/permissions/categories/write/
Language: en

Changing the workspace. Asked in ask, free in auto — because every write the engine performs keeps what it replaced.

Status: free in auto · keeps previous versions · always is per tool

| ask | auto | plan | full |
| --- | --- | --- | --- |
| asked | allowed | refused | allowed |

## The tools {#tools}

| Tool | Does |
| --- | --- |
| `write` | Creates or replaces a file. |
| `edit` · `multi_edit` | Replaces exact strings inside one. |
| `move` | Moves or renames. |
| `delete` | Moves to the recycle bin. |
| `convert` | Converts a file and saves the result. |
| `create_image` · `create_video` · `create_voice` · `create_music` | Generate media and save it. |
| `document` | Every action but `list`. |
| `generate` | Asks a second model a question of its own. |
| A custom tool | Unless you give it another category. |

## Why auto lets it through {#recoverable}

- Replacing a file keeps the previous content under `.versions/`.
- Deleting moves to `.trash/<timestamp>/`.
- [Checkpoints](/sdk/agent/checkpoints) hold the whole workspace as it was before each of your messages.

Nothing in this category leaves the machine, and nothing in it is final. That is the line [auto](/sdk/agent/modes/auto) draws — not « safe », but *recoverable*.

## The media tools are the expensive ones {#media-cost}

> **A generated video is a write that costs dozens of credits**
>
> They sit in this category because they save a file, not because they are cheap. In auto they are not asked — so a budget is what stands between a run and an expensive misunderstanding.

## « always » here is per tool, for the session {#always}

```javascript
onPermission: async ({ tool, category, args }) => {
  if (category !== "write") return "deny";
  if (tool === "write" && args.path.startsWith("generated/")) return "deny";
  return "always";        // this tool, for the rest of the session
}
```

Answering `always` for `write` frees every later `write` of the session, including paths you would have refused. Return `once` when the decision depends on the arguments.

- [auto](/sdk/agent/modes/auto): The mode this category defines.
- [Checkpoints](/sdk/agent/checkpoints): Going back when a write was wrong.

```python
def on_permission(request):
    if request["category"] != "write":
        return "deny"
    if request["tool"] == "write" and request["args"].get("path", "").startswith("generated/"):
        return "deny"
    return "always"        # this tool, for the rest of the session
```
