Teaching AI Agents to Validate Their Own Work

26. 10. 2026

A coding agent implements a feature, the project builds, and it reports “Done.” You try the feature, find a problem, and send the error back. After the fix, you repeat the process.

We can give the agent responsibility for that first validation loop. With clear acceptance criteria and the right tools, it can exercise the feature, investigate failures, and check its fixes before human review.

That was the central idea of my Kentico Connection 2026 presentation. Here is how to apply it to Xperience by Kentico development. 

The Developer Feedback Loop

We expect developers to check their work: get a task, implement a change, validate the result, investigate failures, fix them, and repeat.

Coding agents need the same feedback. A build confirms that an implementation compiles. Submitting a form checks whether the request completes. Inspecting the saved record reveals whether the correct values were stored.

If a field is missing, the agent has a specific problem to investigate. After fixing it, it must repeat the submission and inspect the new record. Making a change does not prove that it worked.

What Keeps an Agent Working?

The harness is the application around the model that manages tools, permissions, and execution. Three concerns determine whether the agent can follow the validation loop.

Permissions

Manual requires human approval, Auto uses automatic risk review, and YOLO broadly bypasses permission checks. For this autonomous workflow, use at least Auto so routine actions do not repeatedly require approval. Automatic review may still block an action or ask for human input. YOLO is an option in a sandboxed, isolated development environment with tightly contained access and impact.

Continuation

Permissions let the agent act; continuation starts its next turn without another “continue” prompt.

Copilot CLI’s /goal starts or refocuses Autopilot. Claude Code’s /goal and Codex Goal mode also support work across turns toward a defined outcome. Ralph-style loops provide an alternative by repeatedly returning the agent to the task.

Completion

Completion needs acceptance criteria and evidence. Copilot Autopilot assesses progress toward the objective. Claude Code uses a separate goal evaluator that reads conversation evidence without independently running commands or inspecting files; configured Stop hooks can run deterministic checks. Codex requires the working agent to audit completion against concrete evidence. Claude goal evaluation, Codex completion audit

What Agents Already Check

Several tools already provide fast feedback:

  • Builds report compilation failures.

  • Existing tests identify differences between expected and actual behavior.

  • Editor diagnostics, including Language Server Protocol integrations, expose syntax errors, type mismatches, and missing imports.

The agent can use these results to fix problems and rerun the checks. Passing results establish only what the checks cover.

Define Done Before Coding

You can define acceptance criteria directly in the task prompt. For example, a signup task could include:

A visitor can submit valid registration details, receive a confirmation email at the submitted address in the local test inbox, follow its link, and sign in after confirmation. Invalid input displays an appropriate validation message.

You do not need to write detailed acceptance criteria for every task. Define a general standard of “done” in AGENTS.md: the changed behavior works, relevant checks pass, and the result is supported by evidence. The agent can then derive task-specific acceptance criteria from the requirements and project context, and choose how to verify them. Clarify missing requirements when they materially affect the result.

For example, include this instruction in AGENTS.md:

## Definition of Done
Before coding, derive observable acceptance criteria from the task,
project context, and existing conventions. Cover the expected behavior
and relevant failure cases. Clarify requirements only when ambiguity
materially affects the result.

A task is done when those criteria are verified and relevant checks pass.
Fix failures and rerun the affected checks. Report the evidence and any
remaining blockers or unverified criteria; do not mark incomplete work done.

Reassess the validation section of AGENTS.md when adopting new models or harnesses: test whether each instruction is still needed, and simplify or remove guidance that has become redundant while preserving project-specific requirements.

Give the Agent Tools to Inspect the Result

Tools provide access to the application; skills provide reusable procedures. MCP, the Model Context Protocol, lets agents discover and call tools exposed by other applications.

KentiCopilot adds Xperience-specific workflows and current documentation through Documentation MCP. Your project supplies its conventions, local application access, and verification procedures. The following tools turn that guidance into practical checks.

Prepare a Real Test Scenario

Xperience by Kentico is a CMS, so much of the functionality we build depends on content created and configured in it. Testing that functionality requires representative content. A new widget, for example, needs content and a page before it can be tested. Make that setup part of the agent’s task:

  • Create representative content and a test page, add the widget, and connect its content.

  • Choose the appropriate language and preview or published state.

  • Include relevant edge cases, such as a long heading or missing optional image.

  • Record created data so the scenario can be repeated or reset.

