# AI tool discovery

> The AI tools installed on each approved device, their versions and MCP servers and skills, and the models Ollama holds there.

Discovery tells you which AI tools are installed on each of your devices: terminal coding assistants, desktop chat
apps, code editors' assistant features, and lightweight coding agents, with their versions, the MCP servers and skills
each one has, and the models a running Ollama holds. The AI tools agent on each approved device (the part of the
device client that finds AI tools) does the looking, and you read the result from your realm's
[fleet records](../../fleet/fleet-records/).

## Before you begin

- **A device enrolled** in Endpoint Management, on Linux or macOS
  ([Get started with Endpoint Management](../../../endpoint-management/get-started/)).
- **The device approved** by a user of your realm ([AI governance sign-in](../../fleet/user-sign-in/)).
- **To read the results:** any privilege that reads your realm's configuration, such as `RealmViewer` or
  `RealmOwner`, in your realm or a realm above it. Discovery is read through the API; the dashboard has no fleet
  screens yet.

## How it works

The AI tools agent looks for each [supported tool](../supported-tools/) in the places that tool installs to, and reads
its settings files. For each tool it finds, it records:

| Field | What it holds |
|---|---|
| `kind` | Which tool it is, such as `claude-code` ([Supported tools](../supported-tools/) lists every `kind`) |
| `version` | The version installed; blank when the install keeps none discovery can read |
| `path` | The program's location on the device |
| `mcp_servers` | The MCP servers configured for it; see [MCP servers and skills](../mcp-and-skills/) |
| `skills` | The skills it can see, by their front matter |

For a running Ollama, it records the runtime and the names of its models, in `model_runtimes`.

**Every user's home on the device is read.** The agent reads the settings in every user's home folder on the machine,
so a tool one user set up is found even when another user approved the device. The whole device is attributed to the
one user who approved it (`enrolled_by_subject`). Each MCP server's and skill's `source` or `path` shows whose home it
came from.

**An entry means installed, not used.** Discovery finds what is installed and configured. It doesn't show whether
anyone runs the tool, how often, or what it did.

**One entry per tool.** Each tool appears once per device, at the first installation found. Its MCP servers and skills
are gathered from every user's settings.

The agent looks again every 15 minutes, and soon after a tool's settings file changes; see
[Inventory reporting](../inventory-reporting/).

## Set it up

There's nothing to turn on: discovery runs on every approved device.

1. Enroll the device; see [Get started with Endpoint Management](../../../endpoint-management/get-started/).
2. Have a user approve it; see [AI governance sign-in](../../fleet/user-sign-in/).
3. Read its tools from the fleet, by its fleet device id ([Call the API](../../../develop/api/)):

   ```sh
   curl https://foobar.cvyuh.com/api/v0/endpoint/aig/v1/api/v1/devices/<fleet device id> \
     -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
   ```

To see what the agent finds on a device before it reports, run its `discover` command on the device; see
[AI governance sign-in](../../fleet/user-sign-in/#set-it-up) for the command.

## What is sent, and what isn't

Discovery sends names, places and versions. It never sends an MCP server's arguments, environment variables or
headers, where credentials are normally kept, and never a file's contents or a skill's body.

Two things are sent as written in the tool's settings: an MCP server's **address**, in full, with its path, query
and any user name or password in it; and a local server's **command**. A secret written into either reaches your
realm's fleet. Keep tokens in an MCP server's headers or environment, not in its address or command.
[MCP servers and skills](../mcp-and-skills/) lists every field.

## Limits and defaults

| What | Value |
|---|---|
| Look again | Every 15 minutes, and soon after a watched settings file changes |
| Entries per tool | One per device |
| Attributed to | The one user who approved the device |
| Model runtimes | Ollama only, while it runs |
| Systems | Linux and macOS |
| What's kept | The latest inventory only; each report replaces the last |

## Good to know

- **Read-only.** Finding a tool changes nothing on the device.
- **Discovery can't be turned off for a realm today.** To stop a device reporting, drop it from the fleet, or
  [revoke](../../../endpoint-management/revoke-and-remove/revocation/) or
  [remove](../../../endpoint-management/revoke-and-remove/removal/) the device.
- **Devices only.** AI tools running as workloads in your clusters are
  [planned](../whats-next/#ai-tools-in-clusters).

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| The device isn't in the fleet | It hasn't been approved, or was revoked or dropped | Approve it ([AI governance sign-in](../../fleet/user-sign-in/)) |
| A tool is missing | It isn't [supported](../supported-tools/), or is installed outside its usual places | Install it the standard way for the tool |
| A change on the device hasn't shown up | The agent hasn't looked again yet, or the device is offline | Wait for the next look (at most 15 minutes) and check `last_seen_at` |

[Fleet records](../../fleet/fleet-records/#troubleshooting) covers the rest.

## Audit record

Discovery writes no record to the realm's audit trail. Each time the realm issues you a token to read the fleet, it
records a `TOKEN_EXCHANGED` in your own trail; see [Read a user's or agent's trail](../../../audit-reports/audit-trail/read-a-trail/).

## Related

- [Get started with AI Governance](../../get-started/): the task, start to finish.
- [Supported tools](../supported-tools/): which tools are found, on which systems.
- [MCP servers and skills](../mcp-and-skills/): what's listed for each tool.
- [Count the AI tools across your devices](../../guides/count-ai-tools/): a roll-up by tool and version.
