# money

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

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.

Status: asked in full too · no always · one of three

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

## The tool {#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 {#why}

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 {#reviewing}

```javascript
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
}
```

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 {#alternative}

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.

- [addons.buy()](/sdk/ref/cloud/addons-buy): The purchase, done deliberately.
- [Always asked](/sdk/agent/permissions/always-ask): The three together.

```python
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
```
