Guide. Verify. Solve

Agent Centric Development Cycle AC/DC

AC/DC runs across three loops. The Agentic Loop sits inside each agentic reasoning step, the CI Verification Loop runs at sandbox exit, and the Code Maintenance Loop remediates tech debt in the background.

Agentic Loop
CI Verification Loop
Code Maintenance Loop
The AC/DC framework

A cycle built for how agents actually work

AC/DC runs at two levels. An inner loop sits inside each agentic reasoning step, and an outer loop at sandbox exit. Sonar covers all three stages, for every AI coding tool.

01

Inner loop

Per reasoning step · agent sandbox
1
Guide Define context and constraints
2
Verify Review and validate code
3
Solve Fix issues
PR submitted
02

Outer loop

At sandbox exit · CI pipeline
1
Guide Define code standards and quality gate conditions
2
Verify Full zero-trust, multilayered verification
3
Solve Automated remediation
The three stages

Guide. Verify. Solve.

STAGE 01

Guide your agents with your standards and architecture context

Agents need the right and relevant context. Not too much, not too little. The Guide stage provides agents with guardrails and the most relevant context, standards, and architectural constraints so their output fits your organization's requirements.

Without the right context, agents produce code that is functionally correct but contextually wrong, violating your coding standards, style, or security posture. Sonar Vortex provides dynamic, task-relevant context at the start of every agentic session. Too little context means code that ignores your standards. Too much degrades model performance. The right context, dynamically selected, is the key.

STAGE 02

Zero-trust, multi-layered verification.

Agents generate thousands of lines before stopping. At every checkpoint, inside the agent's inner loop and at sandbox exit, two complementary layers run together: SonarQube's deterministic mathematical analysis and Gitar's AI-native code review. Neither alone is sufficient. Together they cover the full surface.

Zero trust

Separate, deterministic, and fully auditable — every finding explained with its exact rule, location, and data flow.

Multi-layered

SonarQube reasons across syntax, control and data flow, taint analysis, SCA, and architecture; Gitar adds AI-native review for the logic and behavioral bugs static analysis can't reach.

Industry leading false positive rate: 3.2%. Teams verify real issues, not noise.

STAGE 03

Close the loop with automated remediation.

When verification fails, Sonar doesn't just report issues. It resolves them. The SonarQube Remediation Agent generates verified fixes, validates them against the same quality gate that failed, and opens a ready-to-merge pull request. No manual review cycle required.

The same workflow applies to existing backlogs. Teams with hundreds of accumulated security and quality findings can deploy the Remediation Agent to clear them systematically, turning a growing backlog into a continuously improving posture.

How-to guides

Get AC/DC running with your agents

Step-by-step guides for wiring AC/DC into your actual agent setup, organized by what you’re trying to accomplish, not by product.

Set up context
Claude Code

Inject architecture context into Claude Code

Wire Sonar's context injection into Claude Code sessions. Your architecture, coding standards, and quality rules - available as MCP tool calls before the agent writes anything.

Set up context
Codex CLI

Inject architecture context into Codex CLI

Inject architecture, coding standards, and quality rules into Codex CLI before it generates a line of code — via MCP context injection.

~20 min setup
Read guide
Set up context
GitHub Copilot

Inject architecture context into GitHub Copilot

Wire Sonar’s context injection into GitHub Copilot sessions in VS Code. Your architecture, coding standards, and quality rules available before Copilot generates a line.

Verify quality
Claude Code

Verify code quality in your Claude Code agent loop

Put inner-loop verification to work. Run Sonar's analysis engine inside the agent’s reasoning cycle - every file, every step - not just at PR time.

Verify quality
Codex CLI

Verify code quality in your Codex CLI agent loop

Run inner-loop verification in your Codex CLI workflow. Catching issues at the point of generation - not after the PR lands.

Verify quality
GitHub Copilot

Verify code quality in your GitHub Copilot agent loop

Run inner-loop verification in GitHub Copilot in VS Code. Sonar’s analysis engine catches issues at the point of generation, before they compound.

~20 min setup
Read guide
Fix issues
PR workflow

