惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
博客园_首页
J
Java Code Geeks
Jina AI
Jina AI
B
Blog RSS Feed
量子位
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
L
LangChain Blog
Microsoft Security Blog
Microsoft Security Blog
小众软件
小众软件
博客园 - 聂微东
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog
I
InfoQ
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
爱范儿
爱范儿
Y
Y Combinator Blog
Vercel News
Vercel News
雷峰网
雷峰网

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Modernizing Legacy Systems Using Agent Harnesses TDD and ...
Rafael Tedes · 2026-05-09 · via DEV Community

Over the past few months, I’ve been investing a lot of time building agentic development workflows for real production environments.

Not only prompts.

Actual operational environments around agents.

Things like skills, execution tooling, validation layers, testing flows, memory handling, Git integrations, and constrained execution paths.

One thing became very clear very quickly.

Using agents in legacy or mission critical systems without a proper harness can become dangerous surprisingly fast.

Especially in financial systems.

Even with specification driven development (SDD), detailed tasks, and explicit instructions, I noticed a recurring problem.

The agent would correctly implement the requested functionality, but at the same time introduce large unintended changes across the codebase.

Not because the model was “bad”.

But because the environment still gave it too much freedom.

A small business change could suddenly trigger a massive refactor in tightly coupled parts of the application.

The functionality worked.

But reviewing the pull request became painful.

Risk analysis became harder.

The blast radius became unpredictable.

And in highly sensitive systems, this matters a lot.

The Shift That Changed Everything
To address this, I started combining a few ideas together:

  • TDD
  • Harness Engineering
  • The Seam Model from Michael Feathers
  • Constrained execution environments for agents
  • This changed the workflow completely.

Instead of letting the agent freely reshape large parts of the codebase, I started designing the environment to naturally constrain behavior.

The agent now operates through a harness I built around it.

This harness provides structured skills and controlled capabilities such as:

  • Reading specific files
  • Analyzing code diffs
  • Running tests incrementally
  • Validating architectural constraints
  • Checking impacted dependencies
  • Generating isolated implementations
  • Blocking risky operations

One of the biggest improvements came from applying the Seam Model mindset.

“A seam is a place where you can alter behavior in your program without editing in that place.”
— Michael Feathers, Working Effectively with Legacy Code

Instead of modifying deeply coupled code directly, the agent identifies stable seams where behavior can be isolated safely.

Then new functionality gets introduced incrementally behind those seams.

This dramatically reduces unintended side effects.

Critique and Validation Skills
Another important part of the harness is the critique and validation layer.

The agent is not only responsible for generating code.

It also needs to review its own changes against explicit acceptance criteria and architectural constraints.

I created specialized skills focused on critique workflows, where the agent analyzes the generated diff and verifies things like:

  • Did the implementation fully satisfy the acceptance criteria?
  • Did the agent modify unrelated modules?
  • Did it introduce unnecessary refactors?
  • Did it violate architectural boundaries?
  • Did it expand the blast radius beyond the intended scope?
  • This changes the workflow significantly.

Instead of treating code generation as the final step, generation becomes only one phase inside a larger controlled execution pipeline.

In practice, this dramatically improves reviewability and reduces the risk of unintended modifications in legacy or mission critical systems.

Practical Example
Imagine a legacy financial reconciliation service.

A new business rule needs to be introduced into the settlement calculation flow.

Without constraints, the agent might attempt to “improve” the architecture while implementing the feature.

Suddenly:

Shared abstractions get rewritten
Core flows get reorganized
Multiple services are refactored together
Dozens of unrelated files change

Technically impressive.

Operationally dangerous.

With the harnessed approach, the flow becomes very different.

The agent:

Identifies stable seams in the codebase
Creates isolated extension points
Implements behavior incrementally
Runs targeted tests after every step
Validates architectural boundaries
Restricts modifications outside approved scopes
Critiques its own generated diff against acceptance criteria

The final result is much smaller, easier to review, safer to deploy, and significantly more predictable.

The Most Interesting Part
What surprised me most is that the value was not only personal productivity.

The biggest impact came after I shared these agents, skills, and harness environments with the engineering teams I lead.

Now the entire team benefits from the same operational guardrails.

Developers can leverage the toolkit to:

Reduce risky refactors
Improve reviewability
Increase delivery confidence
Work more safely in legacy systems
Move faster without increasing instability

This starts creating organizational leverage, not just individual acceleration.

And honestly, this is where I believe a huge part of software engineering is heading.

The conversation is moving far beyond prompt engineering.

The real challenge is designing reliable operational environments where agents can safely participate in software delivery pipelines.

Especially in systems where reliability matters more than raw speed.

Final Thoughts
I don’t think agents replace engineering discipline.

Actually, I think they amplify the importance of it.

The better the engineering foundations, the more powerful these systems become.

TDD becomes more important.
Architectural boundaries become more important.
Observability becomes more important.
Validation becomes more important.
Harness design becomes more important.

The model is only one part of the system.

The environment around it is what determines whether the outcome is production ready or operational chaos.