different approach for agentic AI for regulated industry - questions

Reddit r/AI_Agents News

Summary

Summarizes a deterministic, constraint-based approach for building AI agents in regulated finance, where the LLM only generates prose, numbers are cryptographically sealed, and auditability is ensured through separated layers.

Last time I learned how to use a graph as a workflow for AI agents. This time I learned something different from a friend. I think it's brilliant, but I'm looking for other opinions. What do you think about this? This is a summary of an article that I wrote for my own learning. The article is free available and contains code examples. The use case is for the finance industry (Europe, strict laws). I do not sell anything. You can read it. I do not track visitors at all. I just want to learn it. What do you think about this? Link to full article in the comment. Here is the summary: 1. Action Space: Open Discovery vs. Closed-World * **AI Agents usually:** The agent acts autonomously, dynamically searching for its capabilities (tools) at runtime and deciding freely how to solve a task. This often leads to unpredictable behavior or the agent accessing unauthorized tools. * **This Approach:** The agent operates within a pre-defined, strictly limited decision space. It can only perform actions explicitly listed on a "guest list" (declarative permission). While it can plan within this frame, it can never "invent" new capabilities. 2. The Role of the LLM: Generalist vs. Pure Copywriter * **AI Agents usually:** The Large Language Model (LLM) handles everything: it manages the process, performs calculations, makes decisions, and writes the final text. * **This Approach:** The LLM sits at the very end of the chain and **formulates prose only**. It has no decision-making or mathematical authority. Before the LLM is even called, the data passes through a strict ontology-like pack (validity check) and a deterministic rule engine (calculation). 3. Handling Numbers: Hallucination Risk vs. Physical Impossibility (sealed facts) * **AI Agents usually:** The LLM generates the report including the numbers. There is always a risk that the model will hallucinate or slightly alter figures. * **This Approach:** The LLM does not write a single number. A deterministic rule engine calculates the values and seals them with a cryptographic fingerprint. The model only provides text with **placeholders** (e.g., `"The loss was {loss_percent}%"`). Standard code then injects the sealed numbers into the placeholders. Numerical hallucination is therefore physically impossible. 4. Evaluations (Evals): AI-Judge vs. Deterministic fail-closed * **AI Agents usually:** To find errors, a second AI is often used (LLM-as-a-Judge) to read, interpret, and score the output of the first AI. Or Evals are implemented that test the output after the fact. * **This Approach:** There is no second AI judging the text. The check (**fail-closed**) is pure code. It compares the generated text against hard rules. If the check fails, the text is discarded and regenerated with stricter constraints. 5. Auditability & Traceability (Compliance) * **AI Agents usually:** The decision-making process is a black box. For regulators (like BaFin), it is extremely difficult to trace *why* the AI chose a specific threshold or reached a certain conclusion. * **This Approach:** The architecture is cleanly separated into three auditable layers: * **Ontology-like:** Defines vocabulary and validity (readable by business units). * **Decision Space:** Defines permissions (without calculation logic). * **Rule Engine:** Classic code for calculations. An auditor can test and sign off on these layers individually, ensuring that AI-generated prose and hard mathematics never get blurred. **In summary:** While traditional agentic approaches try to maximize intelligence and autonomy (catching errors afterward via AI Evals), this approach sets **hard, deterministic boundaries upfront**. The AI is not an independent actor but a tightly constrained tool within a pre-approved system, which is very helpful in highly regulated sectors like finance.
Original Article

Similar Articles

how to architect ai agents for regulatory approval?

Reddit r/AI_Agents

Explores how to architect AI agents for regulated industries like SaMD class II, balancing non-deterministic agent usefulness with deterministic safety zones to satisfy regulatory compliance.