AIVANA BRAYNOR
AI Engineering
Topic 3 of 15
6-8 hours
Advanced

AI Coding Agents

Master AI coding agents that autonomously plan, code, test, and create pull requests with human approval, sandboxing, and audit trails for safe autonomous software development.

Agent architecture
Repository understanding
Planning and tool calling
File and terminal operations
Git workflows
Pull request creation
Human approval
Sandboxing and permissions
Devin
Claude Code
Cursor Agents
GitHub Copilot Workspace
Aider
OpenHands

Executive Overview

AI coding agents are autonomous AI systems that can plan, write, test, and deploy code with minimal human oversight. Unlike AI-assisted coding where the developer controls every step, coding agents work independently: they understand the repository, plan changes, write code, run tests, create pull requests, and respond to review feedback. The architecture of a coding agent includes: repository understanding (reading and understanding the codebase), planning (deciding what steps to take), tool calling (file operations, terminal commands, code execution), code generation (writing new code and modifying existing code), test execution (running tests to verify changes), git workflows (creating branches, commits, pull requests), and human approval (pausing for human review at critical points). Key tools include Devin, Claude Code, Cursor Agents, GitHub Copilot Workspace, Aider, and OpenHands. The risks of uncontrolled autonomous coding are significant: agents may introduce bugs, security vulnerabilities, or break existing functionality. Mitigation requires: sandboxing (isolate agent execution), permissions (limit what agents can do), human approval (require sign-off for changes), audit trails (log all agent actions), and comprehensive testing (verify agent output). The workflow is: Human specifies task to AI Agent to Agent plans to Agent writes code to Agent runs tests to Agent creates PR to Human reviews to Human approves or requests changes. This topic covers the complete landscape of AI coding agents from architecture to governance.

Why It Matters in 2026

By 2026, AI coding agents have emerged as a powerful but controversial tool. They can dramatically increase productivity for well-defined tasks: bug fixes, feature additions, test writing, and refactoring. However, they are not yet reliable for complex, multi-step engineering tasks without human oversight. The key insight is that coding agents are most effective when they operate with clear boundaries: well-defined tasks, sandboxed execution, comprehensive testing, and mandatory human approval. Enterprises that adopt coding agents with proper governance benefit from productivity gains while managing risks. Those that deploy agents without governance face quality, security, and reliability issues.

Enterprise Relevance: AI coding agents represent the frontier of software development automation. Understanding their capabilities, risks, and governance is essential for engineering leaders.

Learning Outcomes

  • Design AI coding agent architecture
  • Implement repository understanding for agents
  • Design planning and tool calling systems
  • Implement file and terminal operations safely
  • Design git workflows for autonomous agents
  • Implement human approval gates
  • Design sandboxing and permission systems
  • Implement audit trails for agent actions
  • Manage risks of autonomous coding
  • Design comprehensive testing for agent output
  • Compare and evaluate coding agent tools
  • Implement governance for AI coding agents

AI-Assisted Coding vs AI Coding Agents

AI-assisted coding: the developer is in control, AI suggests, developer verifies. AI coding agents: the agent is in control, it plans and executes, human approves at checkpoints. The distinction is the level of autonomy. AI-assisted coding is mature and widespread; AI coding agents are emerging and require governance. Both have their place: AI-assisted for daily development, agents for well-defined, bounded tasks.

AspectAI-Assisted CodingAI Coding Agents
AutonomyNone (developer controls)High (agent controls)
PlanningDeveloper plansAgent plans
ExecutionDeveloper executesAgent executes
VerificationDeveloper verifies each stepAgent verifies, human approves
SpeedFaster than manualPotentially much faster
RiskLow (human in control)Higher (autonomous execution)
Use CaseAll developmentWell-defined, bounded tasks
GovernanceCode reviewSandboxing, permissions, approval

Agent Architecture

AI coding agent architecture includes: repository understanding (read and understand the codebase), planning (decide what steps to take), tool calling (file operations, terminal commands, code execution), code generation (write and modify code), test execution (run tests), git operations (branches, commits, PRs), and human interaction (ask questions, request approval). The agent uses an LLM for reasoning and planning, and tools for execution. Frameworks like OpenHands and Aider provide agent architectures.

Sandboxing and Permissions

Sandboxing isolates agent execution to prevent harm: the agent cannot access the host system, network, or sensitive data beyond what is explicitly permitted. Permissions limit what the agent can do: read files, write files, execute commands, create PRs. Implementation: Docker containers for isolation, permission policies for tool access, and human approval for high-impact actions. Never give an agent more permissions than necessary.

