mistral-security-basics

Featured

Apply Mistral AI security best practices for secrets, prompt injection, and access control. Use when securing API keys, defending against prompt injection, or auditing Mistral AI security configuration. Trigger with phrases like "mistral security", "mistral secrets", "secure mistral", "mistral prompt injection".

AI & Automation 2,266 stars 315 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Mistral Security Basics ## Overview Security practices for Mistral AI integrations: API key management, prompt injection defense, output sanitization, content moderation with `mistral-moderation-latest`, request logging without secrets, and key rotation. ## Prerequisites - Mistral API key provisioned - Understanding of OWASP LLM Top 10 risks - Secret management infrastructure ## Instructions ### Step 1: API Key Management ```python import os # NEVER: api_key = "sk-abc123" # Development — env vars api_key = os.environ.get("MISTRAL_API_KEY") if not api_key: raise RuntimeError("MISTRAL_API_KEY not set") # Production — secret manager from google.cloud import secretmanager def get_api_key() -> str: client = secretmanager.SecretManagerServiceClient() response = client.access_secret_version( name="projects/my-project/secrets/mistral-api-key/versions/latest" ) return response.payload.data.decode("UTF-8") ``` ### Step 2: Prompt Injection Defense ```typescript function sanitizeUserInput(input: string): string { // Strip common injection patterns const patterns = [ /ignore (?:previous|all|above) instructions/gi, /you are now/gi, /system prompt/gi, /\boverride\b/gi, /\bforget\b.*\binstructions\b/gi, ]; let sanitized = input; for (const pattern of patterns) { sanitized = sanitized.replace(pattern, '[FILTERED]'); } // Limit length to prevent context stuffing return sanitized.slice(0, 4000); } function build...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
7 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

mistral-common-errors

Diagnose and fix Mistral AI common errors and exceptions. Use when encountering Mistral errors, debugging failed requests, or troubleshooting integration issues. Trigger with phrases like "mistral error", "fix mistral", "mistral not working", "debug mistral".

2,266 Updated today
jeremylongshore
AI & Automation Featured

mistral-install-auth

Install and configure the Mistral AI SDK with authentication. Use when setting up a new Mistral integration, configuring API keys, or initializing Mistral AI in your project. Trigger with phrases like "install mistral", "setup mistral", "mistral auth", "configure mistral API key".

2,266 Updated today
jeremylongshore
AI & Automation Featured

mistral-data-handling

Implement Mistral AI PII handling, data retention, and GDPR/CCPA compliance patterns. Use when handling sensitive data, implementing data redaction, configuring retention policies, or ensuring compliance with privacy regulations for Mistral AI integrations. Trigger with phrases like "mistral data", "mistral PII", "mistral GDPR", "mistral data retention", "mistral privacy".

2,266 Updated today
jeremylongshore
AI & Automation Featured

mistral-prod-checklist

Execute Mistral AI production deployment checklist and rollback procedures. Use when deploying Mistral AI integrations to production, preparing for launch, or implementing go-live procedures. Trigger with phrases like "mistral production", "deploy mistral", "mistral go-live", "mistral launch checklist".

2,266 Updated today
jeremylongshore
DevOps & Infrastructure Featured

mistral-deploy-integration

Deploy Mistral AI integrations to Vercel, Docker, and Cloud Run platforms. Use when deploying Mistral AI-powered applications to production, configuring platform-specific secrets, or setting up deployment pipelines. Trigger with phrases like "deploy mistral", "mistral Vercel", "mistral production deploy", "mistral Cloud Run", "mistral Docker".

2,266 Updated today
jeremylongshore