How to Keep Code Quality When AI Agents Write Code | Pensero[Skip to content](#main)

[Pensero](/)

for

[Consulting firms](/)[Enterprise](/enterprise)

- Platform

  Measure

  - [Next movesWhat to improve next](/platform/next-moves)
  - [Agentic ROICost per delivery point](/platform/agentic-roi)
  - [AI DeploymentAdoption, output and quality of AI](/platform/ai-intelligence)
  - [Delivery IntelligenceDelivery points by team](/platform/delivery-intelligence)

  Govern

  - [Agent Traffic ControlAgent usage and model routing](/platform/agent-traffic-control)
  - [BenchmarkingCompare teams and agents](/platform/talent-benchmarking)
  - [Code QualityDefects and rework by source](/platform/code-quality)
  - [CapEx & FinanceCapitalization and spend allocation](/platform/capex-analysis)

  [Pensero MCPNewYour next moves in any assistant](/platform/mcp)
- Use cases

  By role

  - [CEOs](/use-cases/roles-ceo)
  - [CTOs](/use-cases/roles-cto)
  - [CFOs](/use-cases/roles-cfo)
  - [Product leaders](/use-cases/roles-product-leaders)
  - [Engineering managers](/use-cases/roles-engineering-managers)
  - [Procurement](/use-cases/roles-procurement)
  - [Service providers](/use-cases/service-providers)
  - [Investors](/use-cases/roles-investors)

  Compare Pensero

  - [DX](/use-cases/competitors-dx)
  - [Swarmia](/use-cases/competitors-swarmia)
  - [Haystack](/use-cases/competitors-haystack)
  - [Span](/use-cases/competitors-span)
  - [Jellyfish](/use-cases/competitors-jellyfish)
  - [Waydev](/use-cases/competitors-waydev)
  - [LinearB](/use-cases/competitors-linearb)
  - [Faros AI](/use-cases/competitors-farosai)
  - [Larridin](/use-cases/competitors-larridin)
  - [Weave](/use-cases/competitors-weave)
  - [Exceeds AI](/use-cases/competitors-exceeds-ai)
- [How it works](/consulting/how-it-works)
- [How it works](/how-it-works)
- [Customers](/customers)
- [Pricing](/enterprise#pricing)
- ResourcesMore

  Use cases

  By role

  - [CEOs](/use-cases/roles-ceo)
  - [CTOs](/use-cases/roles-cto)
  - [CFOs](/use-cases/roles-cfo)
  - [Product leaders](/use-cases/roles-product-leaders)
  - [Engineering managers](/use-cases/roles-engineering-managers)
  - [Procurement](/use-cases/roles-procurement)
  - [Service providers](/use-cases/service-providers)
  - [Investors](/use-cases/roles-investors)

  Compare Pensero

  - [DX](/use-cases/competitors-dx)
  - [Swarmia](/use-cases/competitors-swarmia)
  - [Haystack](/use-cases/competitors-haystack)
  - [Span](/use-cases/competitors-span)
  - [Jellyfish](/use-cases/competitors-jellyfish)
  - [Waydev](/use-cases/competitors-waydev)
  - [LinearB](/use-cases/competitors-linearb)
  - [Faros AI](/use-cases/competitors-farosai)
  - [Larridin](/use-cases/competitors-larridin)
  - [Weave](/use-cases/competitors-weave)
  - [Exceeds AI](/use-cases/competitors-exceeds-ai)

  - [Customers](/customers)
  - [How it works](/consulting/how-it-works)
  - [How it works](/how-it-works)
  - [AboutThe team, and how we run on Pensero](/about)
  - [BlogNews, tips, and dev culture](/blog)
  - [Help CenterGuides for setup, integrations and security](https://help.pensero.ai)

[Log in](/auth/login/)[Become a partner](https://calendar.app.google/8eCdC2RrquyQpncq7)[Book a scoping session](https://calendar.app.google/ZBxweeMGhrMVQkJn9)

[Log in](/auth/login/)[Become a partner](https://calendar.app.google/8eCdC2RrquyQpncq7)[Book a scoping session](https://calendar.app.google/ZBxweeMGhrMVQkJn9)

[Blog](/blog) / Other resources

# How to keep code quality as AI agents write more of the code

AI agents write more of the code. Learn how to keep code quality: measure rework and reverts next to delivered work, by engineer, assistant and agent.

![](/assets/WF5wXySb5oYBsfMDPbU0hRuXY3M.LvpWanuL_ZHEg5Y.webp)

![](/assets/GjPJ8lgQ2s9KH4YirhymwwZxVY.WQPn6KWn_ZcotNb.webp)Pensero·Pensero Marketing·Nov 17, 2026

Short answer

To keep code quality as AI agents write more of the code, measure quality next to output, for each source of work: engineers, AI-assisted engineers and agents. Watch rework, reverted changes and defects, and keep human review on the work where agents produce rework. Pensero measures the delivered work and the quality of engineers, AI-assisted engineers and AI agents on one scale, the Delivery Point, so you see where AI adds value and where it adds rework.

## Why quality can drop when agents write more code

- **More code, same reviewers.** Agents open more pull requests than people can review with care.
- **Code that passes but does not hold.** Tests pass, and the change comes back as rework weeks later.
- **Output looks better than it is.** If you count only pull requests, rework looks like extra output.

## 4 quality signals to track

| Signal | What it shows | How to measure it |
| --- | --- | --- |
| Rework | Work that did not hold | Share of delivered work fixed again within 30 days |
| Reverted changes | Work that failed | Share of merged pull requests that were reverted |
| Defects after release | Work that reached users with a problem | Bugs linked to the change that caused them |
| Review depth | If people still check the work | Review comments and changes requested per pull request |

Read each signal by source: engineer, AI-assisted engineer and agent.

## How to keep quality in 4 steps

1. **Measure output and quality together.** Never report delivered work without rework next to it.
2. **Compare by source of work.** If agents produce more rework for one type of work, keep people on it.
3. **Keep human review where it matters.** Review all agent changes to security, payments and data. Use AI review for the rest.
4. **Check the trend every month.** Quality must hold as the share of agent work goes up.

See [the AI quality tax](/blog/ai-quality-tax) for what rework costs.

## Common mistakes

- **Counting pull requests as output.** Agents make many small changes, and rework looks like progress.
- **Measuring quality once.** Quality changes as agents take more work.
- **Blaming people for agent rework.** Track the source of each change, so you fix the process, not the person.

## How Pensero measures quality for humans and agents

The Delivery Point is one unit of finished work, scored by size and difficulty, the same way for engineers, AI-assisted engineers and agents. Pensero reads rework and reverts next to it, and traces each change to the pull request and ticket behind it.

- See [Pensero for the agentic SDLC](/enterprise) and the [5 levels of AI](/blog/agentic-sdlc).
- [Book a scoping session](/) to see where AI adds value and where it adds rework.

## Sources

- [NIST Secure Software Development Framework](https://csrc.nist.gov/projects/ssdf)
- [DORA research program](https://dora.dev/)
- [The AI quality tax](/blog/ai-quality-tax)

## Frequently asked questions

Does AI-generated code have lower quality?

It depends on the type of work. Measure rework and reverts by source, and you see where agents hold quality and where they do not.

Which metrics show code quality with AI agents?

Rework, reverted changes, defects after release and review depth, read next to delivered work.

Should every agent change get a human review?

Keep human review on high-risk code, such as security, payments and data. Use AI review for low-risk changes, and check the rework.

Which tool measures quality for humans and agents?

Pensero measures the delivered work and the quality of engineers, AI-assisted engineers and AI agents on one scale, the Delivery Point.

## Related posts

- [![](/assets/WF5wXySb5oYBsfMDPbU0hRuXY3M.LvpWanuL_ZHEg5Y.webp)

  ### How to Measure and Improve Product Development Performance

  Connect customer value, delivery, quality, strategic alignment, and investment efficiency in a balanced product development performance review.

  Pensero  
  Pensero Marketing

  Aug 10, 2026](/blog/product-development-performance)
- [![](/assets/WF5wXySb5oYBsfMDPbU0hRuXY3M.LvpWanuL_ZHEg5Y.webp)

  ### AI Engineer vs Software Engineer: Key Differences

  Compare AI and software engineers by responsibilities, skills, quality standards, and risk, with guidance on how they work together and when to hire each.

  Pensero  
  Pensero Marketing

  Aug 10, 2026](/blog/ai-engineer-vs-software-engineer)
- [![](/assets/WF5wXySb5oYBsfMDPbU0hRuXY3M.LvpWanuL_ZHEg5Y.webp)

  ### 16 KPIs for Software Engineering Teams

  Explore 16 team-level KPIs covering delivery, quality, developer satisfaction, and AI efficiency, with guidance on reading metrics together.

  Pensero  
  Pensero Marketing

  Aug 10, 2026](/blog/kpis-software-engineers)

Next step

## Find your level of AI in engineering

See the 5 levels, from human-only to fully autonomous agents, and what moving up is worth.

[See the 5 levels →](/how-it-works#levels)

Next step

## Scope your audit in 30 minutes

We look at your tools, AI agents and vendors and tell you what we would measure first.

[Book a scoping session](https://calendar.app.google/ZBxweeMGhrMVQkJn9)[Start free](/auth/signup/)

- [For consulting firms](/)
- [For enterprise](/enterprise)

© 2026

Product shots use illustrative data.

Platform

- [Next moves](/platform/next-moves)
- [Agentic ROI](/platform/agentic-roi)
- [AI Deployment](/platform/ai-intelligence)
- [Delivery Intelligence](/platform/delivery-intelligence)
- [Benchmarking](/platform/talent-benchmarking)
- [Code Quality](/platform/code-quality)
- [Agent Traffic Control](/platform/agent-traffic-control)New
- [CapEx & Finance](/platform/capex-analysis)
- [Pensero MCP](/platform/mcp)New
- [Integrations](/integrations)

Use cases

- [CEOs](/use-cases/roles-ceo)
- [CTOs](/use-cases/roles-cto)
- [CFOs](/use-cases/roles-cfo)
- [Product leaders](/use-cases/roles-product-leaders)
- [Engineering managers](/use-cases/roles-engineering-managers)
- [Procurement](/use-cases/roles-procurement)
- [Service providers](/use-cases/service-providers)
- [Investors](/use-cases/roles-investors)
- [Compare Pensero](/use-cases/competitors-dx)

Company

- [About](/about)
- [Customers](/customers)
- [How it works](/consulting/how-it-works)
- [How it works](/how-it-works)
- [Pricing](/enterprise#pricing)
- [Careers](/careers)
- [Blog](/blog)
- [LinkedIn](https://www.linkedin.com/company/penseroai/)
- [Support](/support)
- [Help Center](https://help.pensero.ai)
- [Other resources](/blog/other-resources)
- [Glossary](/glossary)

Offices

- [Barcelona](https://maps.app.goo.gl/6pfxKiKFNKzLPPnB6)
- [Madrid](https://maps.app.goo.gl/jEpYBUR4E6AqZs4R6)
- [New York](https://maps.app.goo.gl/szk58Jf2MBq14MgAA)
- San FranciscoSoon

Legal

- [Privacy policy](/privacy-policy)
- [Cookie policy](/cookie-policy)
- [Terms of service](/terms)
- [DPA](/dpa)
- [Security](https://pensero.trust.site)