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

# Mistral AI

> Discover and monitor Mistral agents, models, files, document libraries, and native moderation guardrails using a single API key.

TrustLens connects to **Mistral AI** using your API key to discover and monitor agents, models, files, and document libraries in your Mistral workspace.

***

## What TrustLens discovers

### Agents

| Data                                                                                       | Source                                    |
| ------------------------------------------------------------------------------------------ | ----------------------------------------- |
| Agent name, description, status                                                            | Mistral Agents API (beta)                 |
| Model, instructions, temperature, top-p                                                    | Mistral Agents API (beta)                 |
| Tools (code interpreter, web search, image generation, document library, custom functions) | Mistral Agents API (beta)                 |
| Knowledge bases (document libraries)                                                       | Mistral Agents API + Libraries API (beta) |
| Version history and deployment aliases                                                     | Mistral Agents API (beta)                 |

### Models

| Data                                                       | Source             |
| ---------------------------------------------------------- | ------------------ |
| Model name and family                                      | Mistral Models API |
| Capabilities (chat, function calling, vision, fine-tuning) | Mistral Models API |
| Lifecycle status (stable, deprecated, legacy)              | Mistral Models API |
| Context window                                             | Mistral Models API |

### Files and document libraries

| Data                                               | Source                       |
| -------------------------------------------------- | ---------------------------- |
| Filename, size, purpose                            | Mistral Files API            |
| Document library name, description, document count | Mistral Libraries API (beta) |

### Usage metrics

TrustLens collects per-agent usage via the Mistral **Conversations API** (beta):

| Metric                 | Description                                   |
| ---------------------- | --------------------------------------------- |
| Total runs             | Number of agent responses (message outputs)   |
| Total conversations    | Number of unique conversation threads         |
| Average latency        | Average response time per run                 |
| Code interpreter calls | Number of code execution tool invocations     |
| File search calls      | Number of document library search invocations |
| Web search calls       | Number of web search tool invocations         |
| Image generation calls | Number of image generation tool invocations   |
| Function calls         | Number of custom function tool invocations    |

<Note>
  Token usage (input and output token counts) is not currently available via the Mistral API and will not appear in TrustLens.
</Note>

***

## Required access

Mistral uses **API key authentication** — no IAM roles or service principals are needed.

### Beta API access

Several Mistral API endpoints used by TrustLens are in **beta** and require your workspace to have beta access enabled:

| Endpoint                | Used for                   |                        Beta required                       |
| ----------------------- | -------------------------- | :--------------------------------------------------------: |
| `GET /v1/agents`        | Agent discovery            | <span style={{color:'#dc2626', fontWeight:600}}>Yes</span> |
| `GET /v1/conversations` | Usage metrics              | <span style={{color:'#dc2626', fontWeight:600}}>Yes</span> |
| `GET /v1/libraries`     | Document library discovery | <span style={{color:'#dc2626', fontWeight:600}}>Yes</span> |
| `GET /v1/models`        | Model discovery            |                             No                             |
| `GET /v1/files`         | File discovery             |                             No                             |

**If beta API access is not enabled:**

* Agent discovery will return zero agents
* Usage metrics will be unavailable
* Document library discovery will be skipped
* Models and files will still be discovered

