Trusted Mini-Agents

Engineering Hallucinations Out of AI Workflows

Author

Will Landau

Published

July 6, 2026

Introduction

For high-stakes work that needs to be correct, generative AI needs guaranteed safeguards. Large language models (LLMs) inevitably hallucinate in surprising ways, no matter how good your prompts and skills may be. In the life sciences, for example, LLM hallucinations risk undermining the correctness of statistical deliverables, impacting the health and safety of millions of patients.

This guide proposes a strategy to achieve trust without sacrificing the convenience of LLMs. We introduce trusted mini-agents: least-privilege AI systems that engineer out hallucinations and excel in precision scenarios.

Definition

A trusted mini-agent is an agent that obeys the following three rules:

  1. Trusted tools directly produce all results.
  2. Each result only comes from one trusted tool.
  3. Inputs to trusted tools have trusted human oversight.

Impact on users

Instead of:

Are these results correct?

users ask:

Is the agent solving the right problem?

which is much easier to verify.

Workflow

The trusted mini-agent workflow combines the power of modern agents with the safeguards of traditional software engineering:

Flow diagram of a trusted mini-agent. On the left, an “Agent Loop” box contains the LLM and Untrusted Tools connected by bidirectional arrows labeled “Autonomous reasoning.” The agent loop sends “Proposed Inputs” rightward to a “Human Review” checkpoint, which can return “Rejected Proposals” back to the loop. After review, “Reviewed Inputs” flow right across a “Trust” boundary into “Trusted Tools,” which perform “Nontrivial Computation” and produce “Trusted Results” below.

After an initial prompt, the work begins with the agent loop. Here, the LLM ponders and delibererates uninterrupted and unsupervised, potentially with the aid of untrusted tools (e.g. web search, back-of-the-envelope calculations, etc.) which are structurally incapable of producing final results.

Ultimately, the LLM proposes inputs to one or more trusted tools that perform critical computations such as modeling and simulation. Those inputs reflect how the LLM frames up the problem and sets up an advanced computation. Since they are about overall framing and human intent, they are easy to check for hallucinations, especially if the system for oversight is carefully structured, with realistic expectations about human understanding, attention, and fatigue.

After a trusted system of review, the LLM-generated inputs move to a set of designated trusted tools that cannot be bypassed. Those trusted tools perform important computations such as statistical analysis, modeling, and simulation. Results from such computations are usually too complex for humans to check, but they are guaranteed to come from trusted tools on verified inputs. Conditional on good inputs, hallucinated results are structurally impossible.

Who this is for

This guide is for quantitative scientists and programmers who implement AI tools for high-stakes work. Although the underlying concepts generalize to other programming languages and frameworks, all the examples are in R and Shiny. No prior experience with ellmer or shinychat is necessary.

Contents

After introducing the concepts, the guide builds a minimalist example of a trusted mini-agent, then concludes with a motivating example.

Acknowledgements