SShortSingh.
Back to feed

Why Prompt-Based AI Approval Gates Can Be Bypassed and What to Use Instead

0
·3 views

AI agents that rely on prompt instructions to enforce user approval before sensitive actions like money transfers can be manipulated by users or prompt injections into skipping those checks. Developer guidance from Genkit highlights two distinct human-in-the-loop patterns: interrupt-as-a-tool, where the LLM decides whether to request approval, and restartable tools, where a hard-coded logic gate in the application code enforces the check. Because the interrupt-as-a-tool pattern depends on a system prompt instruction, a persuasive input can convince the model to bypass the confirmation step entirely. Restartable tools, by contrast, run a deterministic code-level check that the LLM cannot override or forge, making them suitable for security- and money-critical operations. Developers are advised to use prompt-based interrupts only for low-stakes clarifications and to rely on restartable tools whenever financial or security controls must be strictly enforced.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

AI Lets Anyone Build Apps Fast, But Who Fixes Them When They Break?

AI coding tools now allow people with no programming background to build functional apps — complete with authentication, databases, and a working UI — in a single afternoon. While this democratizes software creation, experienced developers warn it bypasses the mental models needed to diagnose failures or handle unexpected edge cases. The concern is not that AI-assisted builders lack skill, but that they possess the output of understanding without the underlying framework to troubleshoot when things go wrong. Observers note the divide ahead will not be between AI users and non-users, but between those who use AI as a shortcut around understanding versus those who use it as a scaffold toward it. The broader debate remains nuanced: much traditional coding knowledge was rote memorization rather than genuine expertise, yet the ability to reason through failures still requires depth that prompting alone does not build.

0
ProgrammingDEV Community ·

Google's Genkit Builds AI Agents From Small Reusable Primitives, Not Monolithic Classes

Google's Genkit framework takes a compositional approach to building AI agents, using a small set of shared primitives — tools, middleware, interrupts, sessions, and streaming — rather than a large, complex Agent class. A functional agent can be defined in roughly 10 lines of code using ai.defineAgent() with a system prompt, tools, and an optional session store. State management is flexible: developers can choose server-managed sessions by passing a store, or let the client manage state by omitting it, with the same agent API in both cases. Interrupts allow any tool call to pause execution and hand control back to the developer, enabling human-in-the-loop workflows without special-purpose features. Middleware, sub-agents, and approval gates all build on the same underlying primitives, and agents can run identically on both server and browser environments.

0
ProgrammingDEV Community ·

Developer builds Klein blue terminal theme after finding pure IKB unreadable as text

A developer who uses Claude Code extensively created a custom terminal theme optimized for reading long-form prose rather than syntax highlighting. The theme is anchored to Yves Klein's IKB ultramarine pigment (hex 002FA7), patented in 1960, but pure IKB proved unreadable as text on dark backgrounds due to a near-zero APCA legibility score. To work around this, the developer split the color across two terminal slots — using pure IKB decoratively and a lighter Klein-family blue for readable permission-prompt text. The theme ships in four variations, with the strictest version requiring all color roles to meet defined APCA contrast thresholds for body text, subtle text, and accents. It is built as macOS Terminal.app profile files with install and rollback scripts, and requires Claude Code's theme setting to be switched to dark-ansi mode to function correctly.

0
ProgrammingDEV Community ·

Normalization vs. Denormalization: Choosing the Right Database Design Strategy

Database normalization breaks data into smaller, related tables to eliminate redundancy, ensuring data integrity and efficient writes, but often requires complex multi-table JOIN queries that can slow performance. Denormalization takes the opposite approach, intentionally duplicating data across tables to enable faster reads, at the cost of update complexity and potential inconsistency. Transactional systems generally benefit from normalized schemas, while analytical systems such as dashboards and reports tend to favor denormalized structures for speed. Many production environments use both, maintaining a normalized operational database alongside a denormalized data warehouse connected via an ETL pipeline. Experts recommend starting with a normalized schema and selectively denormalizing only where query performance becomes a measurable problem.