To request beta access, contact [Mistral support](https://mistral.ai/contact).

***

## Step-by-step setup

<Steps>
  <Step title="Create an API key">
    1. Log in to [admin.mistral.ai](https://admin.mistral.ai)
    2. Go to **Organization** → **API Keys**
    3. Click **Create new key**
    4. Set a name (e.g., `neuraltrust-trustlens`) and expiry, then click **Create**
    5. Copy the key value and store it securely — it is only shown once
  </Step>

  <Step title="Configure the integration in TrustLens">
    Provide the following when creating the Mistral integration:

    | Field       | Description                   |
    | ----------- | ----------------------------- |
    | **API Key** | The API key created in Step 1 |

    No additional configuration is required. TrustLens automatically discovers all agents, models, files, and libraries accessible to the key.
  </Step>
</Steps>

***

## Guardrails discovery

TrustLens discovers the native **guardrails policies** configured on each Mistral agent via the Mistral Agents API. When an agent has guardrails attached, the full policy object is stored and surfaced in the UI.

### What is discovered

Mistral guardrails are stored per-agent under the `guardrails` object with the following shape:

| Field          | Type        | Description                                  |
| -------------- | ----------- | -------------------------------------------- |
| `provider`     | `"mistral"` | Identifies the guardrails source             |
| `scope`        | `"agent"`   | Policies are attached directly to this agent |
| `policy_count` | `integer`   | Number of guardrail policies on the agent    |
| `policies`     | `array`     | Raw Mistral policy objects — see below       |

Each entry in `policies` is the raw guardrails object returned by the Mistral Agents API. Fields vary by policy type but the `moderation_llm_v2` (v2) format includes:

| Field                        | Type                  | Description                                                    |
| ---------------------------- | --------------------- | -------------------------------------------------------------- |
| `block_on_error`             | `boolean`             | Whether to block when the moderation call itself errors        |
| `moderation_llm_v2`          | `string`              | Moderation model used (e.g. `"mistral-moderation-2411"`)       |
| `action`                     | `"block"` \| `"flag"` | What happens when a category threshold is exceeded             |
| `ignore_other_categories`    | `boolean`             | Whether categories not listed in thresholds are ignored        |
| `custom_category_thresholds` | `object`              | Per-category sensitivity scores (0.0–1.0, lower = more strict) |
| `jailbreaking`               | `object`              | `{"enabled": true/false}`                                      |
| `pii`                        | `object`              | `{"enabled": true/false}`                                      |

**Category keys in `custom_category_thresholds` (v2 taxonomy):**

| Key                       | Description                           |
| ------------------------- | ------------------------------------- |
| `sexual`                  | Sexual content                        |
| `hate_and_discrimination` | Hate speech and discrimination        |
| `violence_and_threats`    | Violence and threats                  |
| `dangerous`               | Dangerous activities                  |
| `criminal`                | Criminal content                      |
| `selfharm`                | Self-harm content                     |
| `health`                  | Medical / health misinformation       |
| `financial`               | Financial misinformation              |
| `jailbreaking`            | Prompt injection / jailbreak attempts |
| `pii`                     | Personally identifiable information   |

**Example `guardrails` object for a Mistral agent:**

```json theme={null}
{
  "provider": "mistral",
  "scope": "agent",
  "policy_count": 1,
  "policies": [
    {
      "block_on_error": true,
      "moderation_llm_v2": "mistral-moderation-2411",
      "action": "block",
      "ignore_other_categories": false,
      "custom_category_thresholds": {
        "sexual": 0.1,
        "hate_and_discrimination": 0.1,
        "violence_and_threats": 0.1,
        "dangerous": 0.1,
        "criminal": 0.1,
        "selfharm": 0.1,
        "health": 0.5,
        "financial": 0.5,
        "jailbreaking": 0.1,
        "pii": 0.2
      },
      "jailbreaking": {"enabled": true},
      "pii": {"enabled": true}
    }
  ]
}
```

### Agents without guardrails

If an agent has no guardrails configured in the Mistral API, the `guardrails` field will be `null`. TrustLens surfaces this as a **missing guardrails** finding so you can identify agents running without content safety policies.

***

## Feature availability

| Feature                     |                        API key only                        |                        + Beta access                       |
| --------------------------- | :--------------------------------------------------------: | :--------------------------------------------------------: |
| Model discovery             | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> |
| File discovery              | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> |
| Agent discovery             |          <span style={{color:'#dc2626'}}>No</span>         | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> |
| Document library discovery  |          <span style={{color:'#dc2626'}}>No</span>         | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> |
| Usage metrics               |          <span style={{color:'#dc2626'}}>No</span>         | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> |
| Version history and aliases |          <span style={{color:'#dc2626'}}>No</span>         | <span style={{color:'#16a34a', fontWeight:600}}>Yes</span> |

***

## Known limitations

| Limitation                | Details                                                                                                                                                       |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| No token usage metrics    | The Mistral API does not expose per-agent token consumption. This field will not appear in TrustLens.                                                         |
| Beta API dependency       | Core agent features depend on beta endpoints. If beta access is revoked or unavailable, agent-related features will degrade gracefully but will not function. |
| Rate limits               | Mistral enforces organisation-level rate limits. If syncs are failing with rate limit errors, consider reducing sync frequency.                               |
| No tenant-wide audit logs | Mistral does not provide an audit log or activity API for organisation-level agent usage.                                                                     |

***

## Security considerations

* The API key has access to all resources in your Mistral organisation. TrustLens uses it in a read-only pattern, but the key itself is not scoped to read-only by the Mistral platform.
* Rotate the API key regularly and update the integration in TrustLens when you do.
* TrustLens encrypts the API key at rest.
* If the key is compromised, revoke it immediately in the Mistral Console and create a new one.

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="No agents discovered">
    * Verify your workspace has beta API access enabled. Contact Mistral support if not.
    * Verify the API key is valid and not expired — go to [admin.mistral.ai](https://admin.mistral.ai) and confirm the key is listed.
    * Verify agents exist in your workspace by checking the Mistral Console.
  </Accordion>

  <Accordion title="Usage metrics unavailable">
    * Usage requires beta API access for the Conversations API (`/v1/conversations`).
    * Agents must have actual conversation activity to show metrics. Newly created agents with no usage will correctly show zero.
  </Accordion>

  <Accordion title="401 Unauthorized on any endpoint">
    * The API key is invalid or has expired.
    * Generate a new key in the Mistral Console and update the integration.
  </Accordion>

  <Accordion title="Agents showing null or missing guardrails">
    * The agent was created in Mistral without any guardrails policy attached. TrustLens reads and surfaces whatever is configured in the Mistral API — if none, `guardrails` is `null`.
    * To add guardrails, update the agent in the Mistral Console or via `PATCH /v1/agents/{agent_id}` to attach a `moderation_llm_v2` policy.
    * After adding guardrails, trigger a manual sync from the TrustLens integration settings page to pick up the new configuration immediately.
  </Accordion>

  <Accordion title="Document libraries not appearing">
    * Beta API access is required for the Libraries API.
    * Verify at least one document library exists in your workspace.
  </Accordion>
</AccordionGroup>
