## TL;DR
Remove the agent freedom to invent reference values. Require every metric, field, owner and date the agent puts in the dashboard to come from a lookup result in the same run, a schema read, a metric catalog query, or a Power BI REST API list call, and validate the finished spec against those lookups before publishing. Hallucinated dashboard owners who left the company pass casual review because they look plausible, so only a mechanical existence check catches them reliably.

```text
agent hallucinating dashboard owners who left the company: generated wrong values and validation failed with error
```

## Use this when
- Validation or the Power BI REST API rejects the generated dashboard for referencing entries that do not exist.
- The generated spec contains plausible names that nobody on the team recognises.
- The agent was given a goal and little or no live schema or catalog context for the build.

## Not for this skill when
- The agent used real names but assembled them into a wrong calculation. That is a logic error, reviewed differently.
- The referenced entries existed but were renamed after the build. That is a drift problem, handled by revalidation on publish.

## Steps
1. Collect the rejected values from the validation output and check each one against the live system through the Power BI REST API or a warehouse schema read. Verify: every rejected value is confirmed absent from the live system
2. List the lookups the build actually needs, such as the metric catalog, the table schema, the user directory, or the allowed value lists, and add a retrieval step for each before generation. Verify: each category of reference value has a named lookup source
3. Change the generation step so reference values are copied from lookup results, and the agent must cite the lookup entry for each value it uses. Verify: a sample generated spec traces every reference value to a lookup result
4. Add a validation gate after generation that checks every reference value in the spec against the live lookups and fails the run with the offending values listed. Verify: a seeded spec containing an invented value fails at the gate
5. Where a requested item genuinely has no match, make the agent stop and report the gap instead of substituting a plausible alternative. Verify: a test request for a missing metric ends with a gap report, not an invented metric
6. Rerun the original build and confirm the dashboard passes validation and renders in Power BI. Verify: the run completes and every chart shows data

## Why it happens
Hallucination in agent builds is a context problem before it is a model problem. Asked to produce a complete spec, the model completes it, inventing the missing references in the style of the real ones. Systems that separate retrieval from generation, and that validate references mechanically, get the fluency without the fiction. The gate matters most because human reviewers are worst at exactly this check, plausible names slide past tired eyes.

When the agent builds a dashboard for Power BI it must name real things, metrics, fields, people and ranges that exist in the target system. Language models fill gaps in the supplied context with statistically likely names, and dashboard vocabulary is generic enough that invented entries read as real. The failure surfaces at validation or, worse, after publishing, when a chart references dashboard owners who left the company and the build is rejected or silently shows nothing. Grounding turns each name into a retrieved fact instead of a guess.

Operational notes for grounding failures in agent pipelines. Keep the lookup results the agent used in the run artifacts, so a disputed dashboard can be audited back to exactly what the system of record said at build time. Disputes about invented values otherwise degenerate into opinion, because the live system may have changed since the run. The artifact also improves the next run, since recurring missing entries in the catalog become a visible backlog for the data team instead of a series of one off agent failures.
## Variants and edge cases
### agent invented dashboard owners who left the company grounding lookup validation
The grounding phrasing for retrieval before generation.
### dashboard spec validation references do not exist agent
The validation gate variant naming the existence check.
### agent should stop and report missing metric not invent one
The behaviour variant for honest gap reporting.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_9pTZpWnInnrkoCcQ1O_pSQ
