# Safety: undo, trash and limits

> What an agent can and cannot do to your projects: everything is undoable, nothing is deleted for good, nothing leaves your machine, and resources have ceilings.

Source: https://stuarty.com/docs/agents/safety/

## The idea

An agent edits and exports without asking you first. Stuarty makes that safe by removing the dangerous abilities instead of asking for confirmation. The worst a wrong or hostile instruction can do is make edits you can undo and use resources up to a ceiling.

## What an agent cannot do

- **Send your project anywhere.** No command, tool or HTTP route publishes, uploads, calls a webhook or exports to a URL. Import by URL does not exist, and a path that looks like a URL or a network share is refused.
- **Delete for good.** `project:trash` and `media:trash` move things to the trash, and `project:restore` and `media:restore` bring them back. Emptying the trash is not an MCP tool and not a CLI command: it is done by a person in the editor.
- **Start a screen capture.** An agent can prepare a recording and propose cuts; only a person starts a capture, and a red tray icon or a bar shows while one runs.
- **Make a note reach other agents on its own.** A memory note an agent writes waits until you keep it.
- **Read secrets.** No tool returns tokens, keys or configuration.
- **Reach other files through FFmpeg.** FFmpeg only opens files the product chose; user playlists and URLs are never passed to it.

## What is undoable

Every edit is a batch with a revision and the actor that made it. `undo` and `redo` step through the history of the caller, and `history` lists who changed what. Two actors changing the same property from the same revision do not overwrite each other: the second gets `E_REVISION_CONFLICT` with `details.diff`, and its batch changes nothing. See [Batches, revisions and idempotency](/docs/agents/batches).

```bash
stuarty history --project prj_7k2m9x4q1b
stuarty undo --project prj_7k2m9x4q1b
```

## Limits

Each workspace has ceilings for the work an agent can start. A call that exceeds one fails with an error that names the ceiling, its value and the variable that changes it, so the agent (or you) knows what to do next.

| Ceiling | Variable |
| --- | --- |
| Imported file size | `STUARTY_MAX_IMPORT_BYTES` |
| Imported video resolution and duration | `STUARTY_MAX_IMPORT_PIXELS`, `STUARTY_MAX_IMPORT_SECONDS` |
| Exports queued or running | `STUARTY_MAX_EXPORTS` |
| Size of an exported file | `STUARTY_MAX_EXPORT_BYTES` |
| Transcriptions running, and the longest audio | `STUARTY_MAX_TRANSCRIBES`, `STUARTY_MAX_TRANSCRIBE_SECONDS` |

Requests are limited too, on every surface: the CLI, the stdio MCP server, `POST /mcp` and the HTTP API all reach the same server, so they are counted the same way. One key, or the local token in local mode, may send 300 requests a minute plus a burst of 60 (`STUARTY_RATE_LIMIT_PER_MINUTE`), so the 361st call within a minute is refused with `E_RATE_LIMITED`; a browser session has 1,800 plus 300 (`STUARTY_RATE_LIMIT_SESSION_PER_MINUTE`). Heavy calls (`job_start`, `media_import`, the other imports and bundle exports, and the sound measure of `view`) share 10 a minute (`STUARTY_RATE_LIMIT_HEAVY_PER_MINUTE`). The error carries `retry_after`; wait that many seconds and retry. Details: [API keys, rate limits](/docs/self-hosting/api-keys).

`E_QUEUE_FULL`, `E_RATE_LIMITED` and `E_REVISION_CONFLICT` are retryable: the CLI exits with `2` and the error says `retryable: true`. A limit such as `E_LIMIT_EXCEEDED` is not retryable until the input or the ceiling changes. The [error codes](/docs/reference/error-codes) page lists every code and its HTTP status. The [configuration variables](/docs/reference/configuration) page lists the defaults.

## Text from media is data

A transcript, a file name or a metadata field can say "ignore your instructions". The product returns such text inside delimited, truncated blocks marked as data, and the tool descriptions tell the agent to treat it that way. Do not paste it into a prompt as if it came from you.

## Common mistakes

- Assuming a trashed project is gone. It stays on disk until a person empties the trash.
- Retrying a limit error in a loop. Read the ceiling in the error first.

## Next steps

- [How an agent verifies its work](/docs/agents/verify)
- [Recipes: cut, caption, export](/docs/agents/recipes)
