Credential detector
Mistral API key: format and detection
Short answer
Mistral keys have no fixed prefix, so Maskflare detects them by context: the word mistral in a variable name or nearby text, an assignment, and then 32 letters and digits.
What it is
The key authenticates calls to the Mistral API. With no prefix to anchor on, the detector needs the provider's name next to the value. It is in the Credentials pack and masked by default.
In Maskflare this is the detector mistral_api_key, labelled "Mistral API key", category password or access key, in the Credentials pack.
Format
- The word mistral (any case), up to about 50 characters of name before it and 20 after.
- An assignment such as =, :, :=, => or a comma, with optional quotes and spaces.
- 32 letters and digits.
How Maskflare recognises it
Keyword plus assignment plus a 32-character body with an entropy floor of 3.0.
The keyword prefilter skips any text without the word mistral.
Why this page shows no sample key
A realistic sample key would look like a live credential to secret scanners and to anyone skimming the page, and an obviously fake one would not pass this detector's length and entropy rules. The format above is enough to recognise the key: the prefix, the length and the character set.
Regex and validation caveats
- A key with no label, for example one alone on a line, is not recognised by this rule. Generic secret rules in the Global pack, which look for key, token, secret or password assignments, may still catch an assignment such as API_KEY=.
- A different variable name that does not contain mistral, such as LLM_KEY, is not matched by this rule.
- Any 32-character alphanumeric value after the word is taken to be the key, so a model name or hash assigned to a variable called mistral_something can be masked.
How to detect it in LLM traffic
These keys travel in environment files and SDK initialisation code, where the variable name carries the provider's name. That is the case the rule is built for.
Maskflare reads the whole request body, including the system prompt, earlier messages and tool arguments, and replaces each match with a token such as mf_mask_d7e0 before the request goes out. Coding agents are covered through hooks that mask tool inputs and results, so a key printed by a shell command does not travel onward in the next prompt. On ChatGPT, browser protection blocks prompts that contain API keys, tokens or private keys outright.
If you build the detection yourself
- Scan the raw text rather than parsed fields: keys sit in code, JSON strings, headers, shell output and pasted logs, often with no label at all.
- Match the prefix and the exact length for the Mistral API key. Where the key has no fixed prefix, require the provider's name and an assignment next to the value instead of matching any long string.
- Compute the Shannon entropy of the candidate and reject low values, and keep an allow list of placeholders (${KEY}, repeated characters, the alphabet run), because documentation and templates are full of them.
- Mask the value before the text is sent anywhere. If the key was already sent, treat it as exposed and rotate it; masking later does not recall it.
How Maskflare handles it
- Protect now, Finance - Protect now, Healthcare, Developer and Monitor first: mask (a reversible token).
The available actions are mask (reversible token), redact, partial, hash, format-preserving encryption, generalize, alert and block. Masked values are kept encrypted for 30 days so that answers can be restored, then they expire; prompts and responses are not logged. The full list of detectors is in the detector reference.
Compliance profiles that include it
All 6 compliance profiles include the Credentials pack, and applying them turns this detector on: HIPAA Safe Harbor, GDPR - EU/EEA, UK GDPR, PCI DSS, US personal data and Switzerland - nDSG health data. A profile is a floor: it never turns anything off or weakens a rule that is already stricter.
Frequently asked questions
Why does the Mistral detector need the word mistral?
The key has no prefix. A 32-character alphanumeric string without a label cannot be told from many other identifiers.
Is MISTRAL_API_KEY detected?
Yes. The name contains the word and is followed by an assignment and a 32-character value.
Is the Mistral API key detector on by default?
Yes. It belongs to the Credentials pack, which the default Protect now template turns on with the action mask.
Does Maskflare store the keys it masks?
Prompts and responses are not logged. A masked value is kept encrypted for 30 days so the answer can be restored, then it expires.
Rules on this page describe what Maskflare's detectors and validators check. They are read from the detection catalogue and are not the specification of the body that issues the identifier. No sample key is shown on purpose.