Human Approval and Audit Trails

Human approval gates require sign-off at critical points: before creating PRs, before deploying, before making destructive changes. Audit trails log all agent actions: what files were read, what changes were made, what commands were executed, what decisions were taken. This provides accountability and enables debugging when things go wrong. Audit trails are essential for compliance and governance.

Architecture & Design

AI coding agent architecture consists of the agent core, tool layer, repository interface, sandbox, approval system, and audit logging. The architecture enables autonomous coding with human oversight.

Architecture Layers
1
Agent Core
LLM-based reasoning, planning, and decision-making.
2
Repository Interface
Read and understand codebase, navigate files.
3
Tool Layer
File operations, terminal commands, code execution, git.
4
Sandbox
Isolated execution environment (Docker, gVisor).
5
Approval System
Human approval gates at critical points.
6
Audit Logging
Log all agent actions for accountability.
7
Testing
Automated testing to verify agent output.
Reference Architectures
Basic Agent
Agent with file operations and code generation. Simplest agent.
Sandboxed Agent
Agent in Docker sandbox with limited permissions.
PR-Creating Agent
Agent that creates branches, commits, and pull requests.
Review-Responsive Agent
Agent that responds to code review feedback.
Enterprise Agent
Full enterprise agent with governance, audit, and approval.

Technology Stack

LayerTechnologiesPurpose
Agent FrameworkOpenHands, Aider, customAgent architecture
AI ModelsClaude 3.5, GPT-4o, Llama 3Agent reasoning
SandboxDocker, gVisor, FirecrackerRuntime isolation
RepositoryGit, GitHub API, local filesCode access
TestingJest, pytest, JUnitTest verification
CI/CDGitHub Actions, GitLab CIAutomated verification
ApprovalCustom, Slack, emailHuman approval
AuditCustom, SIEMAction logging

Engineering Workflow

1
Define Task
Define a clear, bounded task for the agent.
2
Set Up Sandbox
Create sandboxed environment with appropriate permissions.
3
Agent Plans
Agent understands the codebase and plans the approach.
4
Agent Executes
Agent writes code, runs tests, and creates commits.
5
Agent Tests
Agent runs tests to verify changes.
6
Human Review
Human reviews the changes and provides feedback.
7
Agent Iterates
Agent responds to feedback and makes changes.
8
Human Approves
Human approves the final changes.
9
Deploy
Deploy the approved changes.
10
Audit
Review audit trail for compliance.

Repository Understanding

Repository understanding is the agent's ability to read and understand the codebase: file structure, code patterns, dependencies, and conventions. This is critical because the agent needs to understand the existing code to make changes that fit. Implementation: provide the agent with file access, use embeddings for semantic search, include documentation and READMEs, and let the agent explore the codebase before making changes. The quality of repository understanding determines the quality of agent output.

Multi-Step Coding and Autonomous Debugging

Multi-step coding involves the agent planning and executing multiple steps: understand the task, explore the codebase, write code, run tests, fix issues, and create a PR. Autonomous debugging is the agent's ability to identify and fix bugs: run tests, read error messages, understand the issue, and fix the code. This requires the agent to iterate: try a fix, test, and try again if the fix does not work. The key challenge is knowing when to ask for human help.

Risks of Uncontrolled Autonomous Coding

Uncontrolled autonomous coding poses significant risks: agents may introduce bugs, security vulnerabilities, break existing functionality, create technical debt, or make changes that do not align with project goals. Mitigation: sandboxing (isolate execution), permissions (limit capabilities), human approval (require sign-off), comprehensive testing (verify output), audit trails (log actions), and clear task boundaries (well-defined tasks only). Never deploy autonomous coding without governance.

AI Coding Agent Tools

ToolTypeAutonomyBest For
DevinCloud SaaSHighFull autonomous tasks
Claude CodeTerminalMedium-HighComplex CLI tasks
Cursor AgentsIDEMediumIDE-integrated tasks
Copilot WorkspaceCloudMediumGitHub-integrated tasks
AiderTerminalMediumGit-paired coding
OpenHandsOpen-sourceHighCustom agent development

Agent Permissions

PermissionRisk LevelApproval Required
Read filesLowNo
Write filesMediumNo (in sandbox)
Execute commandsHighYes for production
Create PRsHighYes
Merge PRsVery HighYes
DeployVery HighYes
Access networkHighYes
Access secretsVery HighNever (sandbox)

