What Developers Should Design When Agents Take Over Execution
When an AI agent starts taking over tasks, developers often ask whether they still need to write code. The answer is yes, but what they write changes: instead of step-by-step instructions, they design boundaries, state, and feedback. This article breaks down the engineering work required to make agent execution stable, controllable, and auditable, covering explicit goals and acceptance criteria, least-privilege permissions, memory and identity design, multi-agent collaboration protocols, observability and evaluation, and keeping humans in the loop.
When an agent starts taking over tasks, many developers’ first reaction is: “Do I still need to write code?” The answer is yes, but what you write changes. In the past we wrote steps; now we write boundaries, state, and feedback.
From a technical perspective, an agent can often be abstracted as a loop that repeatedly calls a large language model API: perceive input, retrieve context, generate a decision, call a tool, observe the result, and enter the next round. This description is simple, but it accurately reveals where the engineering difficulty lies—the loop itself is not hard to write; what is hard is making that loop stable, controllable, and auditable in real business scenarios.
From an interaction philosophy perspective, it marks a restructuring of the human-machine relationship: a shift from “command and control” to “intent and collaboration.” Developers are no longer just designing systems; they are more like cultivating a digital species with behavioral tendencies: give it a goal, give it memory, give it an identity, give it collaboration rules, and then observe how it evolves within boundaries.
This article tries to bring that idea down to the engineering level and answer a specific question: when execution authority is partially handed over to an agent, what do developers actually need to design?
1. Making Goals and Intent Explicit: Turning “What I Want” into Verifiable Conditions
When humans give requirements to colleagues, they omit a lot of shared understanding, but an agent does not have those default assumptions. The first design task is therefore to translate vague intent into decidable goals and acceptance criteria.
A three-layer structure is recommended: the top layer is the business goal (why it is done), the middle layer is task decomposition (what is done), and the bottom layer is verifiable completion criteria (what counts as done). Completion criteria should be automatically verifiable as much as possible, for example “the generated file contains field X and passes validation Y,” rather than “make it better.”
A sample structure looks like this:
{"goal": "Summarize this week's production alerts and provide remediation suggestions","constraints": ["Do not read logs unrelated to this task", "No more than 5 tool calls per round"],"acceptance": ["Output includes the distribution of alert severity levels","Each suggestion includes the corresponding metric name","The time range of referenced data is consistent"]}
When acceptance criteria cannot be automatically verified, a human confirmation point should be explicitly introduced instead of letting the model guess that “close enough is fine.” The quality of this step directly determines the controllability of all subsequent stages.
2. Constraints and Permission Design: The Greater the Capability, the Harder the Boundary
The core reason an agent can take over tasks is that it can call tools: read and write storage, send messages, operate container platforms, and query log services. Permission design therefore becomes the first security gate, based on the principle of “least privilege + tiered authorization + immediate revocation.”
Least privilege means each task requests only the resource scope it truly needs. Tiered authorization means separating read-only, write, and destructive operations into different levels, with higher-level operations requiring additional confirmation. Immediate revocation means credentials should have short lifetimes and be revocable, rather than being long-lived static keys.
You also need to design an “action allowlist” and a “parameter validation layer”: the model outputs intent parameters, but before actual execution these must pass deterministic code validation—for example, whether a path is out of bounds, whether a time range is valid, and whether the target resource is in the allowed list.
A common mistake is to rely on prompts for security. Prompts can be bypassed; validation code cannot.
3. Memory and Identity: Making State Persistent, Explainable, and Clearable
After introducing an LLM into a system, software is no longer a stateless function but a digital entity with memory. Memory design should distinguish three types: short-term context (the current task window), long-term knowledge (relatively stable domain material), and experiential memory (trajectories and results of past tasks).
Mixing the three is the root cause of degraded performance in most agents: context is crowded out by irrelevant history, outdated conclusions are retrieved, and erroneous experiences are reused repeatedly.
In engineering practice, it is recommended to attach metadata to memory: source, time, confidence, applicable scope, and expiration conditions, with support for task-level isolation and one-click clearing.
Identity addresses “who is speaking, on whose behalf, and what responsibility is borne.” Establishing a stable identifier, responsibility description, and code of conduct for an agent makes behavior traceable: when something goes wrong, you can locate the specific execution entity and its permission scope, rather than vaguely blaming “the system.”
4. Collaboration Protocols: From a Single Point of Intelligence to a Composable Multi-Agent System
An agent is no longer an isolated node but a member of a collaborative society. The key to multi-agent collaboration is not “many” but clear protocols: who is responsible for decomposition, who executes, who reviews, how conflicts are arbitrated, and how results are merged.
A minimal closed loop of “orchestrator–executor–reviewer” is recommended, using structured message passing to avoid free-text cross-contamination. A message should contain at least a task identifier, input summary, dependent artifacts, expected output format, and timeout policy.
Termination conditions and budget limits (number of rounds, elapsed time, number of calls) should also be designed to prevent agents from waiting on each other or looping infinitely.
Collaboration must also consider idempotency: repeatedly delivering the same task should not cause duplicate writes. This is especially important in scenarios involving message queues and object storage.
5. Observability and Evaluation: Replacing “It Feels Better” with Metrics
An agent without evaluation cannot iterate. Three layers of observability need to be established: the process layer records the input summary, tool calls, and return codes of each round; the quality layer uses automatically computable metrics to measure output, such as format compliance rate, citation coverage, and task completion rate; the business layer focuses on manual rework rate and average handling time.
On this basis, build a regression test set that turns historical failure cases into tests, and run them after any prompt or model change.
Canary releases are equally necessary: run a new version on a small fraction of tasks first, compare it against the baseline in parallel, and expand the scope only after metrics show no regression. Rollback capability requires versioned configurations and artifact snapshots, ensuring any change can be reverted.
6. Human-Machine Division of Labor and Fallback: Keeping the Human in the Loop
Human-machine collaboration is not about removing humans from the process, but reallocating attention. Characteristics suitable for automation are clear goals, automatically verifiable results, and low failure cost; characteristics requiring human intervention are vague goals, high-risk write operations, and large cross-system side effects.
Fallback design includes proactively asking for help when confidence is insufficient, stopping and escalating when consecutive failures reach a threshold, and requiring secondary confirmation for all destructive actions.
In general practice on cloud platforms such as Baidu AI Cloud, these capabilities are typically provided by a container platform for runtime, log services and monitoring alerts for observability, and object storage for artifacts. What developers need to do is combine these general categories into a closed loop, rather than relying on a single point of capability.
Conclusion
Back to the original question: after an agent takes over tasks, what do programmers design? They design the decidability of goals, the hardness of permissions, the boundaries of memory, the protocols of collaboration, the closed loop of evaluation, and the position of human intervention.
Technically it is a loop; in engineering it is a governance mechanism; philosophically it is a migration from command to collaboration. The change in the developer’s role is not being replaced, but shifting from “a person who writes steps” to “a person who defines rules, builds the environment, and observes evolution”—which is precisely a higher-order requirement on system design capability.
