# Inventory reporting

> Each device's AI tools inventory, sent to the realm's fleet when it changes, and checked again every 15 minutes.

The inventory you read in the fleet is never far behind the device. The AI tools agent looks again on a timer, and soon
after any watched settings file changes, so a newly installed tool or a newly added MCP server shows up without
waiting for the next round.

## Before you begin

- **Approved devices**; see [AI governance sign-in](../../fleet/user-sign-in/). There's nothing to set up.
- **To read the result:** any privilege that reads your realm's configuration, such as `RealmViewer` or `RealmOwner`,
  through the API.

## How it works

- **On a timer.** The AI tools agent runs discovery again every 15 minutes.
- **On a change.** It watches the tools' settings files, and looks again soon after one changes. Where it can't
  watch, it falls back to the timer alone.
- **Only what changed.** An inventory that hasn't changed isn't sent again. Each one that is sent replaces the
  device's last: the fleet keeps the latest inventory only.
- **While the device is in good standing.** Reports travel over the device's own connection to the realm; see
  [AI tools channel](../../fleet/ai-tools-channel/).
- **Seen, separately.** While connected, the agent tells the fleet it's alive every 30 seconds, which keeps the
  device's `last_seen_at` current even when nothing changed.

## Set it up

Nothing. To see how current a device is, read its `last_seen_at` from the fleet's device list
([Call the API](../../../develop/api/)):

```sh
curl -s https://foobar.cvyuh.com/api/v0/endpoint/aig/v1/api/v1/devices \
  -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" | jq -r '.[] | [.hostname, .last_seen_at] | @tsv'
```

## Limits and defaults

| What | Value | Can it change? |
|---|---|---|
| Look again on a timer | Every 15 minutes | No |
| Look again after a change | Soon after a watched settings file changes | No |
| Seen by the fleet | Every 30 seconds while connected | No |
| Counted as online | Seen in the last 90 seconds | No |
| Inventory kept | The latest only | No |

## Good to know

- **A revoked device stops reporting** at once, since its connection to the realm is cut.
- **An offline device keeps its last inventory** in the fleet, with the `last_seen_at` of its last report, until it's
  dropped or removed.

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| A device counts as offline | It hasn't been seen for 90 seconds: it's off, off the network, or revoked | Bring it back online; it reports again on reconnecting |
| A change takes up to 15 minutes to show | The tool's settings file isn't one the agent can watch on this device | Wait for the timer |

## Audit record

Reports from devices write no record to the realm's audit trail.

## Related

- [AI tool discovery](../ai-tool-discovery/): what's in each report.
- [Fleet records](../../fleet/fleet-records/): where the reports land.
