# Get started with AI Governance

> Have a user approve their enrolled device, then read the AI tools, MCP servers, skills and local models on it from your realm's AI fleet.

In this guide you see the AI tools on one of your devices. Maya approves her enrolled laptop, `maya-laptop`, for AI
governance, and you read from your realm's AI fleet which AI tools are installed on it, the MCP servers and skills each
one has, and the models a running Ollama holds. It takes about ten minutes.

## Before you begin

- **An enrolled device**, here `maya-laptop`, running Linux (amd64 or arm64, with glibc 2.31 or later, such as
  Debian 11 or Ubuntu 20.04 and later) or macOS. Windows isn't supported. If you have none yet,
  [Get started with Endpoint Management](../../endpoint-management/get-started/) enrolls one. Every Linux and macOS
  device client package carries the AI tools agent, the part of the device client that finds AI tools.
- **A user of your realm** to approve the device, here Maya, who can sign in to the realm as she always does. Approving
  needs no administrator privilege.
- **A shell on the laptop** with `sudo`, to print the approval code.
- **A privilege that reads your realm's configuration**, such as `RealmViewer` or `RealmOwner`, in `foobar` or a realm
  above it, and your session in `$CVYUH_SESSION`. [Call the API](../../develop/api/) shows how to get one. The fleet is
  read through the API; the dashboard has no fleet screens yet.

There's nothing to turn on in the realm: every realm gets its AI governance sign-in when it's created. The AI tools
agent's command is `cvyuh-aig` on a standard install, beside the device client under `/var/cvyuh` on Linux and
`/Library/Cvyuh` on macOS.

## See the AI tools on a device

<Steps>

1. **Print the waiting sign-in** on the laptop:

   <Tabs syncKey="os">
   <TabItem label="Linux">

   ```sh
   sudo /var/cvyuh/bin/cvyuh-aig --socket /var/cvyuh/var/run/aig.sock enrollment
   ```

   </TabItem>
   <TabItem label="macOS">

   ```sh
   sudo /Library/Cvyuh/bin/cvyuh-aig --socket /Library/Cvyuh/var/run/aig.sock enrollment
   ```

   </TabItem>
   </Tabs>

   ```
   awaitingAuthentication
   Sign in at: <sign-in address>
   Code: <code>
   ```

2. **Maya approves the laptop.** She opens the address in any browser, on any device, signs in to `foobar` as she
   always does, and approves the code within its lifetime (10 minutes by default). Run the same command again: it
   prints `enrolled`. The laptop has joined your
   realm's AI fleet as Maya's, and Maya is added to the laptop's
   device record (see [Device records](../../endpoint-management/devices/device-records/)).

3. **Check the fleet sees it.** Signed in as yourself, ask for the fleet's overview:

   ```sh
   curl https://foobar.cvyuh.com/api/v0/endpoint/aig/v1/api/v1/overview \
     -H "Cookie: x-cvyuh-token=$CVYUH_SESSION"
   ```

   `total_devices` counts the laptop, and `online_devices` too while it's connected. The fleet's fields are spelled
   in snake_case.

4. **List the devices and their tools:**

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

   Each device carries its `hostname`, `os`, who approved it (`enrolled_by_subject`), and `installed_tools`. Keep the
   `id` of `maya-laptop`: the fleet device id, the fleet's own id for it.

5. **Read the laptop in full:**

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

   `discoveries` lists each tool with its `kind`, `version` and `path`, and the `mcp_servers` and `skills` it has;
   `model_runtimes` lists a running Ollama and its models. [Fleet records](../fleet/fleet-records/#field-reference)
   describes every field:

   ```json
   {
     "id": "<fleet device id>",
     "hostname": "maya-laptop",
     "os": "linux",
     "enrolled_by_subject": "<Maya's user id>",
     "installed_tools": ["claude-code"],
     "discoveries": [
       {
         "kind": "claude-code",
         "version": "<version>",
         "path": "<path>",
         "mcp_servers": [
           {
             "name": "github",
             "transport": "http",
             "url": "<server address>",
             "enabled": true,
             "source": "<settings file>"
           }
         ],
         "skills": []
       }
     ],
     "model_runtimes": [{ "kind": "ollama", "models": [{ "name": "<model>" }] }]
   }
   ```

</Steps>

<Aside type="note" title="What leaves the laptop">
  An MCP server is listed by name, transport and command or address. Its arguments, environment and headers, where
  credentials are normally kept, are never sent. The address and command are sent as written, so a token written into
  either reaches the fleet; see [MCP servers and skills](../discovery/mcp-and-skills/).
</Aside>

## Check it worked

On the laptop, add an MCP server to one of its tools, or install a supported tool. The AI tools agent looks again
soon after a tool's settings file changes, and every 15 minutes regardless; read the laptop again and the change is
there. To see what the agent finds locally, run the command from step 1 with `discover` in place of `enrollment`.

If the command prints a state other than `awaitingAuthentication` or `enrolled`, or the laptop doesn't appear in the
fleet, see the troubleshooting on [AI governance sign-in](../fleet/user-sign-in/#troubleshooting) and
[Fleet records](../fleet/fleet-records/#troubleshooting).

## Next steps

<CardGrid>
  <LinkCard title="Find the MCP servers on your devices" description="Every MCP server your users' tools reach, across the realm." href="../guides/find-mcp-servers/" />
  <LinkCard title="Supported tools" description="Which AI tools are found, and what's listed for each." href="../discovery/supported-tools/" />
  <LinkCard title="Fleet records" description="Every call the fleet answers, and what it keeps." href="../fleet/fleet-records/" />
</CardGrid>
