Human vs AI in Software Engineering: Who Should Own Security?
AI can automate, assist and recommend, but accountability for security cannot be delegated to a model. This article separates tasks AI can carry from decisions people must own, proposes a responsibility table and explains why human approval must be meaningful, not a checkbox.
In compliance programmes I have led, across SOC 2, PCI DSS, ISO 27001 and ISO 42001, an auditor eventually asks the same plain question about a control: who is responsible for this? A tool name is never an acceptable answer. A role, with a person in it who can explain what they decided and why, is.
AI-assisted development puts pressure on that question. When an assistant writes the function, proposes the dependency, drafts the test and summarises the pull request, it becomes unclear who decided what. This article tries to restore clarity. It separates what AI can reasonably carry from what a person has to own, offers a responsibility table you can adapt and explains why "a human approved it" is only a meaningful control if the approval is real.
Throughout, I separate what the sources say from my own analysis, and I label the analysis. Where I have no evidence, I say so.
Why this matters now
The evidence on AI coding assistants and security is mixed, and that mix is the reason ownership matters. One user study found that participants with an AI assistant wrote less secure code and were more confident in it 3. Two other studies found smaller or no effects: in a study of 58 students writing C, critical bugs occurred at a rate at most about 10% higher than controls 4, and in a study of 25 participants the assistant produced more secure solutions on a harder problem and showed no effect on an easier one 5. All three are small studies with limited scope, so none of them settles the question.
My reading, as analysis: the outcome depends on who is in the loop and how closely they look. If the effect of an assistant varies with the user and the task, then the safest thing is not to trust the tool or distrust it. It is to make sure someone accountable is checking the parts that matter. DORA's 2025 report landing page describes AI's primary role as an amplifier of an organisation's existing strengths and weaknesses 10. I read only the landing page, but the framing fits what I see: a team with clear ownership gets faster with clear ownership, and a team without it gets faster without it.
Background: ownership starts with the producer
Before talking about AI, it helps to recall where security responsibility sits in the first place. CISA's secure-by-design guidance, written with international partners, puts ownership of customer security outcomes on the software producer 1. That is a statement about organisations, not about tools. It means "the assistant wrote it" cannot be a defence, in the same way "a contractor wrote it" never was.
NIST's Secure Software Development Framework adds practices to any development lifecycle in four groups: preparing the organisation, protecting the software, producing well-secured software and responding to vulnerabilities 2. Notice that the first group is about the organisation. Roles, responsibilities and training are set before a line of code is written. AI does not change that ordering. It makes it more important, because the pace of the work now outstrips informal agreements.
NIST's AI Risk Management Framework organises AI risk work into four functions: Govern, Map, Measure and Manage 8. I take from this that governance is a separate activity from the technical work of mapping and measuring. That is my interpretation of the structure, not a claim about how any specific organisation should assign it.

