TLDR overview
- NIST’s AI RMF and SSDF work as a pair: the AI RMF’s four functions frame the risk decisions, and the SSDF practices supply the engineering actions that carry them out.
- Defining each AI deployment (its tool, task, data reach, and permitted actions), naming an accountable owner, and turning potential issues into concrete failure scenarios linked to SSDF practices makes AI risk assessable.
- Code confidence, powered by intent, guiderails, verification, and evidence, lets teams accelerate AI-assisted software delivery while keeping risk in control.
The NIST AI Risk Management Framework (AI RMF) defines risk as “the composite measure of an event’s probability of occurring and the magnitude or degree of the consequences of the corresponding event.”
In software delivery, that means asking how an AI-assisted activity could fail and what it would cost: an assistant might generate an authorization flaw or recommend a vulnerable dependency, and an agent with execution permissions could run an unsafe command or alter a deployment configuration. AI adds data flows, suppliers, and failure modes (a misleading test can undermine a security decision even when the tool is uncompromised) and speeds up what reviewers must evaluate and be accountable for.
The positive impacts of AI are also undeniable, and standards bodies and the industry recognize them: the AI RMF calls for strategies to "maximize AI benefits," NIST's NCCoE notes that AI helps teams "accelerate delivery timelines," and in Sonar's 2027 State of Code Developer Survey, AI generated or significantly assisted 65% of committed code, a year earlier than respondents expected.
Governance helps realize the positive impacts, from faster remediation to shorter delivery cycles, within risk tolerance. The sections below show how to formalize that governance by matching rigor to consequences and verifying changes through automated, multilayered checks, so the speed gains stay in place.
Preparation: Connect AI risk management to secure software development
The voluntary AI RMF (version 1.0, which NIST has said is being revised) has four functions in its Core:
- GOVERN sets accountability and decision criteria,
- MAP sets context,
- MEASURE evaluates risks and controls,
- and MANAGE decides the response, iteratively and with governance throughout.
The Secure Software Development Framework (SSDF) supplies the engineering practices in four groups (prepare the organization, protect software, produce well-secured software, respond to vulnerabilities), which DevSecOps integrates through automated checks, release controls, and continuous feedback. Together they turn a business concern into an engineering action: worry about an agent’s credential access becomes scoped permissions and isolated execution, which the assessment then tests.
1: Govern the workflow and its permissions
Start by defining the AI tool, its task, the repositories and data it can reach, and the actions it can take, since a code-completion assistant needs different controls than a command-executing agent. Assign an accountable engineering owner, involve security, procurement, and legal as needed, and decide who can approve new use cases or expand permissions and who accepts residual risk.
Then make the boundaries enforceable: for example, an agent may open pull requests in selected repositories, but should never touch production credentials or deployments. Assess how suppliers and model providers process and retain your code, and plan human oversight around real review capacity, since that capacity becomes part of the risk as AI output grows.
2: Map failures to business consequences
Build the assessment around credible scenarios: “AI-generated code may be insecure” becomes actionable when it describes an assistant omitting an ownership check so one customer can read another’s records. Others include an agent following malicious instructions in a repository file or a suggested dependency with a known vulnerability, each needing its own preventive and detective controls and evidence.
Record each scenario with its assets, consequences, controls, owner, and any weakness AI could amplify (weak branch protection, say), then link it to SSDF practices. The NCCoE’s mapping is a high-level starting point: an omitted ownership check points to PW.5 and PW.7 (secure coding, code analysis), a risky dependency to PW.4 (reuse of well-secured software), excessive agent access to PS.1 and PO.5 (least privilege, isolated environments), and release traceability to PS.2 and PS.3 (integrity, provenance).
3: Triage by impact, exposure, and uncertainty
Prioritize by application and workflow using your established likelihood-and-impact method, weighing data sensitivity, criticality, exploitability, and permissions, and record uncertainty, since limited evidence about a new agent should shape how it is introduced.
Separate inherent from residual risk (a review policy offers little assurance if reviewers approve changes they cannot explain), then reduce permissions, strengthen verification, restrict the use case, or accept the risk with a named owner, rationale, conditions, and review trigger, at a rigor that matches the consequences.
4: Measure and mitigate through DevSecOps
The NCCoE DevSecOps example implementations pair AI assistance in the Plan, Develop, and Continuous Feedback phases with source control, code analysis, testing, and approval controls. Their approach is human-directed generative AI, and NCCoE is now scoping an agentic implementation.
The reference model’s AI guidance says AI outputs should be traceable to source context, reviewed through control gates, logged for auditability, and approved by accountable stakeholders before use as requirements, code, configurations, or deployment inputs, and that AI-generated corrective actions remain proposals until reviewed.
5: Manage change and measure the benefit
Reassess as tools, models, and permissions change, and keep the ability to disable integrations, revoke credentials, stop agent actions, and recover changes. Track security outcomes (escaped defects, unresolved vulnerabilities, remediation time) next to delivery outcomes (review workload, rework, time to a verified change) against a set baseline, and feed incidents and recurring weaknesses back into requirements, standards, and tests, which ties SSDF vulnerability response to the AI RMF’s continuing measurement.
Where SonarQube fits: building code confidence
The governance decisions above need enforceable checks and an auditable record in the delivery workflow. Sonar’s code confidence model offers a way to organize that part of the work.
Sonar frames the question of how much autonomy agents can safely have as a formula: code confidence = intent × guiderails × verification × evidence. The terms multiply, so a zero anywhere leaves confidence at zero (verification without evidence creates no accountability, and evidence without independent verification only records what an agent claimed).
It lines up with the governance steps above: intent and guiderails are what GOVERN and MAP decide, and verification and evidence are what MEASURE and MANAGE depend on.
Intent: Intent is the standards and acceptance criteria written down before an agent starts, in a form that automated checks can enforce. In SonarQube that means quality profiles, which define the standards applied to code, and quality gates, which set the conditions results must meet on security, reliability, coverage, and more.
Guiderails: Guiderails turn intent into boundaries the agent works within. Sonar Vortex gives the agent project context and constraints (guidelines, architecture, license policies, security policies, and more) before it writes code, then guides and governs the agent as it works.
Verification: Thorough checks run independently of the model that wrote the code and apply the same way to human-written and AI-generated changes. Vortex analyzes the agent’s code as it is written, and SonarQube repeats the analysis in pull requests and CI, where quality gates can block merges. Hunter Agent adds detection of access-control and business-logic flaws, SonarQube Advanced Security covers open-source dependencies, and Remediation Agent proposes re-verified fixes for issues from the backlog.
Evidence: Evidence is the record of how standards were set up, what was checked, what was found, and how it was resolved. For example, audit logs record who changed permissions and security-related settings, and reports map findings against regulatory and security frameworks such as the OWASP Top 10, CWE Top 25, and the EU Cyber Resilience Act.
Code confidence enables organizations to move from accelerated code generation to accelerated software delivery, where shippable software is the main success metric.
Where should you start?
Pick one AI-assisted workflow with a small blast radius, such as an assistant working in a single service, and run the pilot based on the steps described above: name the accountable owner, write down the scenarios that worry you most, set the gate that changes must pass, and plant a known flaw to confirm it gets caught.
After the first pilot, compare escaped defects, review workload, and time to a verified change against your baseline, and let those numbers decide whether the next team gets the same setup or a tighter one. Use the results to decide where the workflow can expand, which controls need strengthening, and what residual risk the accountable owner can accept.
Ready to see where your code confidence gaps are, and how to close them? Talk to our team today.
