Your AI Agent Starts Every Session Like a New Hire - Killian Carlsen-Phelan, Sonar

17:452 min readAI Engineer10/30/2026Computing/Software

Key Takeaway

Integrating deterministic verification tools like Sonar Vortex into AI coding agents prevents security issues, reduces token consumption by 36%, and eliminates production outages by 44%.

Highlights

  • Sonar surveyed over 1,100 developers and found that 96% of them do not fully trust AI-generated code.

  • Less than half, specifically 48% of developers, fully verify code before pushing it.

  • Sonar Vortex spends 36% fewer tokens on average, particularly on tasks like refactoring existing codebases.

  • Teams using Sonar Vortex experience a 44% reduction in production outages.

  • Coding agents start every new session from scratch without knowing project conventions, coding guidelines, or architecture rules.

Timeline

  1. The Context Problem in AI Coding Agents

    Every new coding agent session begins from scratch, lacking awareness of predefined architecture rules or coding guidelines. When tasked with building features like a new API endpoint, the agent searches the repository randomly. This search process consumes valuable time and tokens while risking the replication of existing codebase flaws.

    • Starting a new agentic session in an IDE resembles hiring a new employee with zero knowledge of project conventions.
    • Agents assigned a feature must search the repository for context, which increases token usage and time.
    • Codebases often contain existing issues that agents tend to replicate and repeat.
  2. Introducing Sonar Vortex and Developer Trust

    Sonar Vortex resolves context and verification issues by connecting directly to coding agents. Survey data reveals a massive trust deficit among developers regarding AI code, yet less than half perform full verifications before pushing code. Rework slows development cycles down significantly when security flaws pass uninspected until the pull request stage.

    • Sonar Vortex is a plug-in connecting coding agents to project context before coding begins.
    • Sonar surveyed 1,100 developers and discovered 96% do not fully trust AI-generated code.
    • Only 48% of developers fully verify AI code prior to pushing it to production.
  3. Token Efficiency and Deterministic Guardrails

    Without guardrails, agents wander through repositories file by file, burning tokens and money. Providing project maps and coding standards upfront directs agents straight to correct files. Unlike AI-to-AI reviews which can hallucinate, Sonar Vortex uses a deterministic layer to consistently verify edits and enforce high security bars.

    • Sonar Vortex provides coding guidelines and an architecture map before the agent writes code.
    • Automated checks trigger every time an agent uses its tools to modify files.
    • Sonar Vortex users achieve a 36% reduction in token usage and a 44% drop in production outages.
  4. Real-World Demonstration and Remediation

    During a real task involving unzipping log files into a temp file, the agent queries Sonar for context before writing code. After implementation, Sonar Vortex runs analysis on changed files and flags security issues like unexplicit temp file permissions. When the agent attempts a weak fix relying on system defaults, Vortex rejects it and forces an explicit fix to maintain security.

    • The agent queries Sonar automatically for class locations and Java coding guidelines without manual prompts.
    • Sonar Vortex catches security flaws, such as unexplicit file permissions when unzipping logs.
    • Deterministic checks force the agent to iterate and fix security vulnerabilities explicitly rather than relying on defaults.

Description

Every new coding agent session starts like a new hire: it doesn't know your conventions, architecture rules or approved libraries, so it burns time and tokens searching your repo and repeats the issues already in it. Killian Carlsen-Phelan of Sonar introduces Sonar Vortex, a plugin that hands your agent a map of the codebase and your guidelines before it writes, then deterministically checks every edit. In a live session, Vortex catches a temp-file permission bug the agent's own tests missed, and rejects its first fix. Sonar reports 36% fewer tokens and 44% fewer production outages. Chapters: 0:00 Intro 0:26 Every agent session starts from scratch 1:59 What Sonar Vortex does 2:25 The bug a test wouldn't catch 3:35 96% don't trust AI code, 48% verify it 4:26 How Vortex guides the agent 7:00 36% fewer tokens 8:08 Bringing SonarQube into the agent loop 9:01 Demo: a real task 13:03 Not AI checking AI 14:17 The fix that wasn't a fix 16:20 What you get Killian Carlsen-Phelan https://www.sonarsource.com Join us in SF for the second annual AIE CODE summit: https://aie.codes our last flagship summit of 2026. Applications live now!

Write about this video