First tell apart: who sets direction, who executes
A division of labour that has been proven: humans set direction, AI executes.
Humans decide what to do, how big a chunk to split it into, and what counts as done. AI writes code, runs tests and fixes things according to feedback.
The difficulty is not writing code, but building the environment to the point where AI can judge right and wrong on its own.
The first step is not writing code, but building the environment
For a project starting from an empty repository, the early focus is not features but:
- The project can run with one command
- There are basic tests and checks
- Error messages are understandable
- There is a directory structure and naming conventions
- There is a minimal README
Only after these does AI have a starting point where it can verify its own work.
Make the app “checkable”
What AI cannot see is the same as not existing. So let it see:
- Logs and metrics: can be queried and compared
- Page screenshots and structure: it can open pages itself to see results
- Test results: which case failed and why
- Running instances: each change can run in its own instance
With these, requirements like “the service must start within 800 ms” become executable.
Repo docs as a map, not a manual
A common mistake: stuffing every rule into one extremely long document. The result is usually:
- The file takes up context that the task itself needs
- Too many rules, and AI cannot tell what is primary and what is secondary
- Outdated rules go unmaintained and mislead instead
The more effective approach: the main document is only a map, stating where to find what; detailed docs are split into directories and loaded on demand. This is “progressive disclosure”: see the directory first, then go deeper.
Enforce architecture with mechanisms, not reminders
Documents cannot hold code quality in place; mechanisms can:
- Directory layering and dependency direction are fixed, and crossing boundaries raises errors
- Rules for naming, logging and file size go into automated checks
- The check’s error message states exactly how to fix it
Once written as mechanisms, the rules apply to every change rather than relying on reminders each time.
Throughput changed, so collaboration must change too
When AI’s output outpaces human review, the traditional process becomes a bottleneck:
- Small commits and fast merges
- Flaky test failures are rerun first and not blocked on for long
- People being able to understand changes quickly matters more than “perfect review”
The precondition for this is that fixing mistakes is cheap: automated checks cover most problems. Teams with low throughput will run into trouble if they copy it.
Regularly clean up “AI-flavoured” code
AI imitates the existing patterns in the repository, including bad ones. Over time the code drifts.
An effective approach is regular “sweeping”:
- Write team preferences as explicit rules
- Periodically scan for code that deviates from the rules
- Refactor in small steps instead of saving it all for a big release
This is like paying off a credit card: a little at a time is far cheaper than letting it pile up.
Who this approach is not for
- Projects without tests or automated checks: AI changes cannot be verified
- Requirements that change drastically and a direction that is unclear: settle the direction before talking automation
- Nobody willing to maintain the environment: the environment decays quickly
Checklist
- The project runs with one command and logs are visible
- There is a minimal test set and automated checks
- The main doc is only a map, with detailed docs in separate directories
- Key architecture rules are enforced by tools, not verbal agreements
- Changes are committed in small steps and are quick to understand
- Drifted code is swept regularly
- Key changes still get human review
Reference: key points adapted from OpenAI’s official blog post “Harness engineering: leveraging Codex in an agent-first world”, rewritten for what a small team can realistically do.
Questions
What is a harness?
Here it means the whole runtime environment built around an AI coding agent: it can run, you can read logs, checks run automatically, and there are clear docs and constraints. An agent can only see what is in the environment, so the environment determines how well it can do.
Does a small team need to build all of this?
Not all of it, but the order is worth borrowing: first make the app runnable with one command and keep logs visible, then write a short project note, and finally turn the most error-prone rules into automated checks. After these three, the payoff is already clear.
Is it reliable to let AI write code with no human review at all?
No, and copying that setup is not recommended either. The team in that article combines high throughput, strong automation and continuous clean-up; ordinary projects still need human review of key changes, though repetitive checks can be handed to machines.