Enterprise Use Cases

Banking
Automated bug fixes
AI coding agents for well-defined bug fixes with security review.
Insurance
Test generation
AI agents for generating test cases for insurance applications.
Healthcare
Code modernization
AI agents for modernizing healthcare code with compliance review.
Retail
Feature prototyping
AI agents for rapid feature prototyping with human review.
Manufacturing
IoT code generation
AI agents for generating IoT sensor code with testing.
Telecommunications
Tool development
AI agents for developing network management tools.
Automotive
Safety-critical code review
AI agents for code review of safety-critical vehicle software.
Technology
Developer productivity
AI agents for routine development tasks with governance.
Energy
Monitoring tool development
AI agents for developing grid monitoring tools.
Logistics
Optimization code
AI agents for developing logistics optimization code.
Consulting
Rapid prototyping
AI agents for rapid client solution prototyping.
GCCs
Enterprise agent governance
Enterprise AI coding agents with governance and audit trails.

Case Study: Banking: Automated Bug Fixes

Problem: Bank has many routine bug fixes that consume developer time.
Opportunity: Use AI coding agents for well-defined bug fixes with security review.
Architecture: Sandboxed agent, GitHub PR workflow, mandatory security review.
Components: OpenHands, Docker sandbox, GitHub API, Snyk security scan.
Evaluation: Bug fix accuracy, security vulnerability rate, developer time saved.
Outcome: 60% of routine bugs fixed by agents. Zero security vulnerabilities shipped. 30% developer time saved.
Risks: Security vulnerabilities. Mitigation: mandatory security review and sandboxing.
Lessons: AI coding agents are effective for well-defined tasks with proper governance.

Case Study: Technology: Test Generation Agent

Problem: Test coverage is low and developers do not have time to write tests.
Opportunity: Use AI agent to generate tests for existing code.
Architecture: Agent reads code, generates tests, runs tests, creates PRs.
Components: Aider, Jest, GitHub API, custom test validation.
Evaluation: Test coverage improvement, test quality, PR merge rate.
Outcome: Test coverage improved from 40% to 75%. 85% of agent-generated tests merged.
Risks: Low-quality tests. Mitigation: test quality review and validation.
Lessons: AI agents are excellent for test generation with proper quality review.

Case Study: Enterprise: Governed Agent Platform

Problem: Enterprise needs to deploy AI coding agents with governance.
Opportunity: Build enterprise agent platform with sandboxing, audit, and approval.
Architecture: Docker sandbox, permission system, audit logging, approval workflow.
Components: Custom platform, Docker, GitHub API, audit system, approval UI.
Evaluation: Agent productivity, governance compliance, audit completeness.
Outcome: 40% productivity for routine tasks. 100% audit trail. Zero unauthorized actions.
Risks: Governance overhead. Mitigation: streamlined approval process.
Lessons: Enterprise AI coding agents require comprehensive governance from day one.

Implementation Steps

1
Define Use Cases
Identify well-defined, bounded tasks suitable for agents.
2
Select Tools
Select AI coding agent tools that meet requirements.
3
Set Up Sandbox
Create sandboxed environment with appropriate permissions.
4
Define Permissions
Define what agents can and cannot do.
5
Add Approval Gates
Implement human approval at critical points.
6
Add Audit Logging
Log all agent actions for accountability.
7
Add Testing
Implement comprehensive testing for agent output.
8
Pilot
Pilot with well-defined tasks and close oversight.
9
Evaluate
Evaluate results and adjust governance.
10
Scale
Scale to more use cases with governance.
11
Monitor
Monitor agent performance and governance.
12
Iterate
Iterate based on experience and results.
13
Govern
Maintain governance and compliance.
14
Train
Train developers on working with agents.
15
Evolve
Evolve agent capabilities and governance.

Practical Project

Build a Governed AI Coding Agent

Build an AI coding agent with sandboxing, permissions, human approval, and audit trails.

Requirements
  • Sandboxed execution
  • Repository understanding
  • File and terminal operations
  • Git workflow with PRs
  • Human approval gates
  • Audit logging
  • Comprehensive testing
  • Permission management