Auto-fix PR issues when the quality gate fails

Wire automated remediation into your PR workflow. When the quality gate fails, verified fixes are generated, validated, and opened as a ready-to-merge PR - automatically.

~15 min setup
Read guide
Fix issues
Issue backlog

Clear your security and quality backlog automatically

Put your existing issue backlog to work. Target accumulated findings - generating verified fixes and opening ready-to-merge PRs without manual review cycles.

~20 min setup
Read guide
Full workflow
TerminalCodex CLI

Run the full AC/DC loop in the terminal

The complete Guide → Verify → Solve cycle without leaving the terminal. Agent generates; Sonar verifies; the loop repeats until the quality gate passes.

~25 min setup
Read guide
Full workflow
Claude CodeMCP

Connect Sonar to Claude Code via MCP

Make every Sonar capability available inside Claude Code as a native tool — architecture queries, quality gate checks, findings lookup, and more.

~10 min setup
Read guide
Full workflow
Claude Code

Install Sonar in Claude Code

Connect SonarQube to Claude Code so Sonar findings, quality gate status, and architecture context are available as native tools in every agent session.

Full workflow
GeminiMCP

Connect Sonar to Gemini Code Assist via MCP

Make every Sonar capability available inside Gemini Code Assist Agent Mode as native MCP tool calls. Architecture queries, quality gate checks, and findings lookups.

~15 min setup
Read guide
More guides coming Devin · GitLab Duo · Azure DevOps auto-analysis.
More dev guides
Templates

AC/DC for your agent, right now

Seamlessly integrate SonarQube with your preferred agent via dedicated SonarQube plugins. Guide your agents and Verify their output with Sonar Vortex in the agentic loop.

Open a Claude Code session

Prerequisite: Vortex requires a prior CI analysis of the project. It restores the latest stored analysis context for the selected branch, so analyze the project in CI before relying on Vortex.
1

Install the SonarQube plugin from Anthropic's marketplace

/plugin install sonarqube@claude-plugins-official
2

Integrate SonarQube with Claude Code with the plugin's integrate skill

/sonarqube:sonar-integrate

The integrate command installs or updates the SonarQube CLI, prompts for authentication to SonarQube, starts the SonarQube MCP Server, and configures Vortex when available (and secrets detection too).

3

Guide your agent and Verify its output

Start a fresh Claude Code session to unlock Vortex.

Open a Codex CLI session

Prerequisite: Vortex requires a prior CI analysis of the project. It restores the latest stored analysis context for the selected branch, so analyze the project in CI before relying on Vortex.
1

Add SonarSource/sonarqube-agent-plugins as a plugin marketplace

codex plugin marketplace add SonarSource/sonarqube-agent-plugins
2

Install the SonarQube plugin from that catalog

codex plugin add sonarqube@sonar
3

Integrate SonarQube with Codex CLI with the plugin's integrate skill

sonar integrate codex

The integrate command installs or updates the SonarQube CLI, prompts for authentication to SonarQube, starts the SonarQube MCP Server, and configures Vortex when available (and secrets detection too).

4

Guide your agent and Verify its output

Start a fresh Codex CLI session to unlock Vortex.

Open a GitHub Copilot CLI session

Prerequisite: Vortex requires a prior CI analysis of the project. It restores the latest stored analysis context for the selected branch, so analyze the project in CI before relying on Vortex.
1

Install the SonarQube plugin from the pre-packaged awesome-copilot catalog

/plugin install sonarqube@awesome-copilot
2

Integrate SonarQube with GitHub Copilot CLI with the plugin's integrate skill

/sonarqube:sonar-integrate

The integrate command installs or updates the SonarQube CLI, prompts for authentication to SonarQube, starts the SonarQube MCP Server, and configures Vortex when available (and secrets detection too).

3

Guide your agent and Verify its output

Start a fresh GitHub Copilot CLI session to unlock Vortex.

Open an Antigravity session

Prerequisite: Vortex requires a prior CI analysis of the project. It restores the latest stored analysis context for the selected branch, so analyze the project in CI before relying on Vortex.
1

