Hub rules-mistral

rules-mistral

v3 public Verified

Mistral

Mistral is a suite of high-performance LLMs developed by Mistral AI. These rules provide governance for applications using Mistral models, focusing on secure prompt engineering, efficient API usage, and adherence to safety guidelines.

@sigmashakeinc 2 pulls 6 rules published Apr 8, 2026 synced Nov 22, 2026 sigmashakeinc/rules/rulesets/rules-mistral →
Severity
4 error 2 warn 0 info
demo.cast
Mistral is a suite of high-performance LLMs developed by Mistral AI. These rules provide governance for applications using Mistral models, focusing on secure prompt engineering, efficient API usage, and adherence to safety guidelines.

Rules index

6 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

mistral

mistral-no-eval-of-model-output error block

eval() on Mistral model output enables remote code execution (CWE-94). Any instruction the model was trained on, fine-tuned with, or injected into via prompt injection can cause eval() to execute arbitrary code on the host. Never eval() LLM output; use JSON.parse() for structured data and validate the schema before using it.

Rule source requires an active Pro or Enterprise subscription.
mistral-no-hardcoded-api-key error block

Hardcoded Mistral API key (CWE-798). Mistral API keys grant full access to all models, fine-tuning, and billing. Keys committed to source are scanned by automated tools within minutes of a git push. Use environment variables (os.environ['MISTRAL_API_KEY'] / process.env.MISTRAL_API_KEY) and add the key to .gitignore-protected .env files.

Rule source requires an active Pro or Enterprise subscription.
mistral-no-logging-full-response warning log

Logging full Mistral API responses may record sensitive user data, PII, or confidential context that was included in the prompt. API responses should be logged at the field level (log response.usage, response.model) not as full objects. Ensure logs are not shipped to external services without scrubbing.

Rule source requires an active Pro or Enterprise subscription.
mistral-no-unvalidated-function-call-exec error block

Executing shell commands derived from Mistral function/tool call results without validation is a tool-call injection vector. Mistral tool-calling outputs must be validated against an explicit allow-list of function names and parameter schemas before any system call. An attacker who can influence the context (via prompt injection or training-data poisoning) can inject arbitrary tool call arguments.

Rule source requires an active Pro or Enterprise subscription.
mistral-no-user-input-in-system-prompt error block

Prompt injection risk: user-controlled input is interpolated directly into a system-role message. An attacker can override system instructions with jailbreak sequences or data exfiltration commands. System prompts define the model's rules and constraints — they must be static constants. Separate user input into user-role messages only and never allow it to flow into the system role.

Rule source requires an active Pro or Enterprise subscription.
mistral-outdated-client-api warning log

mistral.client / MistralClient is the legacy v0.x SDK API. The current SDK (v1+) uses 'from mistralai import Mistral' and 'client = Mistral(api_key=...)'. The old client is no longer maintained and does not receive security patches. Migrate to the current SDK.

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Nov 22, 2026
Hash
843c21b368b7ada5b9f5530413fb7bb996be7e860bc889ca5c931ca8f55fcce0
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-mistral/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-mistral. The published version only bumps when a maintainer resyncs.

No commit history available.