Architecture: OpenHands or custom agent, Docker sandbox, GitHub API, custom approval and audit system.
Steps
  1. 1.Set up Docker sandbox
  2. 2.Implement repository access
  3. 3.Add file and terminal tools
  4. 4.Implement git workflow
  5. 5.Add human approval gates
  6. 6.Set up audit logging
  7. 7.Add comprehensive testing
  8. 8.Define permissions
  9. 9.Pilot with simple tasks
  10. 10.Deploy with governance
Testing: Agent accuracy, security, sandbox effectiveness, audit completeness.
Security: Sandboxing, permissions, secrets management, audit trails.
Deployment: Docker with monitoring and alerting.
Outcome: A governed AI coding agent for safe autonomous development.

Enterprise & GCC Applications

  • GCCs use AI coding agents for routine development tasks with governance.
  • Shared Services organizations standardize agent platforms with permissions.
  • Enterprise Engineering teams build agent infrastructure with sandboxing.
  • Product Engineering teams use agents for test generation and bug fixes.
  • Digital Transformation initiatives use agents for legacy modernization.
  • AI Centers of Excellence define agent governance standards.
  • IT Operations teams use agents for automation and tooling.
  • Application Modernization programs use agents for code migration.

Risks & Mitigations

Bugs and regressions:Comprehensive testing and human review.
Security vulnerabilities:Security scanning and sandboxing.
Breaking existing functionality:Comprehensive test suite and staged deployment.
Excessive permissions:Least privilege and permission management.
Uncontrolled deployment:Human approval gates for all deployments.
Lack of audit trail:Comprehensive audit logging for all actions.
Compliance violations:Governance, audit trails, and compliance checks.
Agent hallucination:Testing, verification, and human review.

Key Metrics

Task Success Rate
Percentage of tasks completed successfully.
Code Quality
Quality score for agent-generated code.
Security Vulnerability Rate
Vulnerabilities per 1000 lines of agent code.
Test Pass Rate
Percentage of tests passing for agent code.
PR Merge Rate
Percentage of agent PRs that are merged.
Human Intervention Rate
How often humans need to intervene.
Time Saved
Developer time saved by using agents.
Audit Completeness
Percentage of actions with audit trail.

Trends & 2026 Outlook

AI coding agents emerging

Emerging

Sandboxed agent execution

Emerging

Human approval as standard

Emerging

Agent governance frameworks

Emerging

PR-creating agents

Emerging

Review-responsive agents

Emerging

Multi-agent coding systems

Experimental

Autonomous debugging

Emerging

Agent-native development

Experimental

Self-improving agents

Experimental

Career Roles

AI Agent Engineer
AI Platform Engineer
AI Engineer
Software Engineer
DevOps Engineer
AI Tools Engineer
Agent Governance Engineer
AI Engineering Manager
Developer Productivity Engineer
AI Automation Specialist

Frequently Asked Questions

What are AI coding agents?

AI coding agents are autonomous AI systems that plan, write, test, and deploy code with minimal human oversight. They understand repositories, plan changes, write code, run tests, create PRs, and respond to review feedback. Tools include Devin, Claude Code, and OpenHands.

How are AI coding agents different from AI-assisted coding?

AI-assisted coding keeps the developer in control: AI suggests, developer verifies. AI coding agents work autonomously: the agent plans and executes, human approves at checkpoints. Agents have higher autonomy and require governance.

What is sandboxing for AI agents?

Sandboxing isolates agent execution to prevent harm. The agent runs in a Docker container or similar isolation and cannot access the host system, network, or sensitive data beyond what is explicitly permitted. This prevents agents from causing unintended damage.

What permissions should AI coding agents have?

Follow least privilege: read files (low risk), write files in sandbox (medium), execute commands (high, require approval for production), create PRs (high, require approval), merge PRs (very high, require approval), deploy (very high, require approval). Never give agents access to secrets.

What is human approval for AI agents?

Human approval gates require sign-off at critical points: before creating PRs, before deploying, before destructive changes. The agent pauses, notifies the human, and waits for approval or rejection. This provides oversight for autonomous actions.

What are audit trails for AI agents?

Audit trails log all agent actions: files read, changes made, commands executed, decisions taken. This provides accountability, enables debugging, and supports compliance. Audit trails are essential for enterprise AI agents.

What are the risks of uncontrolled autonomous coding?

Risks include: bugs, security vulnerabilities, broken functionality, technical debt, and changes that do not align with project goals. Mitigation: sandboxing, permissions, human approval, comprehensive testing, and audit trails.

What is repository understanding?

