Skip to content
AI360Xpert
Gen AI

Agentic Software Engineering

Instead of an AI just autocompleting your current line of code, an Agentic Software Engineer reads a GitHub issue, clones the repo, runs the tests, writes the fix, and opens a Pull Request entirely on its own.

An Agentic SWE operates in a continuous loop: reading logs, editing files, and running commands.
An Agentic SWE operates in a continuous loop: reading logs, editing files, and running commands.

Why Does This Exist?

Basic program synthesis (like GitHub Copilot) is incredibly useful, but it requires constant human micromanagement. The human has to decide which file to open, where to put the cursor, and how to test the resulting code.

Real software engineering is not just typing syntax; it is exploring a codebase, reading documentation, debugging cryptic error messages, and navigating the terminal. Agentic Software Engineering attempts to automate this entire workflow. By combining Code LLMs with Agent architectures (tools, memory, and planning), researchers have built autonomous agents (like Devin or SWE-agent) that can act as independent junior developers on a team.

Think of It Like This

Think of It Like This

Program Synthesis: Like a highly advanced power drill. It makes drilling the hole 100 times faster, but you still have to hold it, aim it, and pull the trigger.

Agentic Software Engineering: Like a robotic carpenter. You hand it a blueprint ("Build a bookshelf"). It looks around the room, finds the wood, picks up the drill, measures the cuts, screws it together, and sweeps up the sawdust.

How It Actually Works

An Agentic SWE is essentially a loop connecting an LLM to a sandboxed computer terminal.

1. The Environment (The Sandbox)

The agent is placed in a secure Docker container containing the target codebase, a bash terminal, a code editor, and the necessary language runtimes (e.g., Python, Node.js).

2. The Toolset

The agent is given specific tools it can call. For SWE-agent, these include:

  • search_dir: Finds where a function is defined.
  • view_file: Reads a specific file into the agent's context window.
  • edit_file: Replaces lines of code.
  • run_command: Executes bash commands (e.g., pytest or npm run build).

3. The Execution Loop

When given a GitHub issue (e.g., "Fix the NullPointer crash when users upload a PDF"), the agent:

  1. Searches the codebase for the file handling PDF uploads.
  2. Views the file to find the bug.
  3. Edits the file to add a null check.
  4. Runs the test suite via the terminal.
  5. If the tests fail, the agent reads the traceback error from the terminal, updates its mental model, and edits the code again (Self-Correction).
  6. When tests pass, it creates a commit.

Benchmarking (SWE-bench)

We measure these agents using SWE-bench, a dataset of real, resolved GitHub issues from popular open-source repositories (like Django or scikit-learn). An agent is given the issue description and the repo, and its success is measured by whether its generated Pull Request passes the project's actual unit tests.

Show Me the Code

This pseudo-code demonstrates the core loop of an autonomous coding agent.

def agentic_swe_loop(github_issue, agent, sandbox):    agent.set_goal(github_issue)        while not agent.is_finished() and not agent.is_stuck():        # The agent plans its next move based on context        action, tool_args = agent.plan_next_action()                # It executes the action in the real terminal/editor        if action == "edit_file":            observation = sandbox.edit(tool_args.filepath, tool_args.code)        elif action == "run_command":            observation = sandbox.run_bash(tool_args.command)        elif action == "search":            observation = sandbox.grep(tool_args.query)                    # The agent reads the terminal output and updates its context        agent.update_memory(observation)            return sandbox.generate_git_diff()

Watch Out For

Infinite Debugging Loops

Agents easily get stuck in "doom loops." The agent writes code, runs a test, gets an error, writes a slightly different broken fix, gets the same error, and loops forever until its context window fills up or the API budget is exhausted.

Destructive Commands

Because the agent has terminal access, it can execute catastrophic commands. If an agent decides to run rm -rf / or push broken code to the main branch, it can destroy infrastructure. Agentic SWEs must always be run in isolated, ephemeral sandboxes with strict network boundaries.

The Quick Version

  • Agentic Software Engineering upgrades AI from "code autocompleter" to "autonomous developer."
  • It works by giving an LLM access to a sandboxed terminal, a code editor, and a search tool.
  • The agent explores the codebase, edits files, runs tests, and reads error logs to iteratively debug its own code without human intervention.
  • The state-of-the-art is measured on SWE-bench, tracking how many real-world GitHub issues an agent can resolve entirely on its own.

Related concepts