> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nightshift.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Audits

> Every change to your warehouse, recorded as a snapshot — and reversible

If agents are doing the work, humans need a way to check the work. That's what the audit
surface is for: a complete, append-only history of every change to your warehouse, with
the ability to roll back when something shouldn't have happened.

## The audit log

Every write to the warehouse — a table created, rows inserted, an object dropped — commits
a **snapshot**. The audit log (in the [console](https://console.nightshift.sh) under
**Audit**, admins only) is that snapshot history, newest first. Each entry records:

* **Who** made the change (the member or token)
* **When** it happened
* **What changed** — which tables were created, written to, or dropped
* A commit message describing the operation

Because snapshots are the unit of change, the log can't drift from reality: if the
warehouse changed, there's a snapshot; if there's no snapshot, nothing changed.

You'll also see the snapshot count and the time of the last snapshot at a glance on the
org **Overview** page.

## Rolling back

Every snapshot in the audit log has a **Restore** action. Restoring rolls the warehouse
(and its data) back to exactly how it was at that snapshot — tables created since are
dropped, modified tables are re-materialized as they were.

Two properties make this a safety net rather than a footgun:

* **Rollback is forward-only.** Restoring doesn't erase history — it writes a *new*
  snapshot (`rollback to snapshot N`) on top. The audit log keeps everything, including
  the rollback itself and the state you rolled away from.
* **It's governed like everything else.** Restoring requires admin or the *Restore
  snapshots* capability.

This is worth internalizing, because it changes how freely you can let an agent work:
**mistakes in Nightshift are cheap.** If Claude reorganizes your tables in a way you
don't like, you're one Restore away from before it started.

## What else leaves a trail

The snapshot log covers changes to warehouse data. A few other records round out the
picture:

* **Notebook results are snapshots too.** Each [notebook](/notebooks) cell keeps its
  last-run result with a timestamp, so you can see not just what SQL an agent wrote but
  what it saw — and whether the SQL was edited after the fact.
* **App versions are immutable.** Every [app](/apps) publish is recorded as a version
  carrying the exact source and query manifest, inspectable in the console on the app's
  detail page. Failed builds are recorded as well.
* **Tokens show their last use.** The Tokens page shows when each credential was last
  exercised, making stale or unexpected usage visible.

## Reviewing an agent's session

A practical pattern after a heavy agent session:

1. Open **Audit** and skim the snapshots from the session — do the changes match what you
   asked for?
2. Spot-check the [notebook](/notebooks) it saved: the queries and their snapshotted
   results are the reasoning trail.
3. If anything's wrong, **Restore** to the snapshot before the session and refine your
   prompt.

That loop — act freely, review cheaply, revert instantly — is the workflow Nightshift is
designed around.
