Coding agents need a reviewable change and independent evidence before a task is considered complete.
2
Sonar's agent-centric development cycle adds project guidance before generation, analysis after edits, and issue remediation inside the IDE.
3
The workshop connects SonarQube Cloud, its CLI, Codex, hooks, skills, and an MCP server to block secrets, find SQL injection, and verify repairs.
Summary
Killian Carlsen-Phelan demonstrates a coding workflow that puts SonarQube feedback inside the agent loop. The sample project is a small Python application with a hardcoded OpenAI API key, a SQL injection vulnerability, and other planted issues. SonarQube detects the exposed secret and traces user-controlled input from an environment argument into a database query. Killian connects the project to Codex through the SonarQube marketplace, CLI, hooks, skills, and MCP server. A secrets hook blocks a fake credential before it reaches the agent. The issue-listing skill brings dashboard findings into the terminal. Codex then fixes the vulnerable query by using parameters instead of string interpolation. An agentic analysis hook scans the edited code and confirms that the repair did not introduce a new issue. Killian also adds a new database operation, showing how project guidance can be supplied before generation and verification can happen immediately after edits. The setup depends on available SonarQube entitlements for some features.
A completed task needs evidence alongside the code change
The introduction defines completion as more than the agent saying that it fixed something. A task should produce a reviewable diff and tool evidence that supports the result. The speaker recommends checking disconfirming evidence through sources such as the compiler, tests, and analysis. Self-critique can help, but it is not an independent oracle because the agent and its verifier can repeat the same mistake. Human review still owns intent, exceptions, and the decision to ship.
Execution limits do not prove that an artifact is safe
The talk separates the execution layer from the artifact layer. Execution controls what tools an agent can use, what scope it has, and which approvals it needs. Artifact evaluation asks whether the result is acceptable and whether its tests, analysis, policy, and intent are sound. A sandbox can contain a write, but it cannot prove that a database query is safe. The speaker recommends controls with different boundaries rather than relying on one oracle.
Verification has moved into the inner development loop
Killian says Sonar's research found that 42% of committed code is AI-generated or AI-assisted, while 96% of developers do not fully trust it. Fewer than half say they fully verify code before pushing and merging it. He describes the resulting bottleneck as code verification. The outer loop waits for a push and a failed test or scan, then sends the engineer back to the IDE. The inner loop checks generated code in the IDE before it is pushed.
Sonar owns guidance, verification, and remediation around generation
Killian describes four stages in the agent-centric development cycle: generate, guide, verify, and solve. The coding tool handles generation. Context augmentation supplies project guidelines, rules, architecture, and other relevant information before the agent works. Verification checks newly generated code for security, quality, and maintainability issues. Solve helps remediate findings so the engineer can continue iterating in the same workflow.
The sample project makes data-flow security findings visible
The workshop uses a tiny Python project with about four files and fewer than 200 lines. Killian planted four issues, including three security vulnerabilities and one code smell. One finding is an OpenAI API key stored directly in the source code. Another is SQL injection in database.py, where an argument from an environment value is inserted into an f-string and passed to cursor execution. SonarQube traces the path with symbolic execution and taint analysis.
Codex can receive dashboard findings through the SonarQube integration
Killian adds the SonarQube marketplace to Codex, installs the plugin, authenticates the CLI, and runs the integration command. The setup adds a secrets detection hook, an agents.md directive, skills, and MCP configuration. The issue-listing skill lets Codex fetch findings from the SonarQube project dashboard into the terminal. This gives the agent concrete issue data instead of asking it to infer problems from the source alone.
The secrets hook blocks prompt input before the agent sees it
Killian asks Codex to push a commit using a fake token supplied by the plugin's test flow. The hook blocks the request before the secret enters the model context. He says the same protection blocks attempts to read a file containing a secret. During questions, he explains that the hook is tied to the prompt-submit tool, so a different path could bypass it. The protection therefore needs to be understood as one boundary in a larger control system.
Post-edit analysis verifies the SQL injection repair
Killian asks Codex to fix the SQL injection finding identified as S8702. The agent changes the query to use parameters rather than interpolating the input into the SQL string. The post-tool-use hook then runs server-side analysis on the edited code. It distinguishes pre-existing findings from new problems and confirms that the changed code passes without reporting S8702. Killian uses this to close the loop between finding, repair, and verification.
Killian then asks Codex to add a delete-task-by-ID function to database.py. Context augmentation supplies relevant project rules and architecture before generation. Agentic analysis checks the new edit afterward, and Codex would continue iterating if it found an issue. This extends the workflow beyond repairing known findings. The same guide, verify, and solve process applies when the agent is writing a new database operation.