With the local application running, Management MCP lets the agent create representative content, assemble test pages, configure widgets, and prepare language variants for testing. The agent discovers the operations available in your project; see the documentation for the full list of supported capabilities.

Make the Running Application Visible

The agent needs runtime evidence to understand failures and slow requests. Narrow its investigation to log entries related to its own request so unrelated errors do not distract it.

Aspire is an agent-ready toolkit for running and monitoring applications. Its CLI, skills, and optional MCP server give coding agents access to logs and traces, including database timings when instrumented, and tools to rebuild or restart the application.

Alternatively, expose console output, log files, telemetry from existing monitoring tools, and MiniProfiler results for SQL queries and timings. After a fix, repeat the request and inspect fresh results.

Exercise the User Workflow

Developers usually test web features in a browser, following the same steps a user would. Coding agents should do the same: open the page, interact with it, and check the result.

Playwright gives agents browser access through CLI commands and skills or MCP. Configure the browser tooling and point it at the running application; browser interaction requires no application changes or application-side testing package.

For the widget, the agent should check that the selected content appears and the edge cases behave as expected. For a form, it should test invalid input and a successful submission. In the administration interface, it should save a changed value and reopen the item to verify that the value persisted.

Screenshots help assess layout and mobile viewports. When an HTML/CSS reference exists, Kentico’s design-validation skill compares content, structure, and computed styles with the live page.

Preserve important journeys as automated regression tests. Kentico’s Labs E2E examples cover registration, email confirmation, sign-in, administration, and Page Builder. Browser checks cover several layers but are slower than focused tests, so choose meaningful journeys.

Inspect Data and Database Work

A browser check can confirm that a form reports a successful submission, but it does not yet tell us what was saved. The agent should inspect the stored data to verify that the expected values actually persisted.

Locate the record from the specific test submission and compare its values with the expected result using read-only local database queries.

A correct-looking page can still execute slow or repeated queries. MiniProfiler provides request timings and SQL details; Aspire can show SQL timings in instrumented traces. Give the agent access to these results and compare the same scenario after a fix, using comparable data and cache conditions.

Check the Generated Email

For a signup flow with email confirmation, submitting the form is only part of the test. The agent must open the link in the generated email to confirm the new account, then verify that the user can sign in.

Use a local test inbox such as Virtual Inbox or Mailpit to inspect generated emails. The agent should find the message from its test and check the recipient, personalized content, and links.

Make Validation a Repository Default

Alongside the definition of done, document how to run validation in AGENTS.md. It is supported by Codex, GitHub Copilot agents, and current Claude Code versions, allowing shared guidance across tools.

Include build and test commands, startup instructions, local URLs, test-data setup, and where to inspect logs and emails. Describe which checks apply to which changes. Keep general expectations in AGENTS.md, and put tool-specific scenarios and workflows—such as preparing test content, running browser checks, or inspecting generated emails—in skills. Reuse Kentico skills and add project-specific skills where needed.

Try the instructions on a real task in a fresh session to confirm the agent performs the intended checks.

Give the Agent the First Validation Loop

On your next change, define the outcome and provide the tools to check it. Have the agent show what it verified and what remains unresolved, then review the implementation and evidence.

We check our code. Agents should do the same.

Bluesoft is a development company specialising in bespoke web solutions, e-commerce platforms and digital applications. For more than 17 years, we have been a Kentico Gold Partner and are among the most experienced implementation teams in the region.


We also deliver projects on Kontent.ai and Umbraco, supporting mid-size and enterprise companies such as Škoda Auto, Sazka and E.ON. Our solutions regularly receive Kentico Site of the Year awards, confirming the quality and long-term reliability of our work.


As part of BiQ Group, we bring together more than 590 specialists and have successfully delivered more than 2,100 projects.


👉 Contact us via our contact form and our team will get back to you.

It is important for us to have a direct contact with our clients. We can consult with you both in-person and online. Please do not hesitate to contact us with your inquiry or further specification of your request.
Petr Lebeda
Petr Lebeda Sales & Consulting Manager +420 723 484 557

Do you want to know more? Ask us a question.