# What we learned using AI agents to refactor a monolith

DevFeed: [What we learned using AI agents to refactor a monolith](<https://devfeed.tech/articles/what-we-learned-using-ai-agents-to-refactor-a-monolith-1971.md>)

Original publisher: [Read original article](<https://1password.com/blog/what-we-learned-using-ai-agents-to-refactor-a-monolith>)

Author: info@1password.com (Nancy Wang; Wayne Duso; K.J. Valencik)

Published: 2026-04-20T00:00:00Z

Content type: article

Language: en

Sources: [Blog on 1Password Blog](<https://devfeed.tech/sources/blog-on-1password-blog.md>)

Topics: [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [Code](<https://devfeed.tech/topics/code.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [systems](<https://devfeed.tech/topics/systems.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>), [Security](<https://devfeed.tech/topics/security.md>), [Unified Access](<https://devfeed.tech/topics/unified-access.md>), [Parser](<https://devfeed.tech/topics/parser.md>)

Tags: [agentic](<https://devfeed.tech/tags/agentic.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [code](<https://devfeed.tech/tags/code.md>), [developers](<https://devfeed.tech/tags/developers.md>), [go](<https://devfeed.tech/tags/go.md>), [performance](<https://devfeed.tech/tags/performance.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [security](<https://devfeed.tech/tags/security.md>), [sql](<https://devfeed.tech/tags/sql.md>), [toolchain](<https://devfeed.tech/tags/toolchain.md>), [tooling](<https://devfeed.tech/tags/tooling.md>), [unified-access](<https://devfeed.tech/tags/unified-access.md>)

## AI overview

1Password describes using AI agents and an agentic toolchain to analyze, plan, and execute refactoring of its multi-million-line Go monolith. The article focuses on dependency mapping, system decomposition, extraction sequencing, and lessons from applying the approach to live production systems while preserving reliability, performance, privacy, and security.

## Source excerpt

AI agents are increasingly used to refactor large codebases, but many teams lack a clear understanding of where they succeed and where they fail. At 1Password, we applied agentic tooling to a multi-million-line Go monolith, and in this blog we'll share what worked, what broke, and what it means for teams adopting AI in production systems. Here's the situation: 1Password runs a large Go monolith called B5. It has been the foundation of our product for years and continues to perform well in production, both in terms of reliability and scale. Now, Unified Access is designed to support both human and agent-driven workflows at high request rates and low latency. As we continue adding and enhancing its capabilities, we need clearer service boundaries and more independent scaling characteristics. Over time, that means evolving parts of the system in a way that preserves the privacy, performance, reliability, and security properties we have already established. Coming up with an actionable plan for tackling this problem sounded like a good job for agents. In our case, this meant applying agentic refactoring: using AI agents to analyze, plan, and execute changes across a codebase, from dependency mapping to system decomposition. There's a version of this story where agentic tooling analyzes a large codebase, produces a clean extraction plan, and service decomposition follows a predictable path from there. Parts of that story did play out as expected. We built an agentic toolchain that analyzed millions of lines of code and gave us a clear, defensible extraction order, and that work has meaningfully improved how we think about decomposing the system. What ended up being more valuable, though, was what we learned once we applied those tools to real changes in a live production environment. That is the part that tends to get glossed over, and it is the part that actually determines whether this approach works. Building the analysis layer The first question we had to answer was