Install the SonarQube plugin bundle

agy plugin install https://github.com/SonarSource/sonarqube-agent-plugins
2

Integrate SonarQube with Antigravity with the plugin's integrate skill

/sonarqube:sonar-integrate

The integrate command installs or updates the SonarQube CLI, prompts for authentication to SonarQube, starts the SonarQube MCP Server, and configures Vortex when available (and secrets detection too).

3

Guide your agent and Verify its output

Start a fresh Antigravity session to unlock Vortex.

Open a Cursor session

Prerequisite: Vortex requires a prior CI analysis of the project. It restores the latest stored analysis context for the selected branch, so analyze the project in CI before relying on Vortex.
1

Install the SonarQube plugin through Cursor's marketplace

/add-plugin sonarqube
2

Integrate SonarQube with Cursor with the plugin's integrate skill

/sonarqube:sonar-integrate

The integrate command installs or updates the SonarQube CLI, prompts for authentication to SonarQube, starts the SonarQube MCP Server, and configures Vortex when available (and secrets detection too).

3

Guide your agent and Verify its output

Start a fresh Cursor session to unlock Vortex.

No plugin for your agent?

Use this when your agent has no dedicated SonarQube plugin and reaches SonarQube through the SonarQube MCP Server. If a plugin exists for your agent, install that instead — it wires the same capabilities through the SonarQube CLI and needs no directive file.

Set this up before the directives file does anything:

  • The local (stdio) MCP server, not the SonarQube-hosted one. Vortex analyzes files on disk, and the hosted server has no filesystem access.
  • Your workspace mounted into the container at /app/mcp-workspace.
  • SONARQUBE_TOOLSETS including vortex, the unified toolset covering both Vortex context and Vortex analysis tools. Add issues,quality-gates,rules to get the Solve-stage tools.
  • A prior CI analysis of the project. Vortex restores the latest stored analysis context for the selected branch rather than recomputing it, so the project needs to have been analyzed in CI first.

Drop this file in your repo root as your agent's instructions file.

AGENTS.md

Tool names are written bare. Some agents namespace MCP tools as mcp__<server-name>__<tool> — if yours does, prefix accordingly using your own server name from your MCP config.

Guide

before generating or editing code

Always, before writing anything:

  • get_guidelines — coding standards drawn from this project's own SonarQube issue history, filtered to the task at hand. Requires mode: project_based (default), category_based, or combined. Narrow with categories, languages, file_paths.

To find and read existing code, use these instead of grep and find. They resolve symbols through abstract syntax trees and control flow rather than text matching:

  • search_by_signature_patterns — find declarations by regex on signatures
  • search_by_body_patterns — find usages by regex inside method bodies
  • get_source_code — read a symbol's source by fully qualified name

When changing architecture or touching shared code:

  • get_current_architecture — the actual module dependency graph. depth is required; start at 0 for a top-level view, then drill in with path_prefix.
  • get_intended_architecture — the constraints you've defined, so the agent stays inside them
  • get_upstream_call_flow / get_downstream_call_flow — trace callers and callees by fqn
  • get_references — every file referencing a type
  • get_type_hierarchy — implementors and subtypes

Before adding or updating any dependency:

  • check_dependency — pass purl (e.g. pkg:npm/lodash@4.17.21). Refuse the dependency outright if it comes back malicious. Block on BLOCKER or HIGH riskSeverity, and propose a version from fixedVersions. Requires SonarQube Advanced Security.

Semantic navigation covers Java, C#, JavaScript, TypeScript, Python, and Rust. Guidelines cover every SonarQube Cloud language.

Verify

after every file you write or edit

Call run_advanced_code_analysis on each new or modified file:

  • projectKey — falls back to SONARQUBE_PROJECT_KEY if configured
  • branchrequired. The branch used to retrieve the latest stored analysis context.
  • filePathrequired. Project-relative, e.g. src/main/java/MyClass.java
  • fileScope"MAIN" or "TEST". A plain string, not an array. Defaults to "MAIN".

