AI Agent Software Engineering in Practice: IT Support and Code Repair

    This article explains how AI agents move large language models from answering questions to carrying out multi-step engineering and operations tasks. It covers the five layers of a production agent system, two use cases (IT support ticket handling and code defect repair), three workflow design principles, common risks, a phased rollout plan, and metrics for evaluating results.

    1. Background: From Assisted Coding to Agent Workflows

    For the past few years, large language models have entered R&D and operations mainly as question-answering tools and code completion tools. A developer asks a question, the model offers a suggestion, and a person still carries out the actual work. This approach is easy to adopt, but its level of automation is limited. The model cannot keep track of a task over time, call system tools, or adjust its next step based on execution results.

    AI agent workflows change this boundary. After receiving a goal, a model can break it into steps, call tools, read the returned results, and decide the next action within agreed limits. For enterprises, the real value does not come from the model being able to write code. It comes from the model’s ability to connect to existing ticketing systems, code repositories, knowledge bases, and monitoring platforms, and to complete an entire business process.

    As a result, the central questions in agent software engineering have changed. Teams no longer need to ask only whether a model can complete a task. They need to determine the boundaries within which the task can be completed, how to roll back after an error, and which actions require human confirmation. These answers determine whether a system can enter production.

    2. Core Components of Agent Software Engineering

    A production-ready agent system typically includes five layers.

    1. Model layer: This layer understands natural language input, generates plans and code, and decides when to call tools. Model selection should weigh reasoning ability, context length, response latency, and cost.

    2. Tool layer: This layer wraps internal enterprise capabilities as callable functions, such as querying ticket status, reading logs, submitting code changes, and restarting non-core services. Each tool should have clearly defined input parameters and return structures, so the model does not assemble commands freely.

    3. Orchestration layer: This layer manages execution order, state transitions, and retry logic. When a step fails, the orchestration layer decides whether to retry, hand the task to a person, or stop the entire workflow.

    4. Policy layer: This layer defines which operations can run automatically, which require approval, and which are prohibited. Policies should exist independently of model prompts and be enforced on the server. The system should not rely on the model to comply voluntarily.

    5. Observability layer: This layer records the input, output, duration, and decision basis of every tool call, and supports replay and audit. Without complete logs, teams cannot analyze the causes of errors or prove that system behavior meets compliance requirements.

    The five layers work together in a simple sequence. The model proposes an action, the policy layer decides whether to allow it, the tool layer executes it, the orchestration layer advances the workflow, and the observability layer keeps a record.

    3. Typical Use Cases

    3.1 Automated Triage and Handling of IT Support Tickets

    IT support is one of the easiest areas to start with for agents. Problem types tend to be concentrated, and most operations are reversible. A typical workflow looks like this:

    1. Read the title, description, and attachments of a new ticket, and identify its category, such as account permissions, network connectivity, software installation, or email issues.
    2. Search the knowledge base for a matching standard resolution.
    3. For low-risk issues, such as password reset instructions or common configuration guidance, reply to the user directly and record the result.
    4. For operations that change system state, such as granting a user access to a specific system, generate an approval request and wait for authorization.
    5. If two consecutive attempts fail, or the user does not confirm that the issue is resolved, automatically hand the ticket to a frontline engineer and attach the steps already tried.

    The key to this workflow is tiering. The agent does not need to handle every ticket. It only needs to take over the repetitive, clearly rule-based work, and leave complex and high-risk cases to people.

    3.2 Locating and Fixing Code Defects

    Code repair covers scenarios such as handling static analysis alerts, fixing failing unit tests, and investigating dependency version conflicts. A typical workflow looks like this:

    1. Pull the failing test cases and error logs, and locate the related code files.
    2. Generate proposed changes on a separate branch.
    3. Run the test suite and static checks to confirm that the changes do not introduce new failures.
    4. Submit a merge request for review by the code owner.
    5. Pass the continuous integration pipeline before merging.

    The agent should never write directly to the main branch. Every change should pass three checkpoints: branch isolation, automated testing, and human review. The fix success rate is not the only measure of value. The time reviewers need to understand a change matters just as much.

    3.3 Digital Employee Services

    Digital employees are services in which agents take on part of a function’s work. Examples include organizing meeting minutes, summarizing key points from documents, answering questions about internal policies, and helping fill in expense reimbursement forms. The main challenge for these services is data access. Agents should receive minimum access based on their role and responsibilities, and sensitive fields should be masked.

    4. Three Principles for Workflow Design

    4.1 Policy Constraints Come Before Capability Expansion

    When teams introduce agents, a common approach is to give them as many tools as possible and then gradually tighten permissions. A safer approach works in the opposite direction. Start with a minimal tool set. Require each new tool to come with a stated purpose, an impact scope, and a rollback method.

    The following simplified risk-tiering example shows how to decide whether an operation needs human confirmation.

    1. from dataclasses import dataclass
    2. from enum import Enum
    3. class RiskLevel(Enum):
    4. LOW = "low"
    5. MEDIUM = "medium"
    6. HIGH = "high"
    7. @dataclass
    8. class ActionRequest:
    9. target_system: str
    10. action_type: str
    11. risk: RiskLevel
    12. PROTECTED_SYSTEMS = {"production-database", "payment-gateway"}
    13. def requires_human_approval(request: ActionRequest) -> bool:
    14. """Check whether an action must be approved by a human."""
    15. if request.risk is RiskLevel.HIGH:
    16. return True
    17. if request.target_system in PROTECTED_SYSTEMS:
    18. return True
    19. return False
    20. def execute_action(request: ActionRequest) -> str:
    21. if requires_human_approval(request):
    22. return "pending_approval"
    23. # Call the wrapped tool function here and record an audit log
    24. return "executed"

    The main point of this code is not the decision logic itself. It is where the check happens. The policy check runs before the tool call, on the server, so the model cannot bypass it.

    4.2 Define Exception Handling Explicitly

    During execution, agents encounter tool timeouts, malformed return formats, insufficient permissions, and results that do not match expectations. Each type of exception needs a predefined handling method.

    • Timeout: Limit the number of retries. Hand the task to a person when the threshold is exceeded.
    • Format error: Record the raw returned content and stop the current step. Do not let the model guess missing fields.
    • Insufficient permissions: Stop immediately. Do not try to bypass access controls through other paths.
    • Unexpected result: Preserve the current data and generate a problem summary for human review.

    The core principle of exception handling is that failures must be visible. The system should make clear which step failed and what state the system was in beforehand. It should not skip the failure silently.

    4.3 Apply Human Oversight to High-Impact Changes

    Human oversight should not mean confirming every individual action. Otherwise, it cancels out the efficiency that automation provides. A better approach is to set the level of oversight according to the scope of impact.

    • Read-only operations: No confirmation needed. Log only.
    • Reversible, low-risk changes: Execute automatically, with a rollback window.
    • Changes affecting multiple users or core systems: Require approval from the owner.
    • Changes involving funds, private data, or security configuration: Prohibit automatic execution.

    5. Risks and Boundaries

    The risks of agent systems mainly fall into four areas.

    Uncertainty in model output. The same input can produce different plans at different times. To manage this, hand critical decisions to deterministic rules, and limit the model to generating suggestions and organizing information.

    Prompt injection. Ticket text, web pages, and documents may contain language that pushes the model toward unintended actions. Systems should treat external content as data rather than instructions. Permission checks in the tool layer must not depend on the model’s judgment of that content.

    Permission creep. If an agent account keeps broad permissions for a long time, misuse can quickly expand its impact. Use a dedicated service account, set an expiration period, and review the permission list regularly.

    Accountability. When a problem occurs after an agent makes a change, the team must be able to trace it back to specific inputs, decisions, and executors. This requires building the observability layer from the start.

    6. Rollout Path

    A phased approach is recommended.

    In the first phase, choose a low-risk, highly repetitive scenario, such as ticket classification or document summarization. Open only read-only tools, and observe the model’s accuracy and the types of errors it makes.

    In the second phase, enable write operations in scenarios with clear rollback methods, such as generating code fix branches in a test environment. At the same time, set up an approval workflow and track how often humans modify the agent’s suggestions.

    In the third phase, extend validated workflows to more teams, and establish unified tool registration, permission management, and audit mechanisms.

    In the fourth phase, gradually reduce human involvement in mature scenarios, while keeping mandatory approval for high-risk operations.

    At the end of each phase, teams should review the data and decide whether to move to the next phase. They should not advance mechanically on a fixed schedule.

    7. Choosing Evaluation Metrics

    A single metric can easily mislead when evaluating an agent system. Track the following categories together.

    • Task completion rate: The share of tasks completed without human intervention.
    • Error rate: The share of actions that were rejected in review or later shown to be wrong.
    • Average handling time: The time from task intake to completion. Report the automated portion and the human-handled portion separately.
    • Review burden: The average time reviewers spend on each change.
    • Recovery time: The time from detecting a problem to restoring normal service.

    Set baseline values before the pilot begins, then compare them with the data collected after the agent is introduced. Without a baseline, any improvement is hard to prove.

    8. Summary

    The value of agent software engineering comes from combining the reasoning ability of models with an organization’s existing tools, processes, and governance mechanisms. IT support, code repair, and digital employee services are good starting points because their processes are relatively clear and their impact can be controlled. Success