Skip to content

Documentation

AI assistant

This guide explains what the LEA Platform AI assistant (LEA AI) can do, how an administrator turns it on, including on a site without internet, and how to use it safely. It also covers MCP, which lets your own AI tools use LEA Platform.

Before you start

  • An administrator turns the assistant on in Settings → AI Assistant.
  • The assistant needs an AI model (a "provider"). On a site without internet, that means a model server inside your network. See Use a local model on a site without internet.
  • Everybody can ask questions once it is on. What it may change follows your role: operators can let it activate or deactivate hosts and run commands on them, engineers and administrators also change rules and groups.

What the assistant can do

The assistant answers questions about your own LEA Platform with live data. It looks things up with the same permissions as the person asking. If your access is limited to some host groups, it only sees and changes the hosts and groups inside them.

  • Questions about your fleet: "What needs my attention right now?", "Which hosts have not reported in the last day, and why?", "Show the compliance score trend for the last 30 days".
  • Explain failures: it reads the latest output of a rule on a host and the pattern that failed, and suggests fixes ordered by severity.
  • How-to questions: it reads this documentation, the same guides you see under Help, and answers with the exact steps, JSON or commands. Each answer links to the guide section it used. Example: "How do I add a rule that checks my antivirus is running?"
  • Charts: when a trend reads better as a chart, it draws one in the answer.
  • Changes (after approval, only what your role allows): create or update a rule, add or remove a rule in a group, create a group or change its hosts and nested groups, activate or deactivate a host, and run a one-off command on hosts. See Approve changes the assistant proposes.

It never guesses names or numbers: it looks them up. If the answer seems wrong, ask it to show where the data came from.

Turn on the assistant

  1. Open Settings → AI Assistant.

  2. Turn on AI Assistant enabled.

  3. In Provider, pick one:

    ProviderWhen to use it
    Anthropic (Claude)Your site may reach the Anthropic API, directly or through an internal gateway
    OpenAIYour site may reach api.openai.com
    OpenAI-compatible (local or private model)Any server that offers /v1/chat/completions: Ollama, vLLM, LM Studio, LocalAI, Azure OpenAI, Groq or an internal gateway. The model must support tool calling
  4. Fill in the connection:

    • Base URL: required for OpenAI-compatible, for example http://ollama:11434/v1. It must be reachable from the LEA server. For Anthropic it is optional (Base URL (optional, for gateways)).
    • API key: required for Anthropic and OpenAI, optional for local models. A stored key shows as "Stored (…1234)"; leave the field empty to keep it.
  5. Click Get Models and pick a Model from the list, or type the model name. For Anthropic, an empty model uses the default shown under the field.

  6. Optional: Effort (Anthropic only) and Max tool rounds per answer (how many rounds of lookups the assistant may do for one answer, 1 to 40, default 12).

  7. Click Save AI Settings.

You should see AI Assistant appear in the left menu, and a round assistant button at the bottom right of every page.

Note: The API key is stored on the server and never sent to browsers.

Use a local model on a site without internet

On an air-gapped site, run a model server inside your network and point LEA Platform at it.

  1. Make sure the model server is reachable from the LEA server (not only from your desktop). For example, Ollama listens on port 11434.

  2. Pick a model that supports tool calling. Examples: Qwen 2.5 or 3, Llama 3.1 or newer, Mistral.

  3. In Settings → AI Assistant, pick OpenAI-compatible (local or private model).

  4. Set Base URL to the server's OpenAI-compatible address, ending in /v1. Example:

    http://ai-gpu01.corp.local:11434/v1
    

    Replace ai-gpu01.corp.local with your model server's host name.

  5. Leave API key empty unless your model server requires one.

  6. Click Get Models, pick the model, and click Save AI Settings.

  7. Open AI Assistant and ask "What needs my attention right now?" to test it.

With a local model, no question, page content or result leaves your network.

If you cannot run a model, leave AI Assistant enabled off. Everything else in LEA Platform works without it. Features that use the assistant (AI analysis in email, Slack and Teams messages, digest summaries, ask in chat and lea ask) are then unavailable.

