# Audit logs

How kosem records changes, system events and data reads across organizations and projects, what's redacted, and how retention works.

Audit logs record who did what, where and when across your organization and its projects. kosem records audit logs on every plan; reading them and configuring Data Access logging requires the **Team** or **Enterprise** plan ([Limits and quotas](/reference/limits#organization-and-access)), so upgrading to Team shows entries already recorded on Hobby or Pro.

## Four log types [#four-log-types]

| Log                | What it records                                                                                            | On by default                                                                             | Kept                                          |
| ------------------ | ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | --------------------------------------------- |
| **Admin Activity** | Calls that create, change or delete resources, roles and settings                                          | Always                                                                                    | 400 days                                      |
| **System Events**  | Actions kosem takes automatically, such as stopping idle environments or deleting expired sites and agents | Always                                                                                    | 400 days                                      |
| **Policy Denied**  | Calls refused by an organization or project policy                                                         | Always                                                                                    | 30 days (fixed)                               |
| **Data Access**    | Calls that read resources, read secret values, issue credentials or read audit logs                        | Secret reads, credential issues and audit log reads always; other reads opt-in by service | 30 days (1 to 400 days; higher on Enterprise) |

Each entry captures the timestamp, caller principal (person, service account, agent or `system`), service and method name, target resource, permissions checked, caller IP and user agent, outcome status, and structured change metadata (such as IAM policy deltas or changed fields). System Events include a `cause` linking back to the Admin Activity entry that triggered them.

## What's never recorded [#whats-never-recorded]

- **Secrets and credentials:** secret values, API keys, sign-in codes and connection credentials are redacted.
- **Model and agent content:** prompts, model answers, agent messages, command output and attached file contents are never stored in audit entries.

## Inheritance for Data Access [#inheritance-for-data-access]

Data Access logging is configured per service (`allServices`, `llmgateway.kosem.ai`, `agents.kosem.ai`, `secrets.kosem.ai` and others) and per call type (`ADMIN_READ`, `DATA_READ`, `DATA_WRITE`). A project inherits its organization's Data Access configuration and can add more services or types, never turn off what the organization enabled. Retention (1 to 400 days on Team, or higher on Enterprise via staff override) is set at the organization level for all projects, while Policy Denied entries stay fixed at 30 days so lowering Data Access retention never drops them.

## Why it works this way [#why-it-works-this-way]

- **Changes and entries commit together.** Admin Activity entries are written in the same database transaction as the change itself, so no mutation goes unrecorded.
- **Always-on audit of sensitive reads.** Reading a secret value, issuing a dynamic credential and reading the audit log itself are always logged regardless of Data Access settings.

## Related [#related]

- [Read and configure audit logs](/guides/access/read-audit-logs)
- [Roles](/reference/roles#audit-logs)
- [Limits and quotas](/reference/limits#organization-and-access)
