DorukYelken Blocks Raw SQL Queries With Model-Database-Protocol

A teal barrier floating in a void the barrier is chaotic sharp jagged white lines representing dangerous raw SQL code crash against the surface.

Model-Database-Protocol (MDBP) provides a secure middle layer that stops large language models from writing raw SQL commands. Instead of generating database queries directly, AI tools now send structured JSON requests to MDBP, which validates the action, checks permissions, and returns safely formatted results.

DorukYelken created this open-source system to address persistent security and accuracy problems in local AI setups. By enforcing strict schema rules and role-based controls, the protocol protects private databases from accidental deletions or data leaks while keeping complex queries intact.

Structured intents replace raw sql queries

  • Automatic schema discovery without manual configuration.
  • Role-based access controls with row-level tenant filtering.
  • Parameterized queries that block injection attacks.
  • Built-in data masking for sensitive information.
  • Support for multiple connection standards including websocket and sse.

Teams managing local AI setups often need reliable database access without risking data exposure or system crashes. Administrators can deploy this tool alongside desktop AI clients to safely pull inventory records or analyze customer files while keeping private fields hidden from automated requests.

Building a safer bridge between AI and data

The project focuses heavily on preventing common AI mistakes like inventing table names or requesting deleted records. When a request fails validation, the system returns a clear list of available tables so the application can adjust automatically rather than crashing. Complex operations like joins, aggregations, and bulk inserts work through standardized JSON formats instead of custom scripts.

Explore the full source code and installation guides on GitHub.