Ask a question

There are two places to ask:

WhereHow to open itBest for
AI Assistant pageLeft menu → AI AssistantLonger conversations, with a history list on the left
Floating panelRound button at the bottom right of any pageQuestions about the page you are looking at
  1. Type your question in the box at the bottom ("Ask a question…") and press Enter.
  2. While it works you see "Thinking…" and a line such as "3 steps". Click it to see each lookup it made.
  3. Read the answer. Names of hosts, rules, groups and results are links: click one to open a preview, or follow it to the page. Links with a book icon go to the guide section the answer came from: click one to read it in the Help panel next to the chat.
  4. Ask a follow-up in the same conversation. Click the "New conversation" button to start over.

The panel has an "Open full page" button to continue on the AI Assistant page. On the full page you can hide the history ("Hide sidebar"), change the text size, and reopen an older conversation with Continue conversation.

You can also right-click any host, rule or group name in the console and pick Ask LEA AI.

Page context

When you ask from the floating panel, the assistant also sees the page you are on: its filters, open dialogs, the rows visible in tables and the visible text. A chip "Context: <page>" above the box shows this. So "What is wrong here?" means "on this page".

Fields that look like secrets (passwords, keys, tokens) are left out, and so are dialogs that show a new token.

Approve changes the assistant proposes

When your role allows changes, the assistant can propose them. Nothing changes until you approve.

  1. When the assistant wants to make a change, a box Approve changes appears in the answer, with one line per change.
  2. Click the arrow on a line to see the exact change (for example the rule JSON or the command and hosts).
  3. With several changes, untick the ones you do not want.
  4. Click Approve (or Approve 2, and so on), or Reject to cancel all of them.

Approved changes run as you and are written to the audit log with your name and "(LEA AI)". Check them on the Audit page, tab Configuration changes.

The assistant only offers the changes your role allows, on the hosts and groups you can see. People whose role cannot change anything (Viewer or Read) never get write actions; the assistant gives them the steps or JSON to hand to an administrator instead.

Changes can be approved only in the console or with lea ask in the lea command. A script or AI tool that uses a personal access token gets "AI actions must be confirmed in the console or the lea CLI". lea ask always asks at the terminal: --yes does not approve the assistant's changes, and without a terminal they are not approved.

If your administrator turned on confirmation for an action in Settings → Security, approving it asks you to Confirm it is you first. This includes activating or deactivating a host (Remove or re-enroll hosts).

The assistant can add a remedy to a rule only as a disabled remedy (_remedy). To let LEA Platform run the remedy on failing hosts, enable it yourself in the rule editor.

Warning: Read the details before you approve a command on hosts or a change to a group. Approving is the same as making the change yourself.

Connect your own AI tools with MCP

MCP (Model Context Protocol) lets other AI tools use LEA Platform with the same lookups as the built-in assistant: chat front-ends such as Open WebUI or LibreChat, desktop clients, editors and your own agents. This works even when the built-in assistant is off, and it is the way to use a local model you already run in another tool.

  1. Open Settings → AI Assistant and scroll to MCP server.
  2. Turn on MCP server enabled.
  3. Only if MCP clients should make changes: turn on Allow write tools (create and update rules, assign rules to groups, activate hosts) for admin tokens with write access.
  4. If people reach LEA Platform through another host name than the server sees, fill in Public URL (optional).
  5. Click Save AI Settings.
  6. Copy the MCP URL (it ends in /lea/mcp).
  7. Create a personal access token for the tool (next section). The token dialog shows ready-made settings for a generic MCP client, for stdio-only clients and a test command.

Example settings for a generic MCP client:

Type: Streamable HTTP
URL: https://lea.example.com/lea/mcp
Header: Authorization: Bearer lea_pat_0123456789abcdef

Replace lea.example.com with your server and lea_pat_… with your token.

For Claude Desktop and other clients that only start local programs ("stdio"), use the mcp-remote bridge. It needs Node.js on that computer:

