Permissions

money

Credits leave the balance for something other than a model call. Asked every time, in every mode, with no « always » — the spend is not refundable.

asked in full toono alwaysone of three
Using Python?

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

askautoplanfull
askedaskedrefusedasked

The tool

cloud { action: "buy_space" }, and that alone. Reading the storages, the space left and the model catalogue are read; the other cloud writes are storage.

What makes it its own category

Every other spend in a run is a consequence of work asked for: a turn, a search, a capture, a generated image. Buying space is a purchase — a monthly commitment in credits, taken immediately and not given back by stopping the run.

A budget does not cover this

An add-on is charged in full at purchase and renews every period. Even a run that then hits its budget has made the purchase. That is precisely why the mode cannot open it.

What to look at

onPermission: async ({ category, args }) => {
  if (category !== "money") return "once";
  // args carries which add-on and how many gigabytes
  console.log("about to buy", args.request ?? args);
  return "deny";          // most applications should simply never allow this
}
def on_permission(request):
    if request["category"] != "money":
        return "once"
    # args carries which add-on and how many gigabytes
    print("about to buy", request["args"])
    return "deny"          # most applications should simply never allow this

For most applications the right answer is a flat refusal: buying space is an account decision, and the person who should make it is rarely the one watching an agent run.

The alternative the agent has

When a storage is full, a write fails with quota_exceeded and the agent is told to say so — free space, or add space in Cloud. Refusing the purchase leaves it with an answer to give, not a dead end.