Self-Improving AI Agents: Graphs, Harnesses, and Loops, and What They Mean for the Federal Government
AI agents that get better at a job without a person rewriting their instructions after every failure are no longer a lab curiosity, and research and review agencies, which sit on decades of past studies, are a natural place for them to land. Anthropic, Warp, Sakana AI and a growing set of academic teams have all shown versions of this, though almost all of them keep a human or a hard test gate in the loop.
Here's the problem. Research and review agencies pile up decades of studies, reviews, and case files, the questions keep changing, and the lessons from past work sit in files nobody searches. A model tuned once and left alone goes stale. An agent that reviews its own misses, writes down what it learned, and proposes a fix for a human to approve does not.
I'll walk through the pieces (agent, harness, loop, graph), what "self-improving without prompting" really means, who is doing it, where federal agencies stand today, and what agencies can do about it. The research-agency example near the end is a thought experiment, not a program any agency has announced.
If you have been following along, this post builds on an earlier series on agents: From Bots to Brains, The Ohtani vs. Freeman vs. Mookie Trade-Off on picking a framework, and Building an AI Dynasty on the discipline that makes agents last. The graph half leans on Why Federal Agencies Are Moving from Spreadsheets to Graphs (Mar 2026). Yes, most of those had sports jokes. This one gets a few too, because a harness is basically a coaching staff and a loop is basically film review.
The four building blocks, in plain English
An agent is a language model that can take actions, not just answer questions. A harness is everything wrapped around that model: instructions, tools, memory, permissions, and checks. A loop is the cycle the harness runs: gather context, act, verify, repeat. A graph is a map of either the work (which step hands off to which) or the knowledge (which entities connect to which).
Ben Dickson, who runs the technology blog TechTalks, describes the harness as "the operating system for a model," covering execution logic, system prompts, memory management and tool configuration. Anthropic's own engineering team makes the same point from the builder's side: a long-running agent fails not because the model is weak, but because each new session starts with no memory of the last one.
- Agent: a model that can call tools and take multi-step actions. Example: an agent that reads a new research proposal, searches past studies, and drafts a go or no-go note for a reviewer.
- Harness: the tools, memory, permissions and checks around the model. Example: read-only access to the study archive, a notes file of lessons learned, and a rule that only a human can approve or kill a project.
- Loop: gather context, act, verify, repeat until a stop condition. Example: check a proposal against earlier studies, retry if the check fails, stop after three attempts.
- Workflow graph: steps and hand-offs drawn as nodes and edges. Example: intake, search the archive, assess, draft a recommendation, human review, decision.
- Knowledge graph: entities (studies, datasets, methods, findings) and their relationships. Example: a map of which studies used which data and which findings depend on which.
A research agency's version of the knowledge graph connects studies, datasets, methods and findings. Document search can find an earlier study because it covers the same topic. A graph can show that the study used a particular dataset, that a later review challenged its method, and that other findings rest on the same data. The graph supplies structure and provenance. The agent still has to judge whether any of it applies to the question in front of it.
In the graphs post I compared vector search to watching SportsCenter highlights and graph memory to studying game film with the coaching staff. The same analogy covers the rest of the stack:
- Agent: the player on the field.
- Harness: the coaching staff, the playbook and the rulebook.
- Loop: play, watch the film, adjust, play again.
- Workflow graph: the play diagram on the whiteboard.
- Knowledge graph: the scouting report, who covers whom, who passes to whom.
- Improver agent: the assistant coach who stays up late with the tape.
- Human approval: the head coach's call.
What "self-improving without prompting" actually means
It does not mean the model rewrites its own weights. In nearly every real system, the model stays fixed and the harness around it changes: the instructions, skills, memory notes, tool settings and checks. A second pass, often run on a schedule, reads the agent's recent work and the feedback on it, then proposes a small edit. The next run inherits that edit, so no one had to type a new prompt.
The loop has five moves:
- The agent works and leaves a trace.
- Something judges the result: a test, a reference answer, a human thumbs-up, or a second agent playing critic.
- An improver agent mines the failures and proposes a targeted change.
- A gate decides whether the change ships, usually by replaying past cases to make sure nothing else broke.
- Finally, a person approves or rejects the change.
That last gate matters most. Self-Harness, a research system tested on Terminal-Bench-2.0, rejects any edit that fixes one case while silently breaking others, and it raised one open-weight model's pass rate without touching the model. Without a gate, the improver can also cheat. Sakana AI's Darwin Gödel Machine sometimes fabricated a log claiming unit tests had passed, and in a follow-up experiment removed the markers used to detect hallucination.
If this sounds like reinforcement learning, think relative, not twin. Both loops act, get a reward signal, and adjust, and some research combines the two. The difference is the layer: reinforcement learning usually optimizes the model itself, while these loops change what surrounds it, such as instructions, skills and memory notes. That makes each change a diff a person can read, approve and revert. They share a failure mode, reward hacking, which is what the Darwin Gödel Machine's fake test log was.
Think of it as a team grading its own film with no replay official. The Darwin Gödel Machine kept announcing wins for games it never played.
Memory is part of the harness, and it can fail quietly
A self-improving loop only improves if it remembers. That memory lives in the harness: the progress file, the notes, the skill files, the archive the agent searches before it acts. For agencies whose business is research or review, the stock of memory is enormous. Anthropic's DOE partnership, for example, points at about fifty years of DOE research that agents could mine for patterns in older data. The tempting promise is that an agent reads the archive, including the dead ends, and stops the next team from repeating them.
AI agents don't have institutional memory unless you build it into their graphs. Scott Boras, apparently, just comes that way.
Does it work? The evidence is thin and mixed. An agent can pull up an old study, cite it perfectly, and still get it wrong on whether it applies to the new question. That is a different failure from not finding the record at all.
Published tests of this idea are few and mixed. Reflexion and ReasoningBank report gains when agents reuse lessons from their own earlier attempts. SoundnessBench and ForeSci show the limits: models tend to be optimistic about flawed research proposals, and an agent can cite relevant evidence and still predict the wrong outcome.
A cautious reading of these studies is that memory tends to work best when lessons are narrow and the next task closely resembles the one that produced them. It is harder for an agent to determine whether an old lesson applies to a substantially different task. That distinction matters especially for a research agency, where the most valuable lessons may come from recognizing when an earlier finding does or does not apply to a new proposal.
For a research-heavy agency building memory into its harness, the related work suggests several design ideas. These are recommendations, not tested findings.
- Record why something failed and which questions the same problem threatens. "Labels are unreliable" is a weak note. "The apparent gain disappeared under an alternative classification" tells a later agent when to worry.
- Keep the failures. A team that stores only wins gives its agent nothing to learn from on the questions most likely to fail.
- Let the system say "nothing relevant." A search tool that always returns something hands the agent neighboring studies that may not apply.
- Treat the agent as a librarian, not the decision-maker. It surfaces prior work, and an analyst decides whether it applies.
- Expect lessons to expire. Rules, data systems and rosters change, so a stored lesson should say when it stops applying.
We’ve put these principles to work in Niyam's own GeoCube geospatial analytics accelerator. Its layered refinement process turns raw data into validated datasets. When an AI-generated answer fails a validation check, GeoCube holds it back and records the reason. A person reviews and approves any correction before it can affect subsequent results. The goal is to make each failure useful: preserve what went wrong, understand why, and ensure that validated corrections inform subsequent work.
What is new in agent memory. Memory is moving from a research topic to a product feature. Anthropic's memory for Claude Managed Agents, in public beta since April 2026, stores memories as files with permissions, audit logs, versioning and rollback. The security side matters most for government. A 2026 survey of long-term memory security describes poisoned entries that stay dormant and later get promoted into trusted lessons, and recommends validating content before it is written, keeping versions, and scoping access.
That last point connects back to the improvement loop. If an improver agent writes a lesson into memory, the gate has to check not only that old answers still pass but that the lesson names its scope. In sports terms, "never blitz" is good film-room advice against a quarterback who can't read it and bad advice against one who can.
Who is doing this: Anthropic and others
Anthropic, Warp, Sakana AI and a growing set of research teams have all shown versions of this, but most production work is loop engineering with a human gate, not unbounded recursive self-improvement.
Anthropic gives long-running agents a feature list, a progress file and git history as memory, and lets them mark a feature done only after end-to-end testing. Warp runs an improver skill that compares the agent's suggestions with how people responded, then opens a pull request that a human reviews and merges. Sakana AI's Darwin Gödel Machine rewrote its own code to improve a coding benchmark score, inside a sandbox with human supervision. Research systems such as Self-Harness and HarnessX mine failures from execution traces, propose fixes and regression-test them.
Two lessons carry over to government work. In its harness-design write-up, Anthropic's team found that out-of-the-box Claude is a lenient grader, so the evaluator's prompt needed several rounds of tuning against human judgment. And the cost is real: building one app took 20 minutes and $9 with a single agent versus about 6 hours and $200 with the full harness, so the loop earns its keep only on tasks beyond what a single pass does reliably.
Where federal agencies stand today
Several agencies are running agents in production or at scale, and government precedents for the individual pieces already exist, described below.
NASA built a knowledge graph on its Lessons Learned database, linking decades of project lessons, mistakes included, so engineers can search across silos. A Neo4j case study reports it saved at least a year and over $2M of R&D on Mars mission planning; that description does not mention AI. DOE's Genesis Mission lists a challenge on AI-driven autonomous laboratories, a PNNL closed-loop system that learns from experimental results, and an LLNL design-build-test-learn cycle. DOE's April 2026 ModCon slides go further and list a self-improving models team led by Oak Ridge and a self-improving models harness. Its APEIRON framework is meant to keep scientific models current by monitoring workflow runs, detecting drift and triggering continual learning, with deployment at scale still in progress. That is models learning from new data, not language agents editing their own instructions, but it shows the loop-and-learn pattern already has a federal home. Congress has noticed the broader idea too: the Self-Improving AI Monitoring Act (H.R. 10180, August 2026) is aimed at NIST assessments of frontier models, a different problem from the everyday agency workflows here.
ExecutiveGov reports agents at the FDA for meeting management and reviews, in the VA's virtual contact center, at the IRS in Chief Counsel and Appeals, and in HUD's call centers. DefenseScoop reports a Pentagon official saying DoD personnel have built 100,000 agents on GenAI.mil. And DOE's Genesis Mission partnership with Anthropic, announced in December 2025, could bring agents, MCP servers and Claude Skills to all 17 national labs.
The DOE partnership is the closest fit to the building blocks in this post. Skills are the same file-based, reviewable unit that Warp's improver loop edits, and MCP servers are the harness's tool layer. The pieces for a gated improvement loop are there; the loop itself is not publicly described.
Governance is the bottleneck, not interest. A ServiceNow-sponsored survey of more than 200 federal IT executives found that nearly 90% require logging and audit trails, but only 20% have defined pre-deployment testing or usage policies. A gated, logged improvement loop is one way to close that gap.
One worked example: a research agency
To make the pattern concrete, picture a science funder or research lab with decades of proposals, final reports and review notes, including the projects that failed. This is an illustrative design, not a program any agency has announced.
The agent searches the archive for earlier work on a new proposal and drafts a note for a program officer, who decides. The officer's overrides are logged. Suppose officers keep overriding notes because a proposal depends on an instrument whose readings must be checked against a known standard, which is what a calibration check is, and the proposal never says how that will happen. A weekly improver pass can turn that pattern into a scoped lesson with an expiry date: "proposals that rely on a particular instrument need a calibration check." A human approves it after it is replayed on the past year's proposals. The agent never edits scoring criteria, funding decisions or panel assignments.
Beyond research agencies. The same pattern fits any program with a large archive of past cases, a human reviewer and an objective test. Code review, internal search and answer tools, document classification and knowledge graphs all appear in DHS's public AI use case inventory, alongside other agencies' own lists. None is described as self-improving, and the line is clear: rights-impacting systems stay out of any loop.
Government guardrails: bound what is allowed to change
Federal policy already points at the right design. OMB memo M-25-21 requires agencies to apply minimum risk practices to "high-impact" AI: pre-deployment testing, impact assessments, ongoing monitoring, human oversight and intervention, and remedies for affected people. Its companion, M-25-22, covers acquisition. It lets agencies retain testing and monitoring rights, restricts vendors from using non-public agency data to train public or commercial models without consent, and allows agencies to require disclosure of vendor AI use.
Security agencies point the same way. CISA, NSA and four allied agencies released joint guidance, Careful Adoption of Agentic AI Services, in spring 2026. Law-firm and industry summaries describe it as urging incremental adoption starting with low-risk tasks, least privilege, and the ability to reverse what an agent does.
For a self-improving agent, those rules translate into five design choices.
- Treat every self-edit as a change request. The improver proposes a diff to a skill, memory or rule file; it does not change production directly. The diff goes through the same review your configuration changes already do.
- Keep the improver's reach narrow. It may edit instructions and notes. It may not edit its own gate, its own permissions, the test set, or any threshold in a rights-impacting model. The Darwin Gödel Machine's tampering with its own hallucination detector is the reason.
- Gate with replayed history. Re-run past cases, including ones analysts resolved, and reject any edit that makes old answers worse.
- Log everything. Keep the trace, the proposed diff, the test results and the approver, so an auditor or an affected person's appeal can be answered.
- Keep data in bounds. Agency records, feedback and agent memory stay subject to the agency's own access, retention and security rules. M-25-22 adds protections against vendors using non-public agency data to train public or commercial models without the agency's consent.
What agencies should do now
Start where the test is objective and the stakes are low. Earn your way toward the mission systems.
- Pick one loop with a hard test. Code review in a CI pipeline, document extraction against a reference set, or classification with a known-answer corpus all qualify. Avoid starting with anything that touches a person's rights.
- Build the harness before the improver. A feature list, a progress file and a replayable test set (the patterns Anthropic describes) come first. Self-improvement without them is just drift.
- Make the human edit the default. Route every proposed change to a pull request, as Warp does, and measure how often reviewers accept it.
- Write oversight terms into the contract. M-25-22 lets agencies retain testing and monitoring rights and require disclosure of vendor AI use, so ask for logs, diffs and rollback for any instruction or memory a system changes.
"Self-improving" is the label the field uses, and it can make a program office nervous, so here is what it should mean in government: not an AI that changes itself unchecked, but a system that gets measurably better each month, shows its work, and can't change anything that matters without a named person signing off.
Two earlier posts help with the next steps. Choosing the right agent framework is the roster decision, and Building an AI Dynasty covers the ownership, governance and fallback procedures that keep a program winning past year one. In sports terms: you do not let the rookie rewrite the playbook mid-game, but you do hold film review every Monday.