{
  "mcpServers": {
    "lea": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://lea.example.com/lea/mcp", "--header", "Authorization: Bearer ${LEA_TOKEN}"],
      "env": {"LEA_TOKEN": "lea_pat_0123456789abcdef"}
    }
  }
}

For VS Code, put this in .vscode/mcp.json. VS Code asks for the token the first time:

{
  "servers": {
    "lea": {"type": "http", "url": "https://lea.example.com/lea/mcp", "headers": {"Authorization": "Bearer ${input:lea-token}"}}
  },
  "inputs": [{"id": "lea-token", "type": "promptString", "description": "LEA personal access token", "password": true}]
}

The AI tool gets the same lookups as the built-in assistant: search hosts, rules and groups, fleet overview, metrics, host, rule, framework and result details, read-only API queries, this documentation, example rules and rule validation. With write access it can also create and update rules, add rules to groups, create and change groups, activate or deactivate hosts and run a one-off command on hosts, as far as the token owner's role and host groups allow. Unlike the built-in assistant, an MCP client does not ask LEA Platform for approval; whether it asks you first depends on the tool. The full list is in the API reference.

Test from a shell on a machine that can reach LEA Platform:

curl -sk https://lea.example.com/lea/mcp -H "Authorization: Bearer $LEA_TOKEN" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

You should see a list of tools such as fleet_overview and get_host. Every MCP call runs as the token owner and is written to the audit log.

Tip: If LEA Platform uses a certificate from your own certificate authority, the MCP client must trust that CA. For Node-based clients set NODE_EXTRA_CA_CERTS to the CA file.

With single sign-on, MCP clients can also sign in through your identity provider instead of a token: turn on OAuth sign-in through single sign-on (needs Public URL (optional) to be set). Details are in the sign-in reference.

Create a token for an AI tool

  1. In Settings → AI Assistant, under Personal access tokens, click Create Token.
  2. Give it a Name (for example Open WebUI) and pick Expires.
  3. Tick Allow write tools … only if the tool should make changes (your role must allow changes, and Allow write tools must also be on for the MCP server).
  4. Click Create and copy the token. It is shown only once.

A token acts with its owner's current role. Revoke it any time from the list. More about tokens, including the Manage functions scope, in Users, roles and sign-in.

Privacy: what the assistant sends where

DataWhere it goes
Your question and the conversation so farTo the AI provider you configured
Page context (floating panel)To the AI provider, without secret-looking fields
Results of lookups (host names, rule output, scores)To the AI provider, so it can answer
The provider API keyStays on the LEA server
Your conversation historyOnly in your browser. Clear it in My account → Saved preferences → AI assistant conversations

With Anthropic (Claude) or OpenAI, this data leaves your network. With OpenAI-compatible pointing at a server in your network, it does not. Choose the provider your data policy allows.

The same provider is used for AI analysis in email, Slack and Teams messages. To keep host details out of those messages, set Detail in messages to Minimal (title and link only) in Settings → Email, Slack & Teams → Options.

If something goes wrong

SymptomFix
No AI Assistant in the left menuThe assistant is off or not fully configured. An administrator sets provider and model and turns on AI Assistant enabled
The page says "AI Assistant isn't configured"Same as above. For OpenAI-compatible, both Base URL and Model are required
Get Models shows an errorThe LEA server cannot reach the Base URL, or the API key is wrong. Test from the server, not from your desktop
"AI Assistant error" in the chatRead the message. Common causes: the model does not support tool calling, the model server is down, or the key expired
An answer says what is missing, or "Stopped after 12 rounds of tool calls."The assistant used up its lookups. Ask a narrower question, or raise Max tool rounds per answer (default 12)
No Approve changes box appearsYour role does not allow that change (or not on those hosts), or the request was a question, not a change
"The assistant can only add a disabled remedy"The assistant tried to add an active remedy. Approve the rule with the remedy disabled, then enable it in the rule editor
An MCP client gets no write toolsTurn on Allow write tools on the MCP server and use a token created with Allow write tools by someone whose role allows changes

More in Troubleshooting.