StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

LLM SQL Guard Architecture: Parser, Catalog, Policy Engine, Audit Log

23 May 2026 @ 4:27 pm

Recently, many teams are working on Text-to-SQL, ChatBI, or data analysis Agents. One underestimated issue is that generating SQL is just the first step; deterministic semantic, permission, and audit checks are required before going live. This article discusses: a technical blueprint for architecture reviews and POCs, explaining how SQL Guard is composed of parser, catalog binding, policy engine, risk scoring, and audit log. Key points: SQL Guard is not just syntax checking; it also requires catalog binding and policy context. The policy engine should output auditable decisions such as allow, warn, deny, or approval_required. Audit logs enable retrospective review of Text-to-SQL governance decisions. Original link:

SQL Semantic Validation for LLM-Generated Queries

23 May 2026 @ 4:25 pm

Recently, many teams are working on Text-to-SQL, ChatBI, or data analysis Agents. One underestimated issue is that SQL generated by LLMs should not directly enter production databases. This article discusses: a technical deep-dive explaining why syntactically correct SQL still requires catalog binding, name resolution, and semantic checks. Key points: Syntactic correctness does not equal semantic correctness. It is necessary to parse tables, columns, aliases, scopes, functions, and types using real catalog metadata. This is the key technical bridge from SQL Parser to SQL Semantic Governance. Original link: https://www.dpriver.com/blog/prom

Prompt Engineering Cannot Truly Secure LLM-Generated SQL

23 May 2026 @ 4:23 pm

Recently, many teams are working on Text-to-SQL, ChatBI, or data analysis Agents. One underestimated issue is that SQL generated by LLMs should not directly enter production databases. This article discusses: addressing the common misconception that "prompt rules can control generated SQL," and explaining why pre-execution validation is still necessary. Key points: Prompts can guide the model, but cannot enforce database security. Generated SQL requires deterministic pre-execution validation. The correct pattern is prompt guidance + parser/catalog/policy/audit checks. Original link: https://www.dpriver.com/blog/prompt-engineering

10 Security Risks of Text-to-SQL Before Going to Production

23 May 2026 @ 4:21 pm

Recently, many teams are working on Text-to-SQL, ChatBI, or data analysis Agents. One underestimated issue is that SQL generated by LLMs should not directly enter production databases. This article discusses: for teams currently launching Text-to-SQL, ChatBI, or database Agents, here are 10 categories of risks that must be checked before going live. Key points: Text-to-SQL security is not just about SQL injection. It also requires checking permissions, sensitive fields, high-cost queries, semantic errors, and auditing. This article serves as a pre-launch readiness checklist. Original link: https://www.dpriver.com/blog/text-

Managing instances in Spring Boot Admin

23 May 2026 @ 4:18 pm

I have a Spring Boot Admin running and my microservices registers to it correctly. When one of my microservice go down, Spring Boot Admin shows it as down. By restarting it, it will register again, and be visible as UP again. But the former instance that went down will still be visible. How to handle this? Also, is it possible to manually configure the instance id ? (See attached)

Why Enterprises Should Not Let LLMs Execute SQL Directly

23 May 2026 @ 4:17 pm

Recently, many teams are working on Text-to-SQL, ChatBI, or data analytics agents. An easily underestimated issue is: LLM-generated SQL should not directly enter production databases. This article discusses: A risk explanation for managers and architecture leads: There must be a validation layer between the LLM and the production database. Key Points: Letting LLMs execute SQL directly introduces security, permission, cost, and auditing risks. Prompts are not an enforcement mechanism. A deterministic SQL validation layer can turn generative SQL into a controllable process. Original Article Link:

What is an "LLM SQL Guard"?

23 May 2026 @ 4:13 pm

In building AI-powered database applications (e.g., ChatBI, Text-to-SQL), generating SQL from natural language is just the initial step. Before any system can be deployed, critical validation must be performed to ensure the SQL is not only syntactically correct but also safe and compliant. Key questions include: Does the SQL reference real tables and columns that exist in the current schema? Does it attempt to access sensitive data or fields the user is not authorized to view? Does it adhere to data governance policies and audit requirements? The concept of an "LLM SQL Guard" addresses these concerns. It is defined as a deterministic security and validation layer positioned between the Large Language Model (LLM) and the database execution engine. Its primary function is to perform mandatory, rule-based checks on any AI-generated SQL befor

How can i configure the SPI Peripheral correctly on STM32F103C8T6

23 May 2026 @ 3:57 pm

I have tried monitoring the output on the mosi pin with and oscilloscope but there is no output, I have followed the process of Initialising the clocks, disable and reset the SPI->CR1 Register, setup the gpio and then configure the CR1 register before enabling the spi interface, but when i test by running uint8_t buff[3] = {0x66, 0x11, 0x35} spi1_transmit_blocking(buff, buff_size); I always get 0xff on the SPI->DR register when viewing via debug mode /* * spi.c * * Created on: May 21, 2026 * Author: hillary */ #include "spi.h" void spi1_init(void) { RCC->APB2ENR |= (RCC_APB2ENR_SPI1EN | RCC_APB2ENR_IOPAEN); RCC->AHBENR |= RCC_AHBENR_DMA1EN; __DSB(); // Disable SPI1 SPI1->CR1 |= SPI_CR1_SPE; // reset cr1 register SPI1->CR1 = 0x0000; /* Setup SPI1 Pins */ // PA5 = SPI1 SCK // PA7 = SPI_MOSI GPIOA->CRL &= ~(GPIO_CRL_MODE5 | GPIO_CRL_CNF5);

C standard: Can successful fgets still set the EOF indicator?

23 May 2026 @ 2:17 pm

while (fgets(s, sizeof(s), f) != NULL) { if (feof(f)) { break; } } Consider the situation where fgets reaches EOF but did read something into s, and thus does not return NULL (it will next time). On that iteration of the loop, is it guaranteed according to the standard that feof will return true? This is probably a silly question, but I've always thought one should only call feof (and ferror) once the return value of an I/O function actually indicated failure.

API Platform 4 (Symfony 8): Best practice for password confirmation on DELETE operation (CQRS / Clean Architecture)

22 May 2026 @ 7:04 pm

I am using API Platform 4 with Symfony 8 and a CQRS + Clean Architecture approach. I have a security requirement: for sensitive DELETE operations (for example deleting a session or an account), I need to require a current password confirmation before executing the command. Current setup: API Platform (state processor pattern) Symfony 8 CQRS (CommandBus + Handler) Domain service responsible for password verification The flow looks like this: DELETE /api/auth/sessions/{id} → Processor → CommandBus (DeleteSessionCommand) → Handler → Domain service validates password → Repository deletes entity Currently, I pass the password via a custom HTTP header: X-CURRENT-PASSWORD: my_password In the API Platform processor: $currentPassword = $request->headers->get('X-CURRENT-PASSWORD'); $command = new Del