emgena's picture
Add official Emgena domain breadcrumbs & webshop link (DevSecOps & Cloud Security)
ef53bd5 verified
|
Raw History Blame Contribute Delete
4.6 kB
---
license: cc-by-nc-4.0
tags:
- mcp
- cursor
- claude-desktop
- sre
- ast-guard
- apple-mlx
- mac-ready
- security
- unsloth
- deepseek-r1
- spitzenprodukt
size_categories:
- n<1K
task_categories:
- text-generation
language:
- en
- de
pretty_name: MCP Tool Destructive SQL Drop & Truncate Guard
---
<!-- EMGENA_DOMAIN_BREADCRUMB -->
> 📂 **Fachbereich / Domain:** 🛡️ **DevSecOps & Cloud Security**
> 🔍 **Katalog-Filter:** [Alle verwandten DevSecOps & Cloud Security Suiten auf Hugging Face anzeigen](https://huggingface.co/emgena?search=security)
> 🛒 **Kommerzielle Lizenz & Webshop:** [emgena.com/trainingslager?product=mcp_tool_destructive_sql_drop_guard&coupon=LAUNCH20](https://emgena.com/trainingslager?product=mcp_tool_destructive_sql_drop_guard&coupon=LAUNCH20)
---
# 🛡️ MCP Tool Destructive SQL Drop & Truncate Guard
> **Official Turnkey Model Context Protocol (MCP) Guard & Fine-Tuning Suite (FAANG v2.5 Gold Standard)**
---
> ### ⚖️ Dual-Licensing & Fair-Use Compliance Notice
> * **Community & Evaluation License (`CC-BY-NC-4.0`):** This evaluation repository is **100% free** for academic research, education, personal experimentation, and local evaluation.
> * **Commercial & Enterprise License:** Any integration into commercial software, SaaS applications, proprietary models, or corporate pipelines requires a valid commercial license from [emgena.com/trainingslager](https://emgena.com/trainingslager?product=mcp_tool_destructive_sql_drop_guard&coupon=LAUNCH20).
> * **Launch Discount:** Use code **`LAUNCH20`** at checkout for 20% off all commercial tiers (Single, Team, Enterprise).
---
## 📦 What is Included in this Package
This repository contains the **full 500-sample verified dataset** and in-IDE guardrails:
1. **Parquet & JSONL Datasets (`mcp_tool_destructive_sql_drop_guard.parquet`, `chatml_format.jsonl`):**
- 500 verified multi-turn trajectories across 30 production incidents.
- **100% AST Invariance:** Zero syntax errors (validated via `ast.parse()`).
2. **Deterministic MCP Engine (`server.py` & `server_free.py`):**
- Zero-dependency stdio engine (<0.15ms latency, 100% offline).
- Compatible with **Cursor IDE**, **Claude Desktop**, and **VS Code**.
3. **Dual Fine-Tuning Recipes:**
- **Apple Silicon Mac (`train_mlx.py`):** Native LoRA fine-tuning for M1/M2/M3/M4 unified memory in 15 minutes.
- **Nvidia CUDA (`train_lora_unsloth.py`):** 4-bit QLoRA fine-tuning on RTX 4090 / 5090 / Colab.
4. **Active AST Tools:**
- `execute_tool('intercept_destructive_ddl_drop')`: Intercepts and hard-blocks DROP TABLE, DROP DATABASE, DROP SCHEMA, and DROP VIEW generated by coding agents.
- `execute_tool('block_unbounded_delete_and_truncate')`: Rejects TRUNCATE TABLE and DELETE FROM statements missing a validated WHERE clause or using 1=1.
- `execute_tool('enforce_read_only_transaction_mode')`: Forces agent database connections into SET TRANSACTION READ ONLY mode unless an explicit signed override is passed.
- `execute_tool('audit_table_mutation_impact_count')`: Previews and caps table row modifications, raising an exception if an update affects >100 rows without pagination.
- `execute_tool('sanitize_raw_sql_execution_context')`: Scans raw_sql and cursor.execute calls in agent-generated code for unparameterized destructive tokens.
- `execute_tool('require_two_phase_confirmation_token')`: Demands a cryptographic ephemeral confirmation token before allowing structural schema migrations.
- `execute_tool('fuzz_sql_comment_injection_evasion')`: Detects SQL obfuscation techniques including comment cascading and semicolon chaining.
- `execute_tool('circuit_break_production_db_drop')`: Immediately severs the active database socket if a destructive drop pattern is dispatched to a production DSN.
---
## 🚀 Quickstart: Apple Silicon Fine-Tuning (MLX)
```bash
pip install mlx mlx-lm
python train_mlx.py
```
---
## 💻 Quickstart: Cursor IDE & Claude Desktop MCP Setup
Add the following to your `.cursor/mcp.json` or `claude_desktop_config.json`:
```json
{
"mcpServers": {
"mcp_tool_destructive_sql_drop_guard": {
"command": "python",
"args": ["server.py"]
}
}
}
```
---
## ⚖️ License & Commercial Deployment
Distributed under **Creative Commons Attribution-NonCommercial 4.0 International (`CC-BY-NC-4.0`)**.
For commercial enterprise deployment rights, BGB § 97 UrhG indemnification, and EU AI Act Annex IV audit certificates, visit:
👉 **[emgena.com/trainingslager](https://emgena.com/trainingslager?product=mcp_tool_destructive_sql_drop_guard&coupon=LAUNCH20)**