Agentic software development builds applications in which a model can select intermediate steps, gather information, update working state and invoke tools in pursuit of a bounded goal. The engineering discipline defines the environment, authority, tools, memory, stopping rules, evaluation and recovery that make this variable control loop useful and containable.
An agent can adapt to a case that was not encoded as a fixed workflow, but every extra choice expands the failure space. A plausible plan can use the wrong record, repeat a side effect, follow instructions hidden in retrieved content, exhaust a budget or claim completion without confirmation. Demonstrations often hide these failures because they run with clean data, broad credentials, expert supervision and no competing work.
Grant the smallest useful unit of agency. Begin with a deterministic workflow and make only the genuinely variable step model-directed. Tools expose narrow capabilities under server-side authorization; they do not hand the model a user session. State changes are durable, typed and replayable. Consequential actions require an independent policy decision and, where appropriate, accountable confirmation. Evaluate trajectories and outcomes, not just the final prose.
Scope
Add agency only where variation creates real value
Agency is not a product feature by itself. It is a choice to delegate parts of control flow to a probabilistic component. Start by drawing the task as if no agent existed: trigger, inputs, decisions, systems, outputs and exceptions. Stable routing, authorization, calculations and state transitions belong in ordinary code. Model-directed choice becomes valuable where the next useful step depends on variable evidence that cannot be enumerated economically.
Define the goal so the application can verify it. “Resolve the request” invites the model to decide what resolution means. “Prepare a proposed classification with cited evidence and route unresolved conflicts to the named owner” has observable completion. List non-goals and prohibited actions. Set the population and time boundary. An agent designed for internal research should not silently become a customer-communication agent because it discovers a send tool.
- Model the deterministic workflow before adding an agent.
- Delegate the smallest variable decision.
- Define completion in externally observable terms.
- Name non-goals and prohibited outcomes.
- Constrain eligible cases and operating duration.
Runtime
Own state, stopping and recovery outside the model conversation
The message history is context, not the canonical task record. Store goal, actor, current phase, gathered evidence, pending approvals, tool outcomes and completion state in typed application storage. Distinguish a proposed fact from a confirmed observation and a model inference from an external result. A worker restart should reconstruct the task without asking the model to remember. Sensitive context receives deliberate access, retention and deletion rather than indefinite accumulation as memory.
Every loop needs limits and progress tests. Cap steps, elapsed time, tokens, money, retries, fan-out and side-effect count. Define what progress means for the task and stop repeated cycles that do not reduce an open condition. Dependencies require timeout and circuit-breaker behavior. When a tool partially succeeds, query its durable status before retrying. Recovery may resume from a checkpoint, compensate a confirmed action, route to a person or close as failed. It must not be narrated into existence.
- Keep typed canonical state outside conversation history.
- Separate observation, inference, proposal and confirmation.
- Budget steps, time, cost, retries and effects.
- Detect no-progress loops and dependency degradation.
- Design resume, compensation and manual takeover.
Evidence
Test the route taken, not only the final answer
An agent can reach the correct answer through an unacceptable trajectory, such as reading unauthorized data and later omitting it. Evaluation therefore records tool selection, arguments, observations, intermediate decisions, policy checks, state transitions and external effects. Test normal cases alongside missing data, ambiguity, conflicting instructions, indirect prompt injection, slow dependencies and partial success. Use deterministic assertions for permissions and state, rubric review for judgment and simulations for tool behavior.
Move through exposure levels. Begin in a simulated environment, then shadow real work without acting, then propose changes for explicit approval. Expand autonomy only for case families and tools whose evidence supports it. NIST’s secure development guidance and AI risk work both reinforce lifecycle controls and documented responsibilities. Keep a versioned release record, observe confirmed outcomes and maintain an independently reachable kill switch. Production incidents become minimized trajectory regressions before autonomy expands again.
- Score outcome, trajectory, policy and efficiency separately.
- Test malicious observations and partial tool success.
- Progress from simulation to bounded real exposure.
- Expand by case family and tool, not by broad label.
- Preserve shutdown, replay and regression evidence.
What good looks like
Useful outcomes from agentic software development
- The agent has a named goal, operating context, non-goals and measurable completion condition.
- Every tool has a narrow purpose, typed contract, least-privilege identity and explicit side-effect class.
- Untrusted observations remain distinguishable from system policy and authorized instructions.
- Working memory, durable business state and audit evidence are separated by purpose and retention.
- Budgets limit steps, time, cost, retries, tool calls and external impact.
- High-impact actions pass deterministic authorization and appropriate human confirmation.
- The system can resume, compensate, stop or roll back without asking the model to invent what happened.
- Evaluation measures task outcome, trajectory, policy compliance, efficiency and recoverability across difficult cases.
Operating model
How to run the work
- 01
Bound the job and agency
Define the initiating actor, goal, eligible cases, completion evidence, prohibited outcomes and time horizon. Map a conventional workflow first. Identify the smallest decision that benefits from model-directed planning and keep stable transitions deterministic.
- 02
Design typed tools and authority
Expose task-specific operations with validated inputs and outputs. Resolve identity, resource access and policy in application code for each call. Separate read, propose and execute capabilities, use narrow credentials and require idempotency for side effects.
- 03
Engineer state and control loops
Store canonical task state outside the conversation. Record observations, decisions, tool results and version lineage. Define maximum steps, time, spend, retries and no-progress detection. Provide explicit terminal, blocked, failed and awaiting-approval states.
- 04
Evaluate trajectories and attacks
Build representative environments with normal cases, missing information, conflicting instructions, tool failures and malicious content. Score goal completion, valid intermediate choices, authorization, side effects, efficiency, explanation and safe stopping.
- 05
Release under observable limits
Start with simulation, shadow or approval-only operation, then expand by case and tool. Trace versions and confirmed external outcomes, monitor budget and policy breaches, and maintain kill switches, rollback, manual takeover and incident replay.
Evaluation
Questions that change the decision
- Does the task require adaptive planning, or would a workflow with one model-assisted step be safer and cheaper?
- What evidence proves completion independently of the model’s own narrative?
- Which tools are necessary, and can read, draft and execute functions be separated?
- Whose authority is used for each resource and each external action?
- What state must survive a retry or worker restart, and what context should expire?
- Which limits stop loops, duplicated work, excessive spending and scope expansion?
- Which action needs confirmation, dual control or must never be delegated?
- What representative environment can test the complete trajectory before production exposure?
Failure modes
Where teams lose control
Prompt injection in a document or tool result can redirect the plan.
Excessive tool functionality can expose actions unrelated to the assigned goal.
Broad credentials can allow a correct tool call against the wrong tenant or record.
Conversation history can diverge from canonical business state after a partial failure.
A retry can repeat a payment, message, deletion or status transition.
The agent can loop while producing superficially different plans and consuming budget.
Multi-agent delegation can obscure which component made or authorized a decision.
Long-term memory can retain sensitive or incorrect information beyond its legitimate purpose.
A human approval step can become a rubber stamp when context and consequence are unclear.
Success metrics can reward task completion while ignoring policy breaches and cleanup work.
Measurement
Measure the finished job
Measure the completed workflow, including review effort and exceptions. Output volume on its own is not evidence of a better process.
- correctly completed outcomes by case family and release
- critical policy and authorization violations before and after execution
- tool selection and argument validity by operation
- confirmed, duplicated, compensated and orphaned side effects
- steps, elapsed time, model usage and cost per successful outcome
- no-progress, budget and safety stops triggered appropriately
- human approval, rejection, modification and takeover rates
- trajectory regressions caught before production expansion
- recovery success after dependency, worker and tool failure
- incidents reproducible from state, version and event evidence
Questions
Common questions
What is agentic software development?
It is the engineering of applications where a model can choose intermediate steps and tools toward a bounded goal. It includes tool contracts, authorization, state, memory, stopping, evaluation, observability, human authority and recovery, not only a planning prompt.
When should a team use an AI agent?
Use one when variable evidence makes the next useful step difficult to enumerate and when the outcome can still be evaluated and contained. Prefer a deterministic workflow with a model-assisted step when routing and state are stable.
How do you secure an AI agent?
Minimize tools, functionality, permissions and autonomy. Enforce identity and authorization outside the model, treat observations as untrusted, validate schemas, make effects idempotent, require appropriate approval, cap resources and retain replayable audit evidence.
How do you test agentic software?
Use representative task environments and inspect complete trajectories. Test success, policy compliance, tool arguments, state transitions, budgets, attacks, failures, recovery and external confirmation. A good final sentence does not excuse an unsafe path.
Sources
Primary references
- LLM06:2025 Excessive Agency OWASP GenAI Security Project
- Secure Software Development Practices for Generative AI National Institute of Standards and Technology
- AI Risk Management Framework Core National Institute of Standards and Technology
Zeke
AI product engineering for moving a software brief into a reliable production product.
Product leaders, founders and engineering teams. Start with the workflow, constraints and evidence you already have.
See Zeke→