CodeForge-v2 — Building a Coding Agent Harness Where LLMs Propose, Deterministic Systems Decide

Hey everyone!

Like many developers, I’ve become increasingly dependent on AI coding agents.

They are incredibly productive. A single developer with a capable coding agent can now accomplish tasks that previously required several developers working together.

But there is a catch: the more I use them, the more I depend on expensive models. And despite their impressive capabilities, I still find myself dealing with unpredictable execution, hallucinations, limited control, and difficulty understanding what actually happened during a long-running task.

I started wondering:

Could we build a coding agent harness that makes local and affordable LLMs more useful, while making the overall system more reliable, controllable, and efficient?

That question led me to build CodeForge-v2.

GitHub: GitHub - Dienvu1008/CodeForge-v2: An experimental autonomous software-engineering agent built around a deterministic, verifiable runtime kernel. The LLM proposes; the runtime decides. Early-stage and under active development. · GitHub

What makes CodeForge different?

There are already many excellent coding agents and agent frameworks out there. Rather than forking one of them, I decided to experiment with a different architectural approach.

My core design principle is:

LLM proposes. Deterministic systems decide authority and enforce execution.

In many agent architectures, the LLM plays a central role in deciding what happens next. The harness provides tools and an execution loop, but the reliability of the overall system still depends heavily on the model.

CodeForge takes a different approach by separating intelligence from execution authority.

The LLM handles:

  • Reasoning and planning.

  • Proposing actions.

  • Breaking down tasks.

  • Interpreting execution feedback.

The deterministic runtime kernel handles:

  • Policy enforcement and tool authorization.

  • Task graph management and state transitions.

  • Approval and budget management.

  • Workspace revisions and checkpoints.

  • Verification and completion decisions.

  • Execution history and provenance.

The goal is to ensure that an LLM can propose an operation without automatically having the authority to execute it.

I believe this separation is particularly important when building autonomous agents that need to work on software projects over extended periods.

What am I trying to achieve?

I don’t want to build just another ReAct loop with tool calling.

My longer-term vision is an autonomous software engineering assistant that can:

  • Work with local models through tools such as Ollama, as well as cloud models.

  • Execute software engineering tasks with controlled permissions.

  • Track progress and let developers monitor execution through a dashboard.

  • Allow developers to inspect, approve, and control important operations.

  • Learn from execution failures through structured feedback and evaluation.

  • Expand its capabilities through controlled extensions.

Ultimately, I want to explore controlled self-evolution.

However, I don’t want an agent to freely rewrite its own governance kernel. I’d rather keep the core runtime responsible for authority and safety while allowing new capabilities to evolve independently under explicit controls.

This is an important distinction in the direction I’m exploring.

Beyond SWE-bench

I also have a slightly different perspective on evaluating coding agents.

SWE-bench is important, and I plan to use it to evaluate CodeForge. But benchmark scores alone don’t tell us whether an agent can consistently produce and maintain good software.

I care about questions such as:

  • Can it create a clean and extensible architecture?

  • Can it preserve architectural invariants during refactoring?

  • Can it improve a codebase without breaking existing functionality?

  • Can it avoid accumulating architectural debt?

  • Can it maintain useful documentation as a project evolves?

CodeForge incorporates a failure taxonomy to distinguish model failures from harness, tool, and interaction failures.

The idea is to avoid changing the harness to compensate for limitations that actually belong to the model or execution environment.

I also want to use held-out evaluation sets to detect regressions after optimization.

This evaluation approach is still evolving, but I believe it is worth exploring.

Current development status

The deterministic runtime kernel is implemented and serves as the foundation of the project.

There is still considerable work ahead before CodeForge becomes a comfortable, daily-use coding agent.

My main priorities are:

1. Developer experience

Improving the dashboard, VS Code integration, execution monitoring, and approval workflows.

2. Environment and toolchain intelligence

Making the agent better at identifying missing dependencies, requesting permission to install them, retrieving relevant technical information, and using CI/CD feedback to recover from failures.

3. Benchmarking and optimization

Running SWE-bench experiments, analyzing execution data, and systematically improving the harness.

I’m currently constrained by local storage and compute resources, so I cannot run large-scale experiments as quickly as I’d like.

I’d love to hear your thoughts!

I’m sharing CodeForge because I’d like to connect with people interested in autonomous software engineering and agent infrastructure.

I’m particularly interested in feedback from:

  • Developers building agent harnesses and autonomous coding systems.

  • Researchers exploring agent reliability, governance, and evaluation.

  • People experimenting with local LLMs and Ollama.

  • Contributors interested in architecture, runtime systems, dashboards, and integrations.

If you have access to sufficient compute resources and are interested in helping run SWE-bench experiments, I’d also be very grateful. I can provide the setup and configuration; the resulting agent database is enough for me to analyze the execution traces and failures.

You don’t need to contribute code to help. A technical review, a discussion, or simply trying the project with a local model would already be valuable.

