I let my AI agents rewrite their own prompts. The hard part was stopping them from getting worse.
Most "self-evolving agent" demos die the moment you think about shipping them. Not because the idea is bad, but because an agent that can rewrite its own prompt can also quietly rewrite itself into something worse. It drifts. A critic starts rewarding the wrong thing. A regression slips in and nobody notices for a week because the output still looks fine at a glance.
I spent the better part of three months building a TypeScript framework around that exact failure mode, and I want to walk through the part nobody demos: not the clever loop, but the gate that keeps the loop honest.
What "self-evolving" actually means here
The idea is simple. A normal agent has a static prompt. You write it once, and it never gets better on its own. You are the optimizer, forever, by hand.