This uses the latest stored analysis context for the branch rather than recomputing it, which is why it returns CI-depth results in seconds.

Do not report a file as done until its analysis comes back clean.

Solve

when analysis returns findings
  1. show_rule with the rule key (e.g. python:S7608) to get the rationale, the noncompliant example, and the recommended fix. Fix from the rule's guidance, not from a guess about what it wants.
  2. Fix every finding on lines you touched this turn. Leave pre-existing findings on untouched lines alone unless you were asked to address them.
  3. Re-run run_advanced_code_analysis on the same files to confirm the fix landed and introduced nothing new. Repeat until clean.
  4. Surface findings to the user verbatim. Do not summarize them away or silently drop them.

Optional, for wider context:

  • search_sonar_issues_in_projects — the existing issue backlog, to see whether a finding is yours or was already there
  • search_dependency_risks — the dependency risks already recorded against the project, as opposed to check_dependency, which vets a package before you add it
  • get_project_quality_gate_status — the project's gate state

There is no MCP tool that invokes the SonarQube Remediation Agent. That agent works the main-branch backlog and open pull requests from SonarQube Cloud and opens its own PRs. It is the Solve stage outside the coding loop; the loop above is the Solve stage inside it.

Key principle

the in-loop gate

A task is not complete until run_advanced_code_analysis returns clean for every file you changed.

That is the in-loop gate, and it is the only one that sees code you have not pushed yet. get_project_quality_gate_status reports the gate from the last CI analysis of the project, so it is blind to uncommitted work and cannot confirm the file in front of you. Check it before declaring a branch ready to merge, never as the exit criterion for an edit.

Full reference on docs.sonarsource.com
All Sonar products for AC/DC

The full stack for agentic development

Sonar covers the full Agent Centric Development Cycle — including context injection, verification, and automated remediation — all as one integrated workflow.

01
Guide Context before the agent writes anything
Explore stage

Sonar Vortex

GA

Delivers project-specific context and constraints before the agent writes. Architecture, coding standards, and quality rules retrieved via semantic navigation and injected through SonarQube CLI or MCP Server.

Product page

SonarSweep

Private beta

Context files embedded in the repo that travel with the codebase. Every agent picks them up automatically.

Product page
02
Verify Zero trust, multi-layered verification of all code
Explore stage

SonarQube

GA

Deterministic-first analysis across 40+ languages. The quality gate for all code, human- or agent-written.

SonarQube Advanced Security

GA

Deep security analysis with taint tracking, secrets detection, SCA, and IaC scanning.

Sonar Vortex

GA

Runs Sonar’s full analysis engine inside the agent’s inner loop. Every output verified before a PR exists — same depth as a full CI scan, in seconds.

SonarQube Architecture

GA

Visualize and manage architecture. Tracks current vs intended structure, exposed to agents via MCP.

Gitar

New

AI code review that lives in your pull requests. Reviews code, diagnoses CI failures, generates fixes, and commits only when the build passes.

SonarQube MCP Server

GA

Exposes SonarQube as native MCP tools for Claude Code, Cursor, and any MCP-compatible agent.

SonarQube for IDE

formerly SonarLintGA

Real-time Sonar analysis in VS Code, IntelliJ, and other IDEs as the agent writes code.

SonarQube CLI

GA

Unified CLI for SonarQube capabilities, designed for agentic and CI/CD workflows.

03
Solve Close the loop with automated remediation
Explore stage

SonarQube Remediation Agent

Beta

Generates verified fix PRs automatically when the quality gate fails.

Product page

AI CodeFix

GA

One-click fix suggestions in the IDE and PR. Fully on-premises in SonarQube Server 2026.2.

Product page
From the Sonar blog
eBook

The Agent Centric Development Cycle

This ebook introduces the Agent Centric Development Cycle (AC/DC), a framework designed to help engineering teams harness agentic AI without compromising code quality, security, or maintainability. It's backed by data from Sonar's 2026 State of Code Developer Survey and independent academic research.

Download eBook
A G2 Leader for 6 years running
4.6 / 5

Ready to build the AC/DC loop into your team’s workflow?