The engine asks onPermission only when the mode does not already answer. Three categories never reach that shortcut: nothing can take back a sent message, a published page or a spent credit.
| Category | ask | auto | plan | full |
|---|---|---|---|---|
| read | allowed | allowed | allowed | allowed |
| memory | allowed | allowed | allowed | allowed |
| task | allowed | allowed | allowed | allowed |
| write | asked | allowed | refused | allowed |
| exec | asked | asked | refused | allowed |
| storage | asked | asked | refused | allowed |
| dns | asked | asked | refused | allowed |
| send | asked | asked | refused | asked |
| publish | asked | asked | refused | asked |
| money | asked | asked | refused | asked |
What “always” means, and where it is kept
storage— remembered per storage, for the session only.dns— remembered per domain, never globally.exec— a bash command is remembered on disk, in~/.iagenify/permissions.json; a terminal kill only for the session.send,publish,money— there is no always. Every call is asked.
Categories computed from arguments
terminal is read for list and output, exec for kill. The service tools pick theirs from their action. The engine evaluates this everywhere the category matters: the permission, the tool_start event, and whether the call may run in parallel.
const agent = api.agents.create({
runtime: "local",
machine: pc,
model: "gemini-3.5-flash",
mode: "ask",
onPermission: async ({ tool, args, category }) => {
if (category === "send") return "deny";
return "once"; // "once" | "always" | "deny"
},
});def on_permission(request):
if request["category"] == "send":
return "deny"
return "once" # "once" | "always" | "deny"
agent = api.agents.create(
runtime="local",
machine=pc,
model="gemini-3.5-flash",
mode="ask",
on_permission=on_permission,
)