# Authorization audit

> **Managed services.** This capability is available with Polyant managed services.

The **authorization audit** is the trail of *who changed who could do what*. It is separate from the [tool audit](https://docs.polyant.ai/admin-panel/audit-logs#the-tool-audit), which records what agents and their tools did.

The panel reads it in the organization's [Monitor](https://docs.polyant.ai/admin-panel/activity#the-monitor-above-the-workspace) (`/organizations/{org}/monitor`), under **Changes**, together with the management trail. The organization's **Audit** page under **Settings → Organization** (`/organizations/{org}/settings/organization/audit`) and the earlier **Authorization audit** address (`/organizations/{org}/audit`) redirect there.

It requires **`org.audit:read`** and the advanced-audit feature; without the feature the authorization rows are left out of **Changes** and their own endpoint, `GET /api/organizations/{orgSlug}/authz-audit-logs`, is refused outright even for an Owner. The permission is the organization-tier one, deliberately not the workspace-tier `audit_log:read` that governs tool audit - an org-addressed route has no workspace to resolve a workspace-tier permission against.

## What is recorded

A closed, explicit table of management mutations - not everything that touches authorization, but exactly these:

| Action | Emitted by |
|---|---|
| `role_binding.create` | Assigning an organization role, or a workspace role |
| `role_binding.delete` | Removing a workspace role binding |
| `member.remove` | Removing a member from the organization |
| `role.create` | Creating a custom role |
| `role.update` | Editing a custom role |
| `role.delete` | Deleting a custom role |

Seven audited routes produce those six actions - an organization role assignment and a workspace one both record `role_binding.create`, distinguished by whether the row carries a workspace.

The list is a static route table rather than something inferred from the URL at request time, which has one consequence worth understanding both ways: a crafted URL can never fake an audit row, and adding a newly audited route is a deliberate code change. So treat this as an authoritative record of the six actions above, not as a complete record of every authorization-relevant event.

## What each row holds

Organization, acting user, action, target type and id, IP address, timestamp, and a small metadata object - for a workspace binding, the workspace id.

Rows are scoped to the organization, and a caller from another organization is refused before the query runs. The endpoint filters by `action` and pages its results.

## Where each row appears

The organization's Monitor lists the whole trail of the organization. A workspace's Monitor lists, under `audit_log:read`, only the rows that name that workspace, which are the two workspace role-binding actions. Role definitions and organization membership carry no workspace, so they appear in the organization's Monitor and nowhere else; read the organization's Monitor to answer who granted Owner to whom.

## What is audited elsewhere

- **Agent-side tool activity** → the **Tools** rows of the [Monitor](https://docs.polyant.ai/admin-panel/activity); see [Audit logs](https://docs.polyant.ai/admin-panel/audit-logs#the-tool-audit).
- **Management writes**, including an agent's configuration, retention policy changes, purge runs, and mutations to installation accounts → the management audit trail, under **Changes** in the same Monitors, and across the deployment in the Admin Console's Monitor. See [the three audit tiers](https://docs.polyant.ai/admin-panel/audit-logs#the-three-audit-tiers).
- **Opt-out transitions** (a contact sending a stop or resume keyword) → audited by the engine and visible in the conversation itself. See [Privacy](https://docs.polyant.ai/admin-panel/privacy).

Nothing here records *reads*: viewing a member list or a role definition leaves no row.

## See also

- [Roles and permissions](https://docs.polyant.ai/reference/roles)
- [Members and roles](https://docs.polyant.ai/admin-panel/members)
- [Roles](https://docs.polyant.ai/admin-panel/roles)
- [Audit logs](https://docs.polyant.ai/admin-panel/audit-logs)
- [Monitor](https://docs.polyant.ai/admin-panel/activity)
