Why Your AI Agent Hallucinates: Engineering Lessons From a Production Workflow Builder in Drupal
29 Sep 2026, 11:30 am (UTC)
45 Minutes
Speakers
LLM-driven Drupal features can fail when they reach real editors and site builders, with problems including hallucinated field names, partially applied state changes, prompt injection, rising token costs as context grows, and difficulty tracking newly created IDs. FlowDrop Chat, a workflow builder that uses natural-language chat to create and modify visual workflows in Drupal, serves as the case study for examining these failures.
The code-level walkthrough covers engineering choices made around the model, including a small domain-specific language, slimmer context, predictable identifiers, prompt-injection defenses, atomic batched commands with rollback, and a self-hosted prompt pipeline delivered as a workflow. It also addresses encoding prior failures as worked examples and anti-patterns in the system prompt.
- Choose an LLM output format suited to the task, including when a small DSL is preferable to JSON tool-calling.
- Separate information the model needs from information the system stores, and validate or wrap user-supplied content to reduce prompt-injection risk.
- Use predictable identifiers and make agent actions atomic and reversible.
- Ship prompt improvements as configuration by using the agent through its own platform.