Heimdall acts as a crucial security gatekeeper, sitting between Large Language Models (LLMs) and PostgreSQL databases. It allows AI clients to safely query and explore database schemas, answering questions without the risk of accidental or malicious data modification. By employing an Abstract Syntax Tree (AST) parser, Heimdall meticulously deconstructs every incoming SQL query, rejecting any command that attempts to mutate data (such as INSERT, UPDATE, DELETE, DROP, or ALTER) before it can even touch the database. This robust approach ensures critical production data remains protected, offering superior security compared to regex-based filtering.
Key Features
01High-performance PostgreSQL driver with connection pooling
02Prevents SQL injection and data mutation by LLMs
03Native Model Context Protocol (MCP) integration
040 GitHub stars
05AST-Based SQL Security for strict read-only enforcement
06Hexagonal architecture for decoupled and maintainable design