TL;DR: Go component by component. A sandboxed workspace per task with no credentials and egress only to package mirrors; a small tool set (read, search, edit, run tests) with descriptions written for the model; permissions that allow reads and test runs, ask for anything outside the repository and deny pushes to protected branches; an append-only session log from which every model request can be rebuilt; context management that clears old test output and keeps notes; a subagent for exploration so search results do not fill the main context; and a loop whose only success exit is "the target tests pass and nothing else broke", followed by a pull request a person reviews.
How to approach it
Name the components, decide each one for this use, and walk a run end to end including a failure. Close with how you would measure and improve the harness.
A strong answer
Sandbox. One container or microVM per task, with a fresh checkout. No secrets inside; package installs go through an allowlisted mirror; network egress otherwise blocked. Destroyed after the run.
Tools. read_file, search (exact and symbol), edit_file with a diff format the model applies reliably, run_tests returning a compact summary plus the first failure's details. Each description says when to use it and what it returns.
Permissions. Allow reads and test runs. Ask (a human or a policy service) for edits outside the repository root, dependency changes and anything touching CI configuration. Deny git push, force operations and network calls outside the mirror. Decisions happen in code before each call.
Session log. Append-only events for every model request, tool call and result, compaction and permission decision, with versioned storage. Any step can be replayed to see exactly what the model saw.
Context management. Clear raw test output once summarised, keep a running notes file of hypotheses and findings, compact when the window passes a threshold, and send exploration (find every caller of this function) to a subagent that returns a short summary.
Loop and exits. Budgets on steps, tokens and wall time. Success only when the originally failing tests pass and the full suite shows no new failures; otherwise a named exit (budget, no hypothesis left, needs human). The output is a pull request with the diff, the test evidence and a link to the session log, never a direct merge.
Fresh sandbox
no secrets
Explore
subagent, summary back
Edit + test
permissions per call
Verify
target passes, suite clean
Pull request
diff, evidence, log link
Measuring and improving. Keep a fixed set of past failing-test tasks. Run every harness change (tool descriptions, compaction threshold, subagent use) several times per task against the current harness, paired, and report the fraction of tasks fixed every time and the cost per fix. Reviewers' rejections become new tasks.
What interviewers probe next
"What if the agent edits the test to make it pass?" The verification step checks that test files changed only when the task allows it, and reviewers see test diffs flagged. Reward hacking is a known failure for coding agents.
"Why not let it merge when everything is green?" Green tests are necessary, not sufficient; a person owns the change until the harness has a measured record on this kind of task.
How it's scored
Weak: Picks a model and gives it shell access.
Hire: Sandbox, tool set, permissions and a test-based exit.
Strong Hire: Every component decided for this use (sandbox, tools, permissions, log, context, subagents, exits), a run walked end to end with the PR as the boundary, test-tampering addressed, and a paired, repeated evaluation loop for harness changes.
Common mistakes
- Credentials or network access in the sandbox.
- "Done" decided by the model's message rather than the tests.
- No log to replay when it breaks something.
- Judging harness changes on single runs.