# Persistence

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

What « always » remembers depends on the category, and only one of them survives the process: a plain command, written to a file on that computer.

Status: one durable case · the rest is per session · three have none

## Where each « always » lives {#table}

| Category | Remembered as | Lasts |
| --- | --- | --- |
| `write` | the tool's name | the session |
| `exec`, a single command on a computer | the command text, in `~/.iagenify/permissions.json` | **until you remove it** |
| `exec`, a sequence of commands | the whole sequence | the session |
| `exec`, on a shell your application supplies | the command | the session |
| `exec`, `terminal kill` | the tool's name | the session |
| `storage` | that storage | the session |
| `dns` | that domain | the session |
| `send` · `publish` · `money` | nothing | — |

## The one file {#the-file}

```javascript
// ~/.iagenify/permissions.json
{
  "bash": {
    "allow": ["npm test", "npm run build", "git status"]
  }
}
```

It is on the computer, in the user's home directory, shared by every application on that machine that uses the package. Editing it by hand is the way to review or revoke: remove a line and that command is asked again.

> **It holds commands, nothing else**
>
> No storage, no domain, no tool name. Everything else was deliberately kept out of a durable file, because « always » on a storage or a zone should not outlive the conversation in which it was understood.

## What « the session » means here {#session}

The life of the agent object, not of a saved session. A new `create()` starts with nothing remembered, and reopening a session with `agents.get()` does not bring back what was approved in it — permissions are not part of what a session stores.

## Children share the parent's memory {#subagents}

A subagent reads the parent's session approvals and the same command file, so approving something in a parent does not have to be approved again in a child. The approval belongs to the run, not to the object.

## When to answer always {#advice}

- `always` when the decision does not depend on the arguments — « this project's test command is fine ».
- `once` when it does — a path, a storage, a recipient. The callback sees the arguments; use them.
- Never `always` for the three that will not take it: it is accepted and quietly means `once`.

- [exec](/sdk/agent/permissions/categories/exec): The category with the durable file.
- [Permissions](/sdk/agent/permissions): The callback, its three answers, and the order things are decided in.
- [The ten categories](/sdk/agent/permissions/categories): The matrix, and the tools that compute theirs.

```python
# ~/.iagenify/permissions.json — shared by the Python and JavaScript engines
{
    "bash": {
        "allow": ["npm test", "npm run build", "git status"],
    },
}
```