Repository understanding is the agent's ability to read and understand the codebase: file structure, patterns, dependencies, conventions. This is critical because the agent needs to understand existing code to make changes that fit. Quality of understanding determines quality of output.

What tools are available for AI coding agents?

Devin (cloud SaaS), Claude Code (terminal), Cursor Agents (IDE), GitHub Copilot Workspace (cloud), Aider (terminal, git-paired), OpenHands (open-source). Each has different autonomy levels and use cases.

Can AI agents create pull requests?

Yes, AI agents can create branches, write code, run tests, commit changes, and create pull requests. The PR is then reviewed by humans who can approve, request changes, or reject. This is a common workflow for AI coding agents.

Can AI agents respond to code review feedback?

Yes, agents can read review comments, understand the feedback, make changes, and update the PR. This creates an iterative loop where the agent and human reviewer collaborate until the code is ready for merge.

What is autonomous debugging?

Autonomous debugging is the agent's ability to identify and fix bugs: run tests, read errors, understand the issue, fix the code, and verify the fix. The agent iterates until the bug is fixed or it asks for human help.

How do I implement governance for AI agents?

Implement: sandboxing for isolation, permissions for capability limits, human approval for critical actions, audit trails for accountability, comprehensive testing for quality, and clear task boundaries for scope. Governance is essential for enterprise agents.

What tasks are suitable for AI coding agents?

Well-defined, bounded tasks: bug fixes, test generation, refactoring, feature additions with clear specs, documentation generation, and code modernization. Complex, ambiguous, or high-stakes tasks require human oversight.

How do I measure AI agent effectiveness?

Measure: task success rate, code quality, security vulnerability rate, test pass rate, PR merge rate, human intervention rate, time saved, and audit completeness. Compare with manual development for ROI.

What is the difference between Devin and OpenHands?

Devin is a cloud SaaS autonomous coding agent. OpenHands is an open-source agent framework. Devin is more polished and integrated; OpenHands is more customizable and self-hosted. Choose based on your needs.

Can AI agents work with existing CI/CD?

Yes, agents can integrate with CI/CD: create PRs that trigger CI, read CI results, fix failing tests, and update PRs. This creates an automated loop where the agent iterates until CI passes.

How do I handle secrets with AI agents?

Never give agents access to secrets. Use secret management systems that inject secrets at runtime, not in the code. Agents should not see API keys, passwords, or tokens. Use environment variables and secret managers.

What is agent identity?

Agent identity is how the agent is identified in the system: a unique agent ID, associated permissions, and audit trail. Agent identity is important for accountability, access control, and audit. Agents should not impersonate human users.

How do I get started with AI coding agents?

Start with well-defined tasks (bug fixes, test generation). Use a sandboxed environment. Implement human approval for all changes. Add audit logging. Start with close oversight and gradually expand as you build trust. Never deploy without governance.

What are common AI agent mistakes?

Common mistakes: giving agents too many permissions, no sandboxing, no human approval, no audit trail, using agents for complex tasks without oversight, and not testing agent output. Invest in governance from the start.

Can AI agents handle multi-step tasks?

Yes, agents can plan and execute multi-step tasks: understand the task, explore the codebase, write code, run tests, fix issues, and create a PR. However, complex multi-step tasks have higher failure rates and require more human oversight.

What is the future of AI coding agents?

The future includes: more autonomous agents, sandboxed execution as standard, human approval as standard, agent governance frameworks, PR-creating agents, review-responsive agents, multi-agent coding systems, autonomous debugging, agent-native development, and self-improving agents.

How do I balance autonomy and control?

Give agents autonomy for well-defined tasks with clear boundaries. Require human approval for high-impact actions. Use sandboxing and permissions to limit risk. Start with low autonomy and gradually increase as you build trust. Always maintain audit trails.

What is the role of the developer with AI agents?

The developer specifies tasks, reviews agent output, approves changes, provides feedback, and takes responsibility for the final product. The developer shifts from coding to specification, review, and governance. The developer is still essential; the role evolves.

References & Resources

  • Devin Documentation:Autonomous AI coding agent.
  • OpenHands Documentation:Open-source AI coding agent framework.
  • Aider Documentation:Terminal-based AI coding assistant.
  • Claude Code Documentation:Terminal-based AI coding agent.
  • Cursor Agents Documentation:IDE-integrated AI agents.
  • GitHub Copilot Workspace:GitHub-integrated AI workspace.
  • Docker Documentation:Container sandboxing for agents.
  • OWASP AI Security:AI security guidance for agents.