Sonar Vortex context
Sonar Vortex context gives your AI agent architecture awareness, coding guidelines, and dependency health from SonarQube Cloud and SonarQube Server before it writes code.
Overview
Sonar Vortex guides your agent inside the agentic loop of the Agent Centric Development Cycle. It connects to SonarQube and provides deep, project-specific context to AI agents before they write or edit code. Agents can access these capabilities through the SonarQube CLI-installed session-start hooks, or through a locally running SonarQube MCP Server.
This ensures that the resulting code isn't generic and adheres to your repository's unique standards.
Vortex context works with SonarQube Cloud and with SonarQube Server. What your organization needs in place differs between the two, see Setup.
Core capabilities
Architectural awareness: Helps agents navigate complex class hierarchies, trace upstream/downstream call flows, and understand execution paths.
Intelligent guidelines: Automatically injects relevant coding rules, quality standards, and security requirements based on your project's history and the current task.
Semantic navigation: Moves beyond simple text matching to retrieve code based on its actual meaning and structure using Abstract Syntax Trees (AST), semantics, and control flow information.
Third-party dependency guidance: Helps agents assess the health and safety of third-party dependencies before they're introduced or updated.
Tool categories
Sonar Vortex provides four Vortex context capability categories. For supported agents, the recommended setups are the SonarQube agent plugin and the SonarQube CLI, which install session-start hooks that use the local Vortex context tool. Antigravity has no session-start event; therefore, the plugin and the SonarQube CLI do not install Vortex context for it. You can use Vortex context with Antigravity, or with any other agent, by configuring a locally running SonarQube MCP Server that exposes the same capabilities as MCP tools. Each category supports a specific set of languages, and we're actively expanding language coverage and adding more categories.
The language coverage in the following table is given for SonarQube Cloud.
Coding Guidelines
Recommends Sonar rules to follow, based on the project's historical SonarQube issues filtered by what the agent is about to do (prompt nature and categories).
Third-party dependency health and safety
Assesses whether a third-party dependency is healthy and safe to use before it is introduced or updated. Currently covers known security vulnerabilities, supply-chain malware, and license compliance, with more checks in progress. Available only with the SCA feature.
Architecture
Exposes the current architecture graph and user-defined architectural constraints, so the agent understands the current architecture and stays aligned with the intended design.
Semantic navigation
Helps the agent understand the meaning of the code rather than relying on text-based grep, by exposing call stacks, class hierarchies, references, and exact source locations. This lets the agent navigate the codebase and modify the right places effectively.
Java, C#, JavaScript, TypeScript, Python, and Rust
The full list of tools exposed by Sonar Vortex for Vortex context, with their input parameters, is defined on the SonarQube MCP Server Tools page.
Vortex context for coding guidelines
The Sonar Vortex tool for guidelines injects relevant Sonar rules into the LLM context:
Based on your prompt: for example, if your prompt involves access to DB, include all guidelines about DB.
Based on the SonarQube issues found in files modified or related to the LLM task: for example, if the LLM plans to modify
DBStorage.java, include guidelines from past issues inDBStorage.java.

Vortex context for architecture
The Sonar Vortex tools for architecture give the LLM understanding of both the current architecture and the user-defined intended constraints, powered by semantic data from SonarQube's Architecture feature. See Architecture in the SonarQube Cloud documentation, or Architecture in the SonarQube Server documentation. These tools enable the LLM to:
Build "the right thing", better aligning with user goals, avoiding mistakes and rework.
Build "the thing right", provide an output that is in line with architecture expectations.

Vortex context for semantic navigation
The Sonar Vortex tools for semantic navigation give the agent an understanding of the code's meaning, helping it find the right locations to modify based on meaning rather than text. With this context, the agent can:
Reach the correct solution faster by jumping straight to the right symbols, references, types, call flows, class hierarchies, etc.
Reduce token usage and cost, by avoiding blind reads of entire files.
Produce safer, less buggy changes, by surfacing every relevant location that needs updating so nothing is missed.

Setup
Installing Vortex in your agent is the same whichever product you connect to. See Installing Vortex.
What your organization needs in place first differs:
SonarQube Cloud: see Sonar Vortex in the SonarQube Cloud documentation.
SonarQube Server: see Sonar Vortex in the SonarQube Server documentation.
Related pages
Last updated
Was this helpful?

