# publish

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

Something goes onto the public internet in the customer's name. Asked every time, in every mode, with no « always ».

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

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

## The tool {#tool}

`deploy`, on everything that is not a read. Listing hosts, reading one, reading its history and its usage are `read`.

| Reads (free) | Publishes (asked) |
| --- | --- |
| `kinds` · `list` · `get` | `create` |
| `history` · `usage` | `deploy` · `rollback` · `remove` |

## Why it is never pre-approved {#why}

> **A page is online the moment it is deployed**
>
> Anyone can fetch it, a crawler can index it, and taking it down later does not unpublish what was already read. A rollback restores the previous version; it does not undo the publication.

And a deploy publishes *files* — which is why what it skips is said out loud: environment files, version-control folders and dependency folders are dropped, and the answer lists what was dropped.

## What to look at {#reviewing}

```javascript
onPermission: async ({ category, args }) => {
  if (category !== "publish") return "once";
  console.log(args.action, args.host ?? args.slug, args.path);
  return await confirmWithTheUser();
}
```

## Removing is asked too {#removal}

Taking a host down is in the same category as putting it up: a site that stops answering is as visible as one that starts. Both come to the callback.

- [Always asked](/sdk/agent/permissions/always-ask): The three together.
- [deploy](/sdk/agent/tools/deploy): The tool.
- [api.hosts](/sdk/ref/hosts): Doing it yourself.

```python
def on_permission(request):
    if request["category"] != "publish":
        return "once"
    args = request["args"]
    print(args.get("action"), args.get("host") or args.get("slug"), args.get("path"))
    return confirm_with_the_user()
```
