| ask | auto | plan | full |
|---|---|---|---|
| asked | asked | refused | allowed |
The tools
| Tool | When |
|---|---|
write_storage | Always — insert, update, delete, SQL writes, object put and remove. |
workflow | Its write actions: create, update, run, delete. |
mail | Its write actions — reading a mailbox is read. |
cloud | Its write actions, except buying space, which is money. |
There is no previous version for a row
A file the engine replaces keeps a copy. A deleted document, a dropped collection and an overwritten object keep nothing — the storage is someone else's and the engine has no store of its own in it. That asymmetry is the whole reason auto stops here.
« always » is for that storage
onPermission: async ({ category, args }) => {
if (category !== "storage") return "once";
if (args.storage === "Staging") return "always"; // this storage only
return "deny"; // production stays asked
}def on_permission(request):
if request["category"] != "storage":
return "once"
if request["args"].get("storage") == "Staging":
return "always" # this storage only
return "deny" # production stays askedThe key is built from the storage named in the arguments, so approving Staging leaves Production asked. It lasts for the session and is never written to disk.
Guards run before the prompt
| Refused before you are asked | Why |
|---|---|
An update or delete with an empty filter, without all: true | It would touch every document. |
| More than one SQL statement in a call | What is approved must be what runs. |
DROP outside full mode | The one statement with no partial recovery. |
The call fails with an explanation the model can act on, and the user is never asked about something that was going to be refused anyway.
What arrives in args
Object-shaped arguments — filter, pipeline, update, documents — travel as JSON text, because a free-form object loses the keys beginning with $. Parse them in your callback if you want to inspect what is about to change.
const change = JSON.parse(args.request || "{}");
if (change.action === "delete" && change.all) return "deny";args = request["args"]
if args.get("action") == "delete" and args.get("all"):
return "deny"