Human-in-the-loop AI coding · co-built
Code Agent
A prototype AI coding agent that plans, writes code and tests separately, runs them in an isolated sandbox and asks a person to approve each important step.
- Context
- Internship · co-built by two interns · confidential
- Period
- Aug – Sep 2026
- Status
- Internal research prototype
- Stack
- Python
- LangGraph
- Docker
- SQLite
- pytest
- Ruff
- FastAPI
Problem and users
AI coding agents can be fast but hard to trust: they may write tests that only confirm their own code, run untrusted code on the host machine, and leave no record of who approved what.
Engineers reviewing AI-generated changes. Built as an internal research prototype.
Co-built by two interns. We designed separately, compared plans, merged them and split the build.
My role
- An isolated sandbox for running generated code: no network access, a read-only filesystem, CPU, memory and time limits, and a non-administrator user
- A permanent audit trail of human decisions, kept separate from the agent's working state, so automated approvals can never pass as human ones
- An evaluation harness with a fixed set of practice tasks and quality measures, including tasks designed to fail
- Automatic checks for code style and for changes outside the allowed area
- A change so code and tests are written independently and in parallel from one approved specification
- The reviewer dashboard used to approve or reject each step
Not mine: My co-builder owned the agent roles, prompts, model integration and the failure-repair loop.
Architecture
A generic view of the workflow. The agent pauses for a person at each important step, and its state survives a restart.
PlanBuilt
The task becomes a written specification with acceptance criteria. A person approves it.
Code and tests, in parallelBuilt
Both are written from the approved specification, without seeing each other.
Human reviewBuilt
A person reviews the code and the tests, and can approve, edit or reject each.
Sandbox runBuilt
Tests run inside the isolated sandbox.
Diagnose and repairBuilt
Failures are diagnosed first. A person approves the fix plan before code changes.
Decisions and tradeoffs
Independent code and tests from one approved spec
If the test writer reads the code, the tests describe what the code does rather than what was asked for. Writing both independently from the same approved specification keeps the tests honest.
Tradeoff: Everything now depends on a clear specification, which is why it gets its own approval step.
Isolation first
Generated code is untrusted, so it runs with no network, a read-only filesystem and strict resource and time limits.
Tradeoff: Container isolation reduces risk but is not a complete security boundary, and we documented that limit.
An audit trail you can believe
Human decisions are stored separately from the agent's working state, and automated test-run approvals are tagged, so the decision log shows only what a person actually decided.
Tradeoff: Two stores to keep in step, handled with a migration script.
Failure handling
- Every run ends with a clear reason: success, a person stopped it, the environment failed, it ran out of budget, or it stopped making progress.
- Failures are classified before anyone tries to fix them, and each type takes a different path.
- A requirement with no test blocks the run until tests are added and approved.
- Rejected work goes back to whoever produced it, not to the start.
Testing and evaluation
- Unit tests with pytest, including offline stand-ins for model calls.
- The evaluation harness tracks how many attempts a task needs, how often a person had to step in, and how many problems the automatic checks caught.
Outcomes and limitations
What exists
- A working prototype with an isolated sandbox, a reliable decision log, an evaluation harness and a reviewer dashboard.
What doesn't, yet
- A research prototype, not a production system.
- No performance results are published here; they belong to the company.
What I can't share
- This is internship work for FutureVerse AI and the system is confidential. Its internal name, code, data, prompts, configuration, metrics and detailed design are not shared here.
- What you see is a general description of my role and of widely used engineering patterns. It is not a specification of the company's system, and the illustrations are generic.
- I'm happy to talk through my approach in more depth in an interview, within what my agreement allows.