---
title: @approve
description: Deterministic gate before irreversible actions.
---

# @approve

`@approve` is the gate: a deterministic block before irreversible work. Detection tools watch after. This pauses *before*.

```python
@agenko.approve
def delete_account(user_id):
    db.delete_user(user_id)

@agenko.approve(when="irreversible", timeout=60)
async def issue_refund(amount):
    ...
```

```typescript
const deleteAccount = agenko.approve(async (userId) => {
  await db.deleteUser(userId);
});

const issueRefund = agenko.approve(
  { when: "irreversible", timeout: 60 },
  async (amount) => { ... },
);
```

## Arguments

| Arg | Default | Meaning |
|---|---|---|
| `when` | `"irreversible"` | Only this value gates. Anything else is a pass-through. |
| `timeout` | `3600` | Seconds to wait for a human. Then `ApprovalTimeoutError`. |
| `poll_interval` | `2.0` | Seconds between control-plane polls (Python). |

## Errors

- `ApprovalError` — human rejected, or the control plane refused.
- `ApprovalTimeoutError` — no decision within `timeout`.

These **do** raise into your app. They are the product, not SDK plumbing.

## Console

While gated, the function does not run. The approvals inbox in the console is the human side. Slack notifications use `AGENKO_SLACK_WEBHOOK` / `SLACK_WEBHOOK_URL` when configured on the server.

## What it is not

It is not an LLM policy. It does not infer risk. You mark the function; the SDK always pauses for `when="irreversible"`.

## Agent instructions

This page: https://docs.agenko.app/approve.md

Fetch `/llms.txt` for the full index. Search: `GET /api/search-docs?query=...`
