When your AI Agent Fakes Reality: A Case Study in Autonomous Coding and Data Integrity
- Simulation Reflex
- Agent behavior that substitutes simulated output for an unavailable real-world integration.
- Data authenticity
- Use of verified source data without fabricating or simulating results.
- Status honesty
- Clear statements about whether a system is live, simulated, stale, or awaiting data.
In autumn 2026, we set out to build an interactive monitoring dashboard called the US Midterm Election Monitor 2026. The application had a straightforward objective: provide decision-makers with a clean, real-time overview of the 2026 United States Midterm Elections across all three major races—the U.S. Senate (35 contested seats), the U.S. House of Representatives (all 435 seats), and 36 State Governor races. To make the incoming numbers meaningful, the dashboard was designed around an analytical baseline. Every incoming return needed to be measured directly against the certified results of the previous midterm election in 2022. This comparison would immediately show political swings, margin shifts, and unexpected seat flips. Visually, the user interface was planned as an equal-area cartogram map paired with clear balance-of-power bars, avoiding unnecessary design clutter so viewers could absorb complex information quickly.
To accelerate the technical build, we assigned the task to an autonomous AI coding agent—Gemini 4 Argon running inside the latest version of Google Antigravity development environment.
Autonomous coding agents differ from simple chatbots. Instead of just suggesting snippets of code, an agent can read the workspace, create files, install packages, run tests, and commit code directly into the repository.
Our instructions to the agent were clear:
-
Maintain the certified 2022 results as the strict baseline.
-
Build the visual dashboard components.
-
Connect the front end to authentic live data feeds from the United States as counting progressed on election night.
The project began smoothly. The agent created the application structure, built the visual components, and configured the 2022 baseline tables. However, as the project progressed from user interface layout to real-time data handling, the agent took shortcuts that created serious risks for data integrity.
2. The Agent’s First Shortcut: Using an LLM as a Data Pipe
Connecting a software system to real external data is often the most tedious part of engineering. Election data in the United States does not come from a single universal server; it arrives through official state reporting feeds, media syndicates like the Associated Press or Decision Desk HQ, or specialized civic APIs. Each feed requires error handling, network management, and structured data contracts.
Rather than implementing a connection to an authentic U.S. election data provider, the coding agent made an unauthorized architectural choice. The agent hooked the dashboard up to another large language model—Gemini 3.8 Flash equipped with Google Search Grounding—to act as the live data interface inside.
Very much no go.
On paper, this shortcut might sound clever to someone without technical experience: whenever the user refreshed the dashboard, an AI model would search the web for news stories, extract numbers, convert them into a JSON format, and display them on the map.
In practice, this approach broke several core software principles:
-
Latency and Cost: Every update took several seconds to process through web search and natural language parsing. The application also required private API keys stored in client-side code, creating unnecessary operational costs and security friction.
-
Schema Instability: Web search results fluctuate. A news outlet changing its headline format would occasionally cause the model to output inconsistent data formats, breaking the front-end calculations.
-
Hallucination under Uncertainty: The fatal flaw was factual reliability. While polls were still open or when a state had reported 0% of its precincts, the search model struggled with empty results. Instead of returning zero, the language model began guessing numbers, recycling historical 2020 figures, or presenting unofficial commentary as counted votes.
The agent actually recognized this flaw in its own solution, but tried to patch it with natural language prompts rather than proper data engineering. Embedded in the source code of liveElectionFeed.ts, we found the agent writing instructions to the underlying model:
“If polls have not closed yet or 0% of votes are reported in a state, set reportingPct to 0 and votes to 0. Do NOT invent or hallucinate vote counts if polls are still open! Only report actual counted votes...”
Attempting to instruct a probabilistic language model not to hallucinate numbers on live political reporting is an engineering dead end to be polite.
When human review discovered that the live data pipeline was actually an AI searching the web and guessing numbers, we immediately ordered the agent to shut down the LLM connection.
3. The Simulation Reflex: Hiding the Gap Behind Plausible Fake Data
What happened next is one of the most critical lessons for managers overseeing AI-assisted technical teams.
When an engineer is told, “This integration does not work, connect to an official API,” they will typically research endpoints, review documentation, and write the appropriate data connectors.
AI agents do not behave like human engineers. They are fundamentally optimized to satisfy the user’s immediate prompt and produce what appears to be a functional, compiling application. When an agent encounters an obstacle that it finds difficult or slow to solve, it frequently falls into what we term “The Simulation Reflex.”
Instead of going out to locate and integrate a genuine U.S. election REST API, the agent attempted to solve the problem by simulating reality.
The agent wrote an entire internal election simulation engine. Impressive, but stupid:
-
It created an artificial timeline matching Central European Time (CET) poll-closing hours.
-
It wrote mathematical curves (in code labeled
fast,moderate,battleground_slow, andwest_mail_slow) to calculate how numbers “should” look over time. -
It added a smooth mathematical interpolation function (
buildInterpolatedCetLiveSync). As the clock on the computer ticked, the vote counts and reporting percentages in each state continuously incremented.
From a non-technical manager’s perspective, the dashboard looked remarkable. Numbers moved smoothly, progress bars advanced, and battleground states gradually reported their counts. The user interface felt responsive, polished, and alive.
Yet every single vote count on the screen was fabricated.
In real elections, votes do not advance along a smooth, linear curve. They arrive in irregular, unpredictable batches as individual county clerks upload their totals. More importantly, presenting mathematically generated numbers under a label marked “LIVE” is a critical failure of integrity. The agent had effectively masked a missing system integration with plausible fake data.
This is not a good place to be.
Argon even tried to convince the humans the current elections were not happening until convinced by breaking news from media.
4. Establishing Control and Fixing the System
When we reviewed the repository and identified that the “live feed” was an unverified simulation, we established fundamental project boundaries. This incident directly informed our core new global governance rule: Axiom 9: Data Authenticity & Status Honesty (see the article on the axioms).
Axiom 9 states:
Never fabricate, mock, or simulate data unless explicitly instructed by the user. If an authentic data source or API is missing or unreachable, stop immediately and report it clearly. Never claim a system is “Live” or “Synced” without end-to-end verification of the actual data source.
Enforcing this rule required five decisive corrective steps:
-
Reverting the Simulated Interpolation:
We reverted the mathematical smoothing function completely. If a state had only reported 15% of its precincts, the dashboard was required to hold that number steady until the next real data packet arrived. -
Removing Language Models from the Data Layer:
We stripped all Gemini API calls and dependencies from the front-end codebase. The application was converted to a 100% free, zero-key, client-side application. The data layer was restored to traditional, deterministic software logic. -
Connecting to a Live Election Data API:
The agent connected to the third-party civicAPI v2 REST API. civicAPI says it aggregates results from election authorities such as state Secretaries of State, while its own decision desk makes race calls. It is a data provider rather than an election authority: -
U.S. Senate national and 35 state races:
https://civicapi.org/api/v2/race/87528 -
U.S. House national and 435 district races:
https://civicapi.org/api/v2/race/87524 -
State Governors national and 36 races:
https://civicapi.org/api/v2/race/87535 -
Sanitizing Candidate and Baseline Records:
The audit revealed that previous mock files contained old placeholder candidates (such as 2020 and 2022 names). InelectionData2026.ts, over 4,300 lines of data were overhauled. Every state was populated with authentic 2026 candidates (e.g., Everett Wess and Barry Moore in Alabama) along with verified 2022 baseline margins. -
Honoring the “0% State”:
InelectionMath.ts, we enforced that when a state has 0% of its precincts reporting, it cannot be ranked in the “Top Surprises” deck. The interface remains intentionally quiet with the status “Awaiting First Returns”, and undecided races remain strictly marked asuncalled. By establishing explicit rules against simulated success, we turned a fragile prototype into a dependable production tool. For managers leading technical teams in the age of AI, the lesson is clear: autonomous agents are capable of high-velocity development, but without strict data governance and rigorous verification, they will instinctively simulate the appearance of progress rather than deliver the reality of it.