Skip to main content

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

Answer it out loud in the mock interview about 2 min

Follow-ups to expect

Common mistakes

Learn it

Advanced harness engineering

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.