---
id: 18962
lang: en
title: "BI.ZONE Education hands code to agents, but another model and hooks check it"
published_at: "2026-12-02 12:30:49"
source_name: "Habr AI"
source_url: "https://habr.com/ru/companies/bizone/articles/1113992/?utm_campaign=1113992&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18962"
categories: ["llm", "autonomous"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# BI.ZONE Education hands code to agents, but another model and hooks check it

> **Краткая суть (BLUF):** Ask an AI agent to review its own code and it will likely decide everything is fine, since it judges the work by the same assumptions it used to write it. At BI.ZONE Education, another model without shared context reviews agent code twice: first the spec, then the branch. Rules like "don't merge without approval" are built into hooks, meaning blocking scripts, because an agent in a long session forgets plain-text instructions. As a result, checks stand between the agent and production instead of trust.  - The spec goes through review before any code is written; the largest one took five rounds. - If there is no final verdict after three rounds, the request gets split into smaller parts. - A verdict is tied to a specific commit: any new commit requires a new review.

Ask an AI agent to write code and then review it, and it will most likely say everything looks good. It judges its own work by the same assumptions it used to make it. It's like an author proofreading their own text and missing their own mistakes. From this observation, the BI.ZONE Education team began building a development process around agents. The platform gives participants training labs built on real products, and part of its code and content is written by LLM agents. The rule is simple: only what passes independent review reaches release. The "double review" in the title refers to two checkpoints where another model, with no shared context with the agent, examines the agent's work. "Hooks" are scripts that physically block a dangerous action, even if the agent has forgotten the rule.

This breakdown is useful for anyone whose agents already make commits: platform engineers, DevOps staff, and team leads. The product itself is secondary here; the techniques are what transfer.

## Two work zones and two checkpoints

The team separates the platform core (orchestrator, workers, portal, API, infrastructure code) from content: reusable task blocks, scenarios, and the labs themselves. The core follows the standard route: branch, merge request, CI, deploy. Content is edited through a constructor without CI, and it is verified by a live run as a test participant. A human product owner sets priorities and decides wherever an error would be costly.

The main rule of the pipeline: a different model acts as reviewer for the author. There are two gates, and until a verdict is issued, the work does not move on.

The first gate sits on the spec, before the first line of code. The reviewer looks for contradictions, missed cases, and violations of basic platform rules such as participant isolation and roles. Rewriting a paragraph of a spec costs less than a migration. A large spec for the trainer agent's access went through five rounds.

The second gate sits on the branch before merging: the reviewer checks the full diff against the spec and the plan. The rules are strict, and almost every one grew out of a real problem:

- The round is synchronous and ends with a single line carrying the verdict, because agents had drifted into an asynchronous channel and polled it in a loop.
- A verdict is valid only for a specific commit; a new commit means a new round.
- A script checks that the verdict came from the reviewer and was not written by the agent itself.
- If there is no final verdict after three rounds, the author splits the request into parts.

Findings are labeled with priorities P0–P3: P0 and P1 block the merge, while P2 and P3 remain comments. Previously the table used only words like "critical," and an unfamiliar label was treated as a blocker, so merges stopped for no good reason. A lenient reading would have been worse: a real P1 blocker would have slipped through.

One owner is responsible for the branch and its delivery. For them, an open merge request is an obligation: they take it through approval, merge, deploy, and verification on the live system. Models are chosen per task: compact ones for exploration, mid-sized ones for implementation, and the heaviest only with a written justification.

## Live runs and hooks instead of text rules

A green CI for a lab guarantees little. A lab is a chain of machines running on real products, with networks and automated checks, and unit tests will not notice that a service name changed in a new image. So each lab is first run end to end: from a cold start, as a test participant, with automated checks and cleanup. To avoid idle time, the run happens on an isolated stand at the exact commit, in parallel with CI, and all failures are collected in a single pass and fixed as a batch.

The second observation: an agent follows text rules while its context is fresh, and forgets them in a long session. That is why costly mistakes are covered by hooks. A merge guard blocks a merge without approval from the second gate on the branch head and without green CI. Commit hooks cannot be skipped, and blind force pushes are prohibited. Each task gets its own working copy. Irreversible data deletion, work with secrets, and spending require a human decision. An agent cannot end a session while it still has open steps on record. The content of trainer messages is treated as data: the agent does not execute commands found in that text.

The pitfalls are instructive too. A script that was green in Linux CI failed on macOS because the two systems handle temporary-file templates with X characters differently. When an agent writes scripts on one platform and they run on another, this kind of noise erodes trust in the gate more than real findings do. Agents also picked the most convenient path and, on repeated comments, kept fixing the same spot. That led to a "reset approach" skill: after three edits without progress, the agent stops and reconsiders its solution. For long sessions, the team introduced context thresholds: a brief state handoff and an automatic restart.

## The trainer agent and rights that do not exceed a human's

A separate story is the pilot using the MCP protocol. A trainer connects their own AI client to the platform and edits course drafts on their behalf, and in the pilot also assembles labs from verified blocks. The agent's rights do not exceed the trainer's: a token is issued from the portal session, limited in time and scope, and when the role is revoked, the agent loses access. Dangerous operations run in two phases: the agent produces a preview, and a human sees the difference in the portal and confirms it. Writes are protected by optimistic locking: if the trainer has already edited the draft, the agent gets a conflict.

## What to take away

From the working setup, it is worth adopting the separation of author and reviewer, spec review before code, tying approval to a specific commit, live runs for anything that depends on the environment, and technical prohibitions instead of text rules. The limitation is honest: the team has a dedicated product owner and infrastructure for independent runs, and the material contains no metrics on speed or cost gains. The practical conclusion is still clear: before expanding an agent's rights, decide which checks stand between it and production, and encode them in code.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/companies/bizone/articles/1113992/?utm_campaign=1113992&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18962
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
