What are verification gates in an agent harness, and how would you add them to a coding agent?
Agents and tools · Pro 1
Short answer
A verification gate is a check the agent's work must pass before the harness accepts it: tests, a linter, a type check or a separate evaluator agent. The harness runs the check itself, sends failures back to the model, and does not let the agent finish until the check passes or a retry limit is reached.
Deeper answer
Models are often too generous about their own work. A gate replaces 'the agent says it is done' with 'a check says it is done'. This feedback is sometimes called back-pressure: fast, clear signals that push the agent back when it is wrong.
For a coding agent, order the gates from cheap to costly: format and lint, then type check, then unit tests, then slower tests or a browser check, and finally an evaluator agent that reviews against the task. Run them in the harness, not by asking the model to run them, so the model cannot skip them. Keep the output short and specific, such as the failing test name and error, so it does not flood the context.
Guard the gates too. The agent should not be able to delete or weaken tests to pass, so protect test files or review changes to them. Set a retry limit, after which the harness stops and asks a person instead of looping. Log every gate result so you can measure how often each gate catches a problem.
What a strong answer covers
- A gate is a check work must pass before it is accepted
- Names tests, linters, type checks or an evaluator agent
- The harness runs the gate and feeds failures back
- Protects tests from being weakened by the agent
- Retry limit, then stop and ask a person
Answer it out loud in the mock interview about 2 min
Follow-ups to expect
- How would you stop the agent from editing the tests to make them pass?
- When is an evaluator agent worth its extra cost?
- What should happen after the retry limit is reached?
Common mistakes
- Asking the model to run tests instead of having the harness run them
- Sending huge raw logs back into the context
- No retry limit, so a failing gate causes a loop
Learn it
- What are common failure modes of agents, and how do you guard against them?
- What kinds of memory can an agent have, and how do you implement them?
- Your agent ran overnight and ran up a large API bill. What probably happened, and what do you change?
- How would you design a harness for an agent that has to work on one task for several hours?
- What is the difference between an agent and a workflow?
- What are computer-use or browser agents good for, and what are their risks?
- What is context engineering, and why does it matter for agents?
- An agent completes a task correctly most of the time but sometimes goes badly wrong. How do you debug it?
- What makes a good tool for an agent?
- Design an agent that handles refund requests for an online store.
- You changed your agent's harness. How do you prove the change made it better?
- How does tool calling work?
- When should an AI agent ask a human for approval before acting?
- Explain state, nodes, edges and checkpoints in LangGraph.
- What are planning and reflection in agents, and when do they help?
- Two coding agents use the same model, but one solves far more of your tasks. Why could that be, and how would you find out?
- What is an agent harness, and what is harness engineering?
- What is the Model Context Protocol, and why does it matter?
- When is a multi-agent system worth it, and what are the risks?