cd /news/ai-agents/what-if-ai-coding-agents-could-predi… · home › topics › ai-agents › article
[ARTICLE · art-152269] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

What If AI Coding Agents Could Predict a Bad Code Change Before Making It?

A developer built Preflight, an open-source tool that lets AI coding agents simulate refactoring plans on a graph representation of a codebase before editing source files. Using FalkorDB's GRAPH.COPY to create isolated graphs per plan, Preflight predicts impact, flags risky paths and ranks options; in an analysis of the invoke project it found a parameter change broke 59 call sites, one of which tests would miss because it was mocked. Tested against five real changes in cookiecutter, the tool currently supports Python function renames and parameter changes and has known static-analysis limits.

read2 min views1 publishedOct 18, 2026

AI coding agents usually follow this loop:

Make a change → Run tests → Fix errors → Try again.

But what if the first change was a bad idea from the start?

The agent may spend minutes or hours editing files and fixing errors, only to discover that another approach would have been much safer.

I wanted to help AI agents predict the impact of a code change before they start editing.

That is why I built Preflight.

GitHub: https://github.com/VigneshPA-30/preflight Imagine an AI agent wants to rename a function used across 50 files.

Instead of making the change immediately, what if it could first ask:

Preflight builds a graph of the codebase and simulates different refactoring plans on separate copies of that graph.

It predicts the impact of each plan, identifies risky paths and ranks the options.

The agent can then reject a bad approach before touching the actual source code.

The codebase is represented as a graph of functions, calls, imports, mocks and test relationships.

FalkorDB makes it possible to follow these connections across multiple levels. Its GRAPH.COPY feature lets Preflight create an isolated graph for each proposed change.

Each plan can be simulated separately without modifying the real graph.

This is not just about finding where a function is used. It is about understanding what could happen if we change it.

One interesting case came from my analysis of the open-source project invoke.

Changing a function's parameters broke 59 call sites.

Tests were expected to catch 58 of them. One could remain hidden because its test mocked the function.

Preflight identifies this as a masked breakage, helping the agent avoid trusting a path that looks safe but is not.

I tested Preflight against five real changes in the open-source project cookiecutter, comparing its predictions with the actual test failures.

The results:

These are early results from one project, not a guarantee for every codebase. Preflight currently supports Python function renames and parameter changes, and static analysis has known limits.

I believe the next step for AI coding agents is not just writing code faster.

It is knowing which path is worth trying before spending time on it.

Preflight is my attempt to make that possible: predict the impact, compare the options, abandon risky paths early, and only then make the change.

Simulate first. Choose wisely. Then edit.

── more in #ai-agents 4 stories · sorted by recency
── more on @preflight 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/what-if-ai-coding-ag…] indexed:0 read:2min 2026-10-18 · —