# Audit log

URL: https://docs.vaultpanel.net/guides/security/audit-log

> The append-only record of every sign-in, change, denial and operation in VaultPanel, what each entry holds and how to filter it.

The audit log records who did what, to what, from where, and whether it worked. It covers sign-ins, every change made through the panel, the API, the CLI, plugins and the AI assistant, permission denials, and events the panel raises itself, such as alerts firing and servers going offline. Entries cannot be edited, and are removed only after the retention period you choose.

## Read the audit log

Open **Security > Audit Log**. It needs `audit.read` (owners and admins by default). Entries are listed newest first; click one to see all its details.

Filter the list by:

- **Action**: entries whose action starts with the text you type, for example `server.` for everything about servers or `auth.login` for sign-ins.
- **Result**: **Success**, **Failure** or **Denied**.

The [API](https://docs.vaultpanel.net/api-reference/users-and-roles) also filters by actor, target type and ID, and a time range.

## What an entry holds

| Field | What it is |
| --- | --- |
| When | The time of the action |
| Who | The actor: a signed-in user (by email), an agent, a plugin, a billing API key, someone not signed in yet, or the system itself |
| Action | What was done, named `area.verb`, such as `website.create` |
| Target | What it was done to: a type, an ID and a label |
| Result | `success`, `failure` or `denied` |
| IP | The address the request came from |
| User agent | The browser or client |
| Request ID | Links the entry to the panel's server log and to the API response |
| Details | Metadata about the change, such as the before and after of a setting |

A user acting through an API token is recorded as that user. Actions the AI assistant runs are recorded as the person who asked, labelled `email (assistant)`, and plugin actions as `plugin:<id>`.

## What is recorded

| Area | Examples |
| --- | --- |
| Sign-in | `auth.login` (with the reason for failures), `auth.logout`, `auth.password_change`, `auth.session_revoke`, `auth.setup_owner` |
| Access | `authz.denied` for every refused permission, `user.invite`, `user.update`, `api_token.create`, `api_token.revoke`, `security.two_factor_policy`, `security.panel_access` |
| Servers | `server.create`, `server.delete`, `server.agent_update`, `server.offline`, `server.online`, `server.terminal.open`, `server.terminal.close` |
| Jobs | `job.create`, `job.cancel`, and the server security changes they carry, such as `security.firewall_rule_add` and `security.firewall_enable` |
| Monitoring | `alert.fire`, `alert.resolve`, `alert.acknowledge`, `alert_rule.create` |
| Hosting | `website.*`, `application.*`, `database.*`, `backup.*`, `cron_job.*`, `dns_zone.*`, `mailbox.*`, `container.*` |
| Secrets viewed | `application.env_view`, `database_user.password_view`, `container.env_view`, `website.env_view` |
| Business | `customer.*`, `plan.*`, `api_key.create`, `api_key.revoke` |
| Extensions | `plugin.*`, `webhook.*`, `assistant.action_approve` |

Secrets are not written to the log: passwords, environment variable values and file contents stay out of entries, and are replaced with a redacted marker in a job's stored parameters when the job ends.

## Protection

On MariaDB and MySQL, database triggers protect the audit log table:

- **No entry can be changed**, with one exception: when a person is [erased](https://docs.vaultpanel.net/guides/security/personal-data#answering-requests), the name or email shown becomes "Erased person" and the IP address and browser are removed. What was done, by which account, when and with what result never changes.
- **No entry can be deleted** until it is older than the retention period, and never before it is 90 days old, whatever the panel asks.

No API can change entries. `TRUNCATE` and `DROP` bypass triggers, so keep direct access to the panel's database restricted.

If writing an entry ever fails, the failure is logged loudly, but it never hides the outcome of the action being audited.

## Retention

By default entries are kept forever. Owners and admins can choose a period at the top of the **Audit log** page: 90 days, 6 months, or 1, 2, 5 or 10 years. The background worker then removes older entries, a batch at a time, and the change of period is itself recorded. Pick a period that fits your security and legal needs and state it in your privacy notice; see [Personal data and GDPR](https://docs.vaultpanel.net/guides/security/personal-data).

## Events from the audit log

Some entries also become events you can receive elsewhere: an alert firing or resolving, and a server going offline or coming back online, can be sent to [webhooks](https://docs.vaultpanel.net/guides/backups-and-automation/webhooks) and by [panel email](https://docs.vaultpanel.net/guides/dns-and-email/panel-email).