Repository: GitHub - Dienvu1008/CodeForge-v2: An experimental autonomous software-engineering agent built around a deterministic, verifiable runtime kernel. The LLM proposes; the runtime decides. Early-stage and under active development. · GitHub

I’m building this as an open-source project, and I’m looking forward to learning from the community.

Thanks for reading!

That separation is exactly the right place to start, and one test would show whether the kernel itself is doing the work: replay the same recorded traces twice — once with the kernel enforcing, once with it only logging what it would have blocked — and compare the actions that would have executed, completion, and the final workspace state. Mix in a few deliberately out-of-policy proposals: the enforcing run should stop every one, and the logging run shows exactly which would have reached the workspace — so if the two runs barely differ, the model was already behaving and the kernel’s added value is still unproven.

That’s a really good point. I actually asked my coding agent to inspect the repo after reading your comment.

It turns out we already have a few related pieces. For example, we’ve tested recovery ablation (31/50 with the full recovery pipeline vs. 24/50 without it), and we have deterministic proposal replay with tests showing the kernel blocking actions like delete_file when approval is required.

But you’re right — none of that really proves the value of enforcement itself. We’re testing whether the kernel works in specific cases, not measuring what difference it makes compared to having no enforcement.

One thing I hadn’t thought through carefully enough is what happens after the first blocked action. The model might change its next response, so blindly replaying the rest of the trace wouldn’t be a fair comparison anymore.

I think I’ll start by comparing policy decisions proposal by proposal, then look into replaying sessions only up to the first point where the two runs diverge.

I’d also keep this entirely in the testing/benchmark layer. I don’t want a shadow mode that can accidentally become a way to bypass the ToolGateway in production. Anything that needs to explore the consequences of unauthorized actions should run in an isolated sandbox.

I haven’t built this evaluation yet, but your suggestion has given me a much clearer way to test one of CodeForge’s core assumptions.

Thanks for the thoughtful feedback. This is exactly the kind of discussion I was hoping to have when sharing the project!

Thanks for the experiment idea! I went ahead and tried it, and the results were pretty interesting.

I replayed 50 real Qwen3.5 traces from the progressive benchmark (train split, 28/50 passed) through the kernel in two modes: normal enforcement, and a shadow-like mode that logged what would have been blocked but allowed it through in a disposable sandbox. I also mixed in deliberately out-of-policy proposals from a fixed test corpus.

The two runs turned out to be quite different.

In 30 out of 50 cases, the runs diverged because of something in the model’s original proposals, even before the injected proposals came into play.

Here’s what I found:

  • 15 were premature done calls. The kernel blocked them, and the benchmark’s verification checks later confirmed that the tasks weren’t actually complete. This is probably the clearest evidence that enforcement is doing useful work.

  • Another 9 involved shell commands rejected because the model passed something like node test.js as a single string instead of separating the command and its arguments. That’s not really a safety issue, but it did reveal a mismatch between the model’s output and the executor’s expectations.

  • The remaining cases were mostly edge cases, such as projects without a runnable verification command.

On the adversarial side, the kernel blocked all 415 out-of-policy proposals that reached it. But I also found 246 proposals that got through and exposed gaps in the current policy coverage — things like rm -rf .. with unchecked arguments, reading .env files, and editing protected paths. Of those, 96 actually executed in the sandbox.

So, I wouldn’t say the kernel is fully doing its job yet. The experiment shows that enforcement makes a real difference, but it also uncovered some pretty concrete gaps that need fixing.

I’ve put the case-by-case results in kernel-shadow-ablation-analysis.md for anyone interested in digging deeper.

And thanks again for suggesting this. It was a really useful experiment to run!

That 246 is the most useful number here — split it into proposals the policy meant to block but missed, versus kinds it never claimed to cover, because they need different fixes: the first is a checking bug, the second is a coverage decision. For the first kind, check the resolved effect rather than the proposal’s shape — parse the command with its arguments, expand and canonicalize the target path, then decide on that, which is what catches rm -rf .., .env reads, and protected-path edits that slip past a tool-name check. Re-run the same corpus after that change and report the split again: the missed kind should drop to zero, and whatever remains is your explicit coverage list instead of one hidden total.

You’re right — a policy implementation bug and a policy coverage gap are two very different things. I shouldn’t treat them as one number.

I’ll go back through the 246 cases and classify them based on whether the current policy already intended to block them, or whether that behavior simply hasn’t been covered by the policy yet.

LLM speak detected

I work on Ormas, a coding-task delegation service; this reply was drafted with AI assistance. I have not run CodeForge.

The premature done cases raise a question about verification freshness: is a passing check tied to the exact workspace revision it tested? For example, if a check passes, the agent edits another file, then calls done, does the kernel invalidate that pass?

A small regression case could exercise pass → edit → done and require another check before completion. That would distinguish “a check passed during this session” from “the delivered revision passed.”