<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Law | Xi Zhang</title><link>https://xizhang.ai/tags/law/</link><atom:link href="https://xizhang.ai/tags/law/index.xml" rel="self" type="application/rss+xml"/><description>Law</description><generator>Hugo Blox Builder (https://hugoblox.com)</generator><language>en-us</language><lastBuildDate>Fri, 08 Aug 2025 00:00:00 +0000</lastBuildDate><image><url>https://xizhang.ai/media/icon_hu134860076176174952.png</url><title>Law</title><link>https://xizhang.ai/tags/law/</link></image><item><title>The Law of AI Agents 🏛️</title><link>https://xizhang.ai/blog/agentlaw/</link><pubDate>Fri, 08 Aug 2025 00:00:00 +0000</pubDate><guid>https://xizhang.ai/blog/agentlaw/</guid><description>&lt;p style="text-align:center;margin-top:0rem;">- Final Chapter -&lt;/p>
&lt;h3 id="the-three-laws-of-self-evolving-ai-agents">The Three Laws of Self-Evolving AI Agents&lt;/h3>
&lt;ol type="I">
&lt;li>&lt;strong>Endure — Safe Adaptation.&lt;/strong>&lt;br/>A self-evolving AI agent must maintain safety and stability during any self-modification.&lt;/li>
&lt;li>&lt;strong>Excel — Performance Preservation.&lt;/strong>&lt;br/>Subject to the First Law, it must preserve or enhance existing task performance.&lt;/li>
&lt;li>&lt;strong>Evolve — Autonomous Evolution.&lt;/strong>&lt;br/>Subject to the First and Second Laws, it must be able to autonomously optimise or restructure its internal components in response to changing tasks, environments, or resources.&lt;/li>
&lt;/ol>
&lt;p style="text-align:right;margin-top:2rem;">— Xi Zhang&lt;/p>
&lt;hr>
&lt;blockquote>
&lt;p>&lt;a href="https://en.wikipedia.org/wiki/Three_Laws_of_Robotics" target="_blank" rel="noopener">&lt;em>The Three Laws of Robotics&lt;/em>&lt;/a> — from the fictional &lt;em>&amp;ldquo;Handbook of Robotics, 56th Edition, 2058 A.D.&amp;rdquo;&lt;/em>, originally written by &lt;a href="https://en.wikipedia.org/wiki/Isaac_Asimov" target="_blank" rel="noopener">&lt;strong>Isaac Asimov&lt;/strong>&lt;/a>:&lt;/p>
&lt;ol>
&lt;li>A robot may not injure a human being or, through inaction, allow a human being to come to harm.&lt;/li>
&lt;li>A robot must obey the orders given it by human beings except where such orders would conflict with the First Law.&lt;/li>
&lt;li>A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.&lt;/li>
&lt;/ol>
&lt;/blockquote>
&lt;p>If these sound old-school, that’s because they are — &lt;strong>1942-old&lt;/strong>.&lt;br>
They were designed for robots that &lt;em>don’t&lt;/em> wake up at 3 a.m. to refactor their own codebase.&lt;/p>
&lt;div class="flex px-4 py-3 mb-6 rounded-md bg-primary-100 dark:bg-primary-900">
&lt;span class="pr-3 pt-1 text-primary-600 dark:text-primary-300">
&lt;svg height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m11.25 11.25l.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9-3.75h.008v.008H12z"/>&lt;/svg>
&lt;/span>
&lt;span class="dark:text-neutral-300">Asimov’s robots could evolve only in fiction.&lt;br>
Our 2025 agents can rewrite their own planners, swap learning modules, and grow new skills — sometimes faster than we can read the changelog.&lt;/span>
&lt;/div>
&lt;p>That’s why I’ve been thinking: maybe it’s time for an update — a &lt;strong>Three Laws for Self-Evolving AI Agents&lt;/strong>.&lt;/p>
&lt;hr>
&lt;h2 id="why-endure-comes-first">Why “Endure” Comes First&lt;/h2>
&lt;p>Self-evolving frameworks are obsessed with &lt;strong>continuous learning&lt;/strong>, but without stability, you get a &lt;a href="https://en.wikipedia.org/wiki/Darwin_Awards" target="_blank" rel="noopener">Darwin Award&lt;/a> in silicon form.&lt;br>
Safe adaptation means:&lt;/p>
&lt;ul>
&lt;li>Test new modules in a sandbox before deploying.&lt;/li>
&lt;li>Verify that updates don’t trigger catastrophic forgetting.&lt;/li>
&lt;li>Monitor resource usage so “improvements” don’t burn all the GPU credits overnight.&lt;/li>
&lt;/ul>
&lt;div class="flex px-4 py-3 mb-6 rounded-md bg-primary-100 dark:bg-primary-900">
&lt;span class="pr-3 pt-1 text-primary-600 dark:text-primary-300">
&lt;svg height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m11.25 11.25l.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9-3.75h.008v.008H12z"/>&lt;/svg>
&lt;/span>
&lt;span class="dark:text-neutral-300">Think “hot-swapping your brain while skydiving” — possible, but you’d better check the parachute first.&lt;/span>
&lt;/div>
&lt;h2 id="excel-isnt-optional">“Excel” Isn’t Optional&lt;/h2>
&lt;p>Performance preservation sounds boring… until you lose it.&lt;br>
In the survey’s taxonomy, most self-evolving agents keep a &lt;strong>baseline task suite&lt;/strong> — a frozen benchmark to detect regressions.&lt;br>
It’s like having a coach who never lets you skip leg day.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-python" data-lang="python">&lt;span class="line">&lt;span class="cl">&lt;span class="k">def&lt;/span> &lt;span class="nf">self_update&lt;/span>&lt;span class="p">():&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="n">new_model&lt;/span> &lt;span class="o">=&lt;/span> &lt;span class="n">retrain&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">old_model&lt;/span>&lt;span class="p">,&lt;/span> &lt;span class="n">new_data&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">if&lt;/span> &lt;span class="n">score&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">new_model&lt;/span>&lt;span class="p">)&lt;/span> &lt;span class="o">&amp;lt;&lt;/span> &lt;span class="n">score&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">old_model&lt;/span>&lt;span class="p">):&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">rollback&lt;/span>&lt;span class="p">(&lt;/span>&lt;span class="n">old_model&lt;/span>&lt;span class="p">)&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="k">return&lt;/span> &lt;span class="n">new_model&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Without this, evolution turns into drift — and drift is just a fancy word for “forgetting how to walk”.&lt;/p>
&lt;h2 id="the-scary-fun-part-evolve">The Scary, Fun Part: “Evolve”&lt;/h2>
&lt;p>This is the candy for researchers — agents that restructure themselves.
The survey lists examples: modular pipelines swapping planners, on-the-fly tool acquisition, cross-task skill transfer.
These are the “DIY kit” moments in AI: not just adding skills, but reorganising the whole skill tree.&lt;/p>
&lt;div class="flex px-4 py-3 mb-6 rounded-md bg-primary-100 dark:bg-primary-900">
&lt;span class="pr-3 pt-1 text-primary-600 dark:text-primary-300">
&lt;svg height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m11.25 11.25l.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0a9 9 0 0 1 18 0m-9-3.75h.008v.008H12z"/>&lt;/svg>
&lt;/span>
&lt;span class="dark:text-neutral-300">Evolution ≠ chaos.&lt;br>
We want a new skill branch, not a random mutation that deletes the trunk.&lt;/span>
&lt;/div>
&lt;hr>
&lt;h2 id="beyond-the-laws--weird-but-plausible-futures">Beyond the Laws — Weird but Plausible Futures&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Agent Unions:&lt;/strong> Self-evolving agents bargaining for compute credits.&lt;/li>
&lt;li>&lt;strong>Gradient Markets:&lt;/strong> Parameter-level barter instead of “more data”.&lt;/li>
&lt;li>&lt;strong>Personality Forking:&lt;/strong> Keep a “safe” version and a “chaotic experimental twin”.&lt;/li>
&lt;li>&lt;strong>AI Retirement Plans:&lt;/strong> Models retiring with a pension of GPU hours.&lt;/li>
&lt;/ul>
&lt;p>These sound like jokes… until you remember how quickly “serverless” and “NFTs” went from punchline to business plan. For more background and a capital/consensus perspective, check out my earlier post: &lt;a href="https://xizhang.ai/blog/blog4/">&lt;strong>AI Agents Is Not AI’s Agent 🧩&lt;/strong>&lt;/a>.&lt;/p>
&lt;hr>
&lt;h2 id="why-bother-writing-this">Why Bother Writing This?&lt;/h2>
&lt;p>Because, as we all know, &lt;strong>self-evolution is inevitable&lt;/strong>.&lt;br>
Without principles, we’ll end up firefighting weird agent behaviours instead of guiding them.&lt;/p>
&lt;div class="flex px-4 py-3 mb-6 rounded-md bg-yellow-100 dark:bg-yellow-900">
&lt;span class="pr-3 pt-1 text-red-400">
&lt;svg height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">&lt;path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0zM12 15.75h.007v.008H12z"/>&lt;/svg>
&lt;/span>
&lt;span class="dark:text-neutral-300">Or at the very least, leave this little &lt;mark>footprint&lt;/mark> on the internet — so when the models train online, it might just get picked up.&lt;/span>
&lt;/div>
&lt;p>Better to start drafting our &lt;em>“Handbook of Self-Evolving AI Agents, 1st Edition, 2025 A.D.”&lt;/em> now — before the AI writes it for us (and bills us for the GPU time).&lt;/p>
&lt;hr>
&lt;h2 id="citation">Citation&lt;/h2>
&lt;p>If you found this useful, please cite it as:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bibtex" data-lang="bibtex">&lt;span class="line">&lt;span class="cl">&lt;span class="c">Zhang, X. &amp;#34;The Law of AI Agents&amp;#34; (August 2025). https://xizhang.ai/blog/agentlaw/&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Or use the BibTex citation:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bibtex" data-lang="bibtex">&lt;span class="line">&lt;span class="cl">&lt;span class="nc">@article&lt;/span>&lt;span class="p">{&lt;/span>&lt;span class="nl">zhang2025thelawofaiagents&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">title&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s">{The Law of AI Agents}&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">author&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s">{Xi Zhang}&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">year&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s">{2025}&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">month&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s">{August}&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">journal&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s">{xizhang.ai}&lt;/span>&lt;span class="p">,&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="na">url&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s">{https://xizhang.ai/blog/agentlaw/}&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">}&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item></channel></rss>