Permissions

storage

Changing a connected database or bucket. Asked even in auto, because none of it can be undone — and « always » is remembered per storage, never for all of them.

asked even in autoalways is per storageno undo
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

askautoplanfull
askedaskedrefusedallowed

The tools

ToolWhen
write_storageAlways — insert, update, delete, SQL writes, object put and remove.
workflowIts write actions: create, update, run, delete.
mailIts write actions — reading a mailbox is read.
cloudIts 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 asked

The 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 askedWhy
An update or delete with an empty filter, without all: trueIt would touch every document.
More than one SQL statement in a callWhat is approved must be what runs.
DROP outside full modeThe one statement with no partial recovery.
A guard that fires costs no prompt

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"