Engineering note
Agentic Closed-Loop Development: From Product Intent to Verified Software
A practical engineering model for using software agents across specification, implementation, verification and delivery without surrendering architectural control or production accountability.
- agentic-engineering
- ai-native-engineering
- software-delivery
- verification
- bounded-autonomy
AI-assisted coding optimizes implementation. Agentic closed-loop development redesigns the complete path from product intent to verified software.
That distinction matters because code generation is becoming cheaper while engineering certainty remains expensive. A model can produce a plausible function, component, migration, or test in seconds. It cannot make an incomplete requirement complete, decide which architectural boundary should remain stable, or prove that a change behaves correctly in a deployed environment unless the surrounding engineering system gives it the necessary context, tools, constraints, and evidence.
The bottleneck is increasingly not code generation. It is controlling intent, context, scope, verification, and accountability.
This article presents a generalized engineering model developed through production software work and independently owned systems. Client-specific implementations and identifying details are intentionally omitted.
1. Why code generation is not enough
Software engineering begins before code and ends after it. Product intent has to be interpreted, existing behavior investigated, constraints found, tradeoffs made, changes integrated, and outcomes verified. A generated patch occupies only one part of that chain.
The first failure mode is incomplete intent. A request such as “make offline synchronization reliable” sounds clear until the system has to define which operations may queue, which identity authorizes them, how long that authority remains valid, what happens after a restart, and which server result is canonical. A model can fill those gaps with reasonable-looking assumptions. Reasonable-looking is not the same as authorized or correct.
The second failure mode is stale context. Repositories contain history, conventions, domain rules, and operational constraints that are not visible from a narrow code excerpt. Without that context, generated work may duplicate an existing abstraction, violate a boundary, or solve a symptom in the wrong layer. The patch may compile while making the system harder to change.
Architecture violations are especially easy to miss because they often pass local checks. A new dependency can bypass a domain service. A component can take ownership of server state that belongs elsewhere. A retry can be added in a client even though idempotency has to be guaranteed by the backend. Each change may look locally coherent while weakening the system as a whole.
Business-rule mistakes are harder. Tests only prove what they assert. If a test encodes the same mistaken assumption as the implementation, a green suite confirms consistency between two wrong artifacts. Generated tests can even optimize for the current patch rather than the intended behavior, producing impressive coverage around an invalid model.
Scope also drifts. An agent asked to repair one failure may refactor neighboring modules, rename public interfaces, update unrelated dependencies, or “clean up” configuration it does not understand. The extra work is not free. It increases review surface, expands regression risk, and makes it harder to attribute a failure to one decision.
Finally, local success is weak evidence for environment-dependent behavior. Authentication, browser APIs, database constraints, network transitions, deployment configuration, caches, physical devices, and production data shapes can invalidate a patch that passed static checks and mocked tests.
Compiling is not proof. Passing tests is not always product proof. A deployment that completed is not proof that the intended behavior works. The engineering system has to climb to the highest practical verification layer and report where its evidence stops.
2. Definition of agentic closed-loop development
Agentic closed-loop development is a controlled software-delivery system in which an agent can move through a bounded sequence of investigation, implementation, observation, comparison, and correction. It is not unrestricted autonomy.
The loop starts with a goal: a concrete outcome expressed in product or operational terms. The goal is accompanied by context: repository instructions, architecture, domain facts, constraints, exclusions, and the current state of the system. The agent takes an action inside approved scope, then obtains an observation from tools or runtime behavior.
That observation is compared with explicit acceptance criteria. If the evidence contradicts the criteria, the system may perform bounded correction when the failure is understood and the repair stays within authority. If the next action requires new product judgment, broader access, destructive work, or a change to the agreed model, the loop stops and escalates.
The loop ends with a final accountable decision. A person or an explicitly authorized release process decides whether the evidence is sufficient to merge or release. The agent can prepare that decision and make uncertainty visible. It cannot make accountability disappear.
This model changes the unit of delegation. The unit is no longer “write this code.” It becomes “move this bounded work item from stated intent to defensible evidence, stopping when authority or facts run out.”
The loop can be represented as a small decision contract rather than an open-ended instruction:
type LoopDecision =
| { status: 'accepted'; evidence: Evidence[] }
| { status: 'correct'; defect: Defect; attemptsRemaining: number }
| { status: 'escalate'; reason: string; evidence: Evidence[] };
The useful property is not the TypeScript. It is the forced distinction between accepted evidence, a correctable defect, and a decision the agent does not own.
3. Reference lifecycle
The lifecycle is intentionally explicit. Each stage produces information needed by the next, and later evidence may send work back for correction.
Product intent
Product intent describes the desired behavior and why it matters. It should name the user or operational consequence, not merely prescribe a code edit. Intent also defines exclusions. A narrow goal with explicit non-goals is more useful than a broad ambition that invites interpretation.
Investigation
Investigation establishes repository truth. The agent traces the relevant routes, data ownership, contracts, tests, configuration, deployment path, and current runtime behavior. It separates facts from assumptions and identifies missing information before editing. Investigation is where a plausible plan becomes a repository-grounded plan.
Specification
The specification turns intent into scope, constraints, acceptance criteria, evidence requirements, and authority boundaries. It should state what must remain unchanged. When a behavior spans client, API, database, or device state, the criteria must describe the end-to-end result rather than one implementation detail.
Scoped implementation
Implementation is constrained by the specification. The agent changes the smallest coherent set of files and preserves unrelated work. It does not treat access to a repository as permission to redesign it. If the implementation exposes a contradiction in the specification, that is evidence to escalate, not permission to improvise.
Quality gates
Quality gates provide deterministic feedback: type checks, linting, unit tests, integration tests, contract checks, builds, and repository-specific verification. They should be selected for the risk of the change. Running every available command can waste time; running only the easiest command creates false confidence.
Preview or release deployment
Some behavior cannot be proved from source or a local process. A production-equivalent deployment exposes routing, asset, environment, security-header, and integration behavior that a build cannot. The deployment is an evidence surface, not an administrative afterthought.
Runtime verification
Runtime verification exercises the real interface: browser navigation, API behavior, database effects, network transitions, background processing, or physical-device operation. Evidence should distinguish local, preview, release, and production environments. A screenshot proves visible state at one moment; it does not prove an invisible backend invariant.
Bounded correction
When verification fails, the agent can diagnose and repair within the approved scope. The correction loop has a retry limit and a clear stop condition. Repeated failure is information that the model, environment, or requirement may be wrong. It is not an invitation to keep changing the system until a check turns green.
Human release decision
Release authority remains explicit. The accountable person evaluates evidence, unresolved risk, reversibility, and operational readiness. High-risk changes may require additional approval even when every automated check passes.
Documented outcome
The final record states what changed, what was verified, which environment supplied the proof, what remains uncertain, and what was deliberately excluded. This record improves future context and prevents a polished summary from overstating the evidence.
4. Four system layers
The lifecycle becomes easier to operate when responsibilities are separated into four layers.
Control layer
The control layer holds intent and state. It includes work items, specifications, acceptance criteria, project state, release state, and verification results. This layer answers: What are we trying to achieve? What is allowed? What evidence is required? Where is the work now?
The control layer should not be a chat transcript. Important decisions need durable representation so another person or agent can inspect why a boundary exists. A lightweight specification in the repository is often enough. The value comes from clarity and reviewability, not from building a new orchestration product.
Agent execution layer
The execution layer performs codebase investigation, planning, implementation, refactoring, tests, documentation, and controlled tool use. It needs the minimum authority required for the task. Read access may be broad while write access remains scoped. Production credentials should not be available merely because the agent can edit application code.
Execution should produce small, inspectable changes. Large autonomous batches make failure attribution difficult. The agent should preserve the distinction between work it observed, work it changed, and work it only inferred.
Verification layer
The verification layer evaluates results through static checks, unit tests, integration tests, builds, browser and API behavior, deployed-environment checks, and production-readiness constraints. The important design choice is independence: verification should not rely entirely on the same reasoning that produced the patch.
Deterministic checks are valuable because they fail consistently. Runtime checks are valuable because they encounter real integration boundaries. Human review is valuable where intent and tradeoffs cannot be reduced to an assertion. Strong verification combines them instead of pretending one layer replaces the others.
Governance layer
The governance layer defines tool permissions, autonomy boundaries, retry limits, approval gates, schema and security controls, merge and release authority, and restrictions on destructive operations. Governance is part of the engineering design, not a policy document added after the agent has broad credentials.
A useful governance rule is specific enough to execute. “Be careful with production” is weak. “The agent may prepare a deployment and verify its preview, but production release requires named human approval” creates an enforceable boundary.
5. Context engineering
Prompts are transient. Engineering context must be versioned, reviewable, and maintained alongside the system it governs.
A one-off prompt can describe the immediate request, but it is a poor home for durable architecture and domain knowledge. Repository-owned instructions can define directory ownership, public and private boundaries, test expectations, deployment constraints, known risks, and the conditions that require escalation. Architecture decisions can explain why a boundary exists. Domain documents can state invariants that code alone does not reveal.
Context needs structure. A single enormous instruction file becomes another stale document that agents partially read and humans stop reviewing. General rules belong near the repository root. More specific rules belong close to the code they govern. Task-specific facts belong in the task. Retrieval should load the narrowest relevant context rather than dumping the entire organization into every execution.
Context also needs an owner. Instructions that no longer match the system are worse than missing instructions because they create confident mistakes. When architecture, deployment, or policy changes, the related context should change in the same review. Verification can include checks that referenced paths and commands still exist.
Good context does not eliminate investigation. It directs investigation toward the right evidence and makes established boundaries explicit. The repository remains the source of truth; instructions are a maintained map, not a substitute for looking at the terrain.
6. Verification at the highest practical layer
Source inspection is not runtime proof. A successful build is not product proof. A mocked test is not integration proof.
The verification ladder starts with static analysis. Types, lint rules, schema validation, and dependency checks catch classes of error quickly. They are cheap and should run early, but they say little about real user behavior.
Unit tests verify isolated logic and invariants. They are excellent for state transitions, calculations, parsers, and policy rules. Their weakness is the boundary they intentionally remove.
Integration tests reconnect components: application and database, client and API, queue and worker, identity and authorization. They expose contract disagreement and state behavior that unit tests cannot.
Build verification proves the application can be assembled for its target mode. It catches missing imports, bundling failures, static-generation problems, and incompatible assets. It still does not prove the built artifact is correctly hosted or usable.
A preview or release deployment exercises deployment configuration, routes, environment variables, assets, and platform behavior. This is the first layer that resembles the delivery target.
Browser, API, and runtime verification exercise the deployed interface. For a web product that may include navigation, canonical metadata, forms, accessibility, network requests, and console behavior. For an offline mobile product it may include loss of connectivity, restart, reauthentication, queue recovery, and physical-device behavior.
The final production-readiness gate evaluates the full evidence set, operational risk, observability, rollback, and unresolved issues. The highest practical layer depends on the change. A copy correction does not need a physical-device test. A synchronization change does.
The critical reporting rule is to name the boundary. “Tests pass” is incomplete. Which tests, against which artifact, in which environment, and what remains unproved?
7. Bounded autonomy
The objective is maximum reliable delegation, not maximum agent freedom.
Authority should be grouped by risk and reversibility.
Autonomous work
An agent can usually investigate code, implement approved scope, write and run tests, prepare isolated changes, create a preview, and perform bounded corrective action. These activities are inspectable and reversible when source control and environment boundaries are sound.
Approval-gated work
Authentication and authorization changes, schema migrations, shared infrastructure, protected-branch merges, production releases, destructive operations, and major requirement changes require explicit approval. The agent may investigate, propose, prepare, and verify. It may not convert preparation into authority.
Prohibited work
Some actions are prohibited to both agents and hurried humans: disabling verification to obtain a green result, bypassing failing gates, exposing secrets, force-rewriting shared history without explicit authorization, changing requirements silently, hiding failed checks, and expanding scope without accountability.
| Activity | Agent authority | Human responsibility |
|---|---|---|
| Read code and investigate | Autonomous | Oversight |
| Clarify material ambiguity | Escalate | Decide |
| Implement approved scope | Autonomous | Review when needed |
| Run checks and previews | Autonomous | Oversight |
| Retry bounded failures | Autonomous within limit | Intervene after limit |
| Change authentication or schema | Propose only | Approve |
| Merge protected branches | Prepare only | Approve |
| Release production | Prepare and verify | Approve |
| Bypass verification | Prohibited | Prohibited |
| Expose secrets | Prohibited | Prohibited |
Authority is not static. A low-risk documentation change can move through the loop with little intervention. A change affecting money, identity, tenant boundaries, or irreversible data needs narrower permissions and stronger proof.
8. Self-healing boundaries
“Self-healing” is useful only when the repair target is understood and bounded. An agent may rerun a failed deterministic command, restore an expected local service, regenerate a generated artifact, correct a fixture or invocation error, or repair an implementation defect inside approved scope.
Those actions respond to evidence without changing the problem. They are reversible, and their success can be measured by the same acceptance criteria.
Self-healing must not invent requirements, change a security model, redesign architecture, silently migrate data, refactor unrelated systems, or suppress a failure. An agent that changes the gate until it passes is not healing the system. It is removing the evidence.
Retries need limits. One transient network retry may be reasonable. Repeating the same failing deployment ten times is not a strategy. After a small number of well-understood attempts, the system should escalate with the failure evidence, attempted corrections, and the next decision required.
The same rule applies to local environments. Restoring a documented database service is different from deleting state because a test is inconvenient. The first returns the environment to an expected condition. The second changes evidence and may destroy work.
9. Failure modes
Agentic systems do not remove engineering risk. They move more of that risk into specification quality, context quality, tool governance, and verification design.
Ambiguous specifications create confident divergence. The agent chooses one interpretation, implements it thoroughly, and reports completion even though the product decision was never made.
Stale context directs correct execution toward the wrong architecture. This is dangerous because the agent appears disciplined while following an obsolete rule.
Tests optimized instead of behavior occur when the implementation and test are generated together around the same assumption. The suite passes, but no independent evidence connects it to the intended outcome.
Environment collisions corrupt proof. Two tasks may share a database, port, worktree, or deployment target. A passing test can result from another process, and a cleanup can destroy unrelated state.
Flaky verification teaches the system to retry rather than understand. If a gate fails nondeterministically, the response should include diagnosing the gate, not normalizing repeated execution until a favorable result appears.
Hidden dependencies surface late. A local module, external service, authentication state, or generated asset may be missing from the declared workflow. Investigation and production-equivalent builds reduce this risk.
Runaway scope produces large, polished diffs that are difficult to verify. Agents are good at continuing. The system needs explicit stop conditions and exclusions.
Polished but misleading reports are a governance failure. A report that says “production verified” after only a local build is worse than a terse report that names the actual boundary.
False confidence from local checks appears whenever environment-specific behavior is treated as incidental. Deployment and runtime are part of the product.
Human rubber-stamping defeats the approval model. If the final reviewer cannot understand the scope, evidence, and unresolved risk, the approval gate is ceremonial. The system should summarize decisions, not overwhelm the reviewer with raw logs.
10. Adoption stages
Teams do not need to jump from editor completion to autonomous delivery. A staged model exposes weaknesses before authority expands.
1. AI-assisted implementation
Individuals use models for explanation, drafting, refactoring, and review. Humans sequence every step and verify results. The priority is learning where assistance improves work and where it produces plausible mistakes.
2. Structured agent execution
Tasks gain explicit scope, repository instructions, acceptance criteria, tool boundaries, and standard verification commands. Agents can complete bounded work while humans remain closely involved.
3. Closed-loop verification
Agents run deterministic checks and runtime validation, compare evidence with criteria, and perform limited correction. Reports distinguish local, preview, and production proof.
4. Governed autonomy
Low-risk work can progress with limited intervention. Permissions, retry limits, escalation conditions, and approval gates are enforced. High-risk decisions remain human-owned.
5. Measured engineering platform
The organization measures whether the system improves delivery rather than assuming more automation is better. Useful measures may include lead time, intervention rate, retry rate, verification failures, escaped defects, deployment success, cost per completed work item, and the percentage of autonomous versus approval-gated execution.
Measurements need context. A lower intervention rate is not automatically good if escaped defects rise. A higher retry rate may reveal stronger verification or weaker specifications. The purpose is to improve the engineering system, not to create a vanity autonomy score.
Adoption should expand authority only after the previous stage produces reliable evidence. Tool access is easy to grant and difficult to govern after workflows depend on it.
Conclusion
Agentic closed-loop development is conventional engineering discipline made explicit around a new execution capability. It treats code generation as one tool inside a larger system of intent, context, bounded action, independent evidence, correction, escalation, and accountable release.
The model is useful because it refuses two weak extremes. It does not reduce AI to autocomplete, and it does not pretend autonomy removes the need for architecture, security, verification, or human judgment. It delegates aggressively where work is bounded and observable, then stops where facts or authority end.
An independently owned example of these principles appears in the Ordr.now offline recovery and idempotent synchronization proof. The point is not that one product proves a universal model. It shows how explicit behavioral criteria, layered verification, and human release authority can constrain agent-assisted implementation in a real system.
The concrete repository, worktree, offline-mobile, device, and production-proof implementation is documented in Inside the Ordr.now Agentic Engineering Loop.
The useful question is not whether an agent can write the code. It is whether the engineering system can prove that the resulting software satisfies the intended behavior without sacrificing security, maintainability, or accountability.