A vocabulary: four ways AI can take part
Requests such as "let AI do the security review" mix together very different levels of involvement. I use four.
- Automate. AI performs a bounded task with a deterministic or easily checked result, such as formatting findings, deduplicating alerts or generating boilerplate tests. A mistake is cheap and visible.
- Assist. AI produces a draft that a person edits and then owns, such as a pull request summary, a threat-model starting point or a suggested fix.
- Recommend. AI proposes a decision, such as a severity rating or a release recommendation, but a person decides. The recommendation is an input.
- Own. Someone is accountable for the outcome and can be asked to explain it. In my view this level should stay with people for decisions that carry risk to customers, regulators or the business.
The line that matters is between the third and fourth. A recommendation that is always accepted has become a decision made by the model with a person's name on it. I come back to that below.
A model can draft the control, run the check and suggest the fix. It cannot be the one who answers for the release.
Human-in-the-loop, human-on-the-loop
Two terms are used for how a person relates to an automated process. In my usage, which is my own framing and not a standard:
- Human-in-the-loop means the process stops and waits for a person before the consequential step. Merging to a protected branch, granting a permission and releasing to production are examples.
- Human-on-the-loop means the process runs, a person supervises through monitoring and alerts and can intervene or stop it. Automated dependency updates that run tests and open a pull request, with a person watching the outcomes, fit here.
The right choice depends on the cost of being wrong and the ability to reverse it. For high-impact, hard-to-reverse actions I want a person in the loop. For low-impact, reversible ones, on the loop is usually enough.
This lines up with what two sources say about agents. OWASP lists excessive functionality, permissions and autonomy as root causes of excessive agency, and recommends minimal tools, scoped permissions and human approval for high-impact actions 6. The Model Context Protocol tools specification says that there should be a human in the loop who is able to deny tool invocations 7. Both support the principle. Neither tells you which actions in your business count as high impact. That is your risk assessment to make.
Who owns what: a responsibility table
The table below is my proposal, adapted from how I assign controls in audit-ready programmes. It is a starting point and not a standard, and your organisation will move some cells. I use R for responsible (does the work), A for accountable (answers for the outcome, one person per row), C for consulted and I for informed. The AI column describes the role of AI tooling, not a person: Automate, Assist or Recommend. AI is never marked accountable.
| Activity | Developer | Security lead | Product / engineering owner | AI tooling |
|---|---|---|---|---|
| Security requirements | C | A | R | Assist (draft) |
| Architecture and threat model | R | A | C | Assist (prompt questions) |
| Writing code | A, R | I | I | Assist (draft) |
| Code review of ordinary changes | R, A | I | I | Recommend (flag issues) |
| Review of authentication, authorisation, payment, data handling | R | A | C | Recommend |
| Test design for security properties | R | A | I | Assist |
| Running scans and triage of findings | C | A | I | Automate (run), Recommend (rank) |
| Security exceptions and risk acceptance | C | R | A | Recommend (summary only) |
| Dependency and tool approval | C | R | A | Assist (inventory) |
| Production release approval | R | C | A | Recommend (checklist status) |
| Incident response and decisions | R | A | C | Assist (timeline, log search) |
| Regulatory and customer commitments | I | R | A | Assist (evidence collection) |
Three observations, all analysis.
The accountable person is almost never the one who typed the code. That was already true before AI. What changes is that the person who typed the prompt may not have read every line of the result, so the habit of asserting "I wrote it, I understand it" needs to be earned each time.
Security exceptions are a human-only decision. An assistant can summarise the finding and the compensating controls. It should not decide to accept the risk, because risk acceptance is the moment an organisation chooses to carry a consequence. That choice needs an owner with the authority to carry it.
The incident row matters more than people expect. AI can help sort logs and reconstruct a timeline, which is useful. A decision to notify a customer, shut off a service or disclose to a regulator is a decision about trust, and it belongs to a named person.

What the table does not say
It does not say AI is not trusted. It says trust and accountability are different things. I might trust a tool to rank findings well and still not allow it to close them. The question is what happens when the tool is wrong, and who is positioned to notice.
Nor does it prove that any particular split is optimal. I did not find a verified study that compares ownership models for AI-assisted security work. This is a design proposal based on established principles, namely producer accountability 1, role clarity before development 2 and human approval for high-impact actions 67. Treat it as a hypothesis to test in your organisation.
Meaningful approval versus a checkbox
Most organisations add a human approval step and consider the problem solved. It is not, and I have seen why in audits. An approval is only a control if the approver can do three things.
- Understand what they are approving. If the change is five thousand generated lines with a one-line summary, the approver is signing for a summary. Keep changes small enough to read, or require the author to explain the risky parts in their own words.
- Say no at a reasonable cost. If rejecting a change delays a release and the approver is judged on speed, approval becomes automatic. The organisation has to make a refusal normal and cheap.
- See evidence the model did not write. A passing test report written by the same assistant that wrote the code is weak evidence. Scan results, independent tests and a diff of permissions are better. OWASP's guidance to treat model output as untrusted input 12 applies to an AI-written summary of a change as much as to code: it is a claim to verify, not a fact to rely on.
My simple test for a meaningful approval: ask the approver last month's rejection rate. If it is zero, either the process is perfect or the approval is ceremonial. I have not seen the first.
This connects to the confidence finding. If AI users are more confident in less secure code 3, then confidence in a green dashboard cannot be the approval signal. It has to come from checks that are designed to fail when a control is missing. OWASP draws a distinction between insecure design and insecure implementation and recommends threat modelling for critical flows 11. That is a human activity: deciding which flows are critical, and what must be true of them, comes before any generated code and before any generated test.
A risk-based approval model
A common mistake is to apply the same approval to everything. That overloads reviewers and trains them to click through. I prefer tiers, defined by impact and reversibility. The tiers are my own design.
| Tier | Example changes | AI role | Human requirement |
|---|---|---|---|
| 1. Low | Documentation, formatting, internal tooling, tests for existing behaviour | May draft and propose | One reviewer; automated checks must pass |
| 2. Moderate | Business logic, new endpoints, dependency additions | May draft; may recommend review findings | Reviewer who understands the area; new dependencies checked by a named approver |
| 3. High | Authentication, authorisation, payments, personal data, cryptography, infrastructure permissions | May assist; may not approve | Security lead involvement; tests authored independently; threat model updated |
| 4. Critical | Production releases of high-risk services, emergency changes, security exceptions | May summarise evidence | Named accountable owner signs; evidence retained |
Tiering has a side benefit for evidence. When an auditor asks how you control AI-assisted changes, you can show a rule, a sample of tier 3 changes and who approved them. That is far easier to defend than a general statement that people review everything.
An AI agent permission model
For agents that can act rather than merely suggest, ownership has to be expressed as permissions. OWASP's excessive-agency guidance is a useful base 6, and OWASP also publishes a threat-model-based reference for agentic AI threats and mitigations 9. I read only the landing page of that reference, so I use it as a pointer and not as a source for specific controls. Article 07 in this series goes deeper on agents.
The model I apply has four steps.
- Give the agent an identity. It acts under its own account, not a developer's, so its actions can be attributed and its access removed without affecting a person.
- Grant the least access for the task. Read access to the repository does not imply write access, and write access to a branch does not imply the ability to change pipeline configuration.
- Separate proposing from applying. The agent may open a pull request. A person merges it. Where speed requires auto-merge, restrict it to tier 1 changes.
- Log what it did. If you cannot reconstruct afterwards which changes an agent made, then ownership of those changes is unclear by construction.
I have not verified a study that measures how often approvals are rubber-stamped in AI-assisted workflows, so I make no claim about that rate. The concern comes from mechanism and from my audit experience.
Software ownership and accountability
There is one more risk that I see in almost every AI-heavy codebase: code with no owner. When a generated module works, nobody reads it closely; when it later breaks, nobody on the team can explain it. This is a form of knowledge debt, and it affects security because an unowned component is rarely patched, threat-modelled or reviewed.
My proposed rules, as analysis:
- Every service and module has a named owner, recorded where tooling can find it. Ownership follows the code and not the person who prompted it.
- The owner must be able to explain the module. If they cannot, the next change to it goes through a higher tier until someone can.
- Third-party AI dependencies have owners too. A model, plugin or agent in the delivery path is a supplier, and someone is accountable for approving it and reviewing its changes. OWASP's LLM supply chain entry recommends vetting suppliers and keeping components patched 13.
- Incident ownership is decided before the incident. The on-call person, the security lead and the executive contact are named, not discovered during the event.
Industry gaps
Based on the sources I could verify and my own experience:
- No agreed taxonomy for human oversight levels. Terms such as in-the-loop and on-the-loop are used loosely. I define mine above but they are not a standard.
- Little public evidence on which ownership models work. I did not find a verified comparison study.
- Limited guidance on meaningful approval. Sources recommend human approval for high-impact actions 67; I did not find verified guidance on how to measure whether the approval is substantive.
- Mixed evidence on AI assistance and security. Studies disagree 345, so policies written around a single finding are fragile.
Practical recommendations
For early-stage startups
- Name one accountable person for security, even if it is a founder, and write down which decisions they own.
- Adopt two tiers: ordinary changes with one reviewer, and sensitive changes (authentication, authorisation, payments, data) with a second reviewer.
- Do not let an assistant or agent approve its own work.
- Give any agent its own account with narrow permissions.
For scaling companies
- Adopt the four tiers above, or your own variant, and put the tier in the pull request template.
- Record AI involvement in pull request metadata so you can sample it.
- Assign owners to every service and review ownership quarterly.
- Measure the rejection rate and time-to-decision of approvals, to detect ceremonial approval.
For enterprises
- Map the responsibility table to your control framework and show how each accountable role is evidenced, in line with SSDF practices 2.
- Include AI tooling in third-party risk management 13.
- Define what agents may do autonomously, and require human approval for high-impact actions 67.
- Use a governance structure such as the AI RMF functions 8 to keep oversight separate from delivery.
Key takeaways
- Responsibility for security sits with the producing organisation, and "the model wrote it" is not a defence 1.
- AI can automate, assist and recommend, but I keep ownership of risk decisions with named people.
- Human approval is a control only if the approver understands, can refuse cheaply and sees independent evidence.
- Evidence on AI and code security is mixed 345, which argues for accountable checking and against both blind trust and blanket bans.
- Agents need identities, least privilege and a split between proposing and applying 67.
- Unowned generated code is a security risk in its own right.
Conclusion
The question "human or AI?" is the wrong frame. The useful one is "for each decision, who answers for it, and what evidence do they see?" AI can take over a great deal of the work around security. It is already good at drafting, searching and summarising. What it cannot do is be accountable, because accountability means someone can be asked why and has to answer.
If I were starting on Monday, I would write the responsibility table with my team, mark one accountable person per row, define the four approval tiers and check last month's rejection rate. That takes a few hours and tells you more about your real security ownership than most tooling purchases.
Views are my own; examples are composites and do not describe any specific employer or client.
Key takeaways
- Responsibility for security sits with the producing organisation, and "the model wrote it" is not a defence.
- AI can automate, assist and recommend, but I keep ownership of risk decisions with named people.
- Human approval is a control only if the approver understands, can refuse cheaply and sees independent evidence.
- Evidence on AI and code security is mixed, which argues for accountable checking and against both blind trust and blanket bans.
- Agents need identities, least privilege and a split between proposing and applying.
- Unowned generated code is a security risk in its own right.
References
- CISA with 17 U.S. and international partners. "Shifting the Balance of Cybersecurity Risk: Principles and Approaches for Secure by Design Software." 2023-10-25. https://www.cisa.gov/resources-tools/resources/secure-by-design — Supports: secure-by-design principles put security ownership on the software producer.
- NIST (CSRC). "Secure Software Development Framework (SSDF) Version 1.1: Recommendations for Mitigating the Risk of Software Vulnerabilities (NIST SP 800-218)." 2022-02. https://csrc.nist.gov/pubs/sp/800/218/final — Supports: SSDF adds secure practices to any SDLC, in four groups (PO, PS, PW, RV). Limitations: a practice framework, not specific to AI assistants.
- Perry, Srivastava, Kumar, Boneh (ACM CCS 2023; arXiv 2211.03622). "Do Users Write More Insecure Code with AI Assistants?" 2022-11. https://arxiv.org/abs/2211.03622 — Supports: participants with an AI assistant wrote less secure code and were more confident in it. Limitations: user study, 47 analysed participants; other studies found small or no effects.
- Sandoval, Pearce, Nys, Karri, Garg, Dolan-Gavitt (USENIX Security 2023; arXiv 2208.09727). "Lost at C: A User Study on the Security Implications of Large Language Model Code Assistants." 2022-08. https://arxiv.org/abs/2208.09727 — Supports: counter-evidence, 58 students writing C had critical bugs at a rate at most about 10% higher than controls. Limitations: small student sample, one language.
- Asare, Nagappan, Asokan (ICSE 2024; arXiv 2308.06587). "A User-centered Security Evaluation of Copilot." 2023-08. https://arxiv.org/abs/2308.06587 — Supports: counter-evidence, 25 participants produced more secure solutions on a harder problem and showed no effect on an easier one. Limitations: small sample.
- OWASP Gen AI Security Project. "LLM06:2025 Excessive Agency." n.d. (2025 edition). https://genai.owasp.org/llmrisk/llm062025-excessive-agency/ — Supports: root causes are excessive functionality, permissions and autonomy; mitigations include minimal tools, scoped permissions and human approval for high-impact actions.
- Model Context Protocol. "Model Context Protocol Specification 2025-06-18: Tools." 2025-06-18. https://modelcontextprotocol.io/specification/2025-06-18/server/tools — Supports: there should be a human in the loop able to deny tool invocations; clients must treat tool annotations as untrusted unless from trusted servers.
- NIST. "Artificial Intelligence Risk Management Framework (AI RMF 1.0), NIST AI 100-1." 2023-01-26. https://www.nist.gov/itl/ai-risk-management-framework — Supports: AI RMF organises AI risk work into Govern, Map, Measure and Manage.
- OWASP GenAI Security Project, Agentic Security Initiative. "Agentic AI - Threats and Mitigations." 2025-02-17. https://genai.owasp.org/resource/agentic-ai-threats-and-mitigations/ — Supports: a threat-model-based reference for agentic AI threats and mitigations exists (v1.0). Limitations: landing page only; no threat IDs verified.
- Google Cloud, DORA. "2025 DORA State of AI-assisted Software Development Report, landing page." 2025. https://dora.dev/research/2025/dora-report/ — Supports: describes AI's primary role as an amplifier of an organisation's existing strengths and weaknesses. Limitations: landing page only; full report not read.
- OWASP Top 10 project. "A04:2021 Insecure Design." 2021 edition. https://top10.owasp.org/2021/A04_2021-Insecure_Design — Supports: insecure design and insecure implementation are different; recommends threat modelling for critical flows. Limitations: 2021 edition.
- OWASP Gen AI Security Project. "LLM05:2025 Improper Output Handling." n.d. (2025 edition). https://genai.owasp.org/llmrisk/llm052025-improper-output-handling/ — Supports: model output should be treated as untrusted input; validate, encode for context, parameterise queries.
- OWASP Gen AI Security Project. "LLM03:2025 Supply Chain." n.d. (2025 edition). https://genai.owasp.org/llmrisk/llm032025-supply-chain/ — Supports: LLM supply chain vulnerabilities and mitigations including vetting suppliers, SBOM or AI BOM, signatures and hashes, patching.