Join our Newsletter — 33% off our NHI Course

AI coding agents and code generation security: are your controls keeping up?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 16521
Topic starter  

TL;DR: AI coding agents now browse, execute commands, call APIs, and install packages on behalf of developers, which expands AppSec risk from committed code to live generation-time behaviour, according to LEGIT Security. The governance gap is that most teams still scan too late, after the agent has already introduced secrets, insecure dependencies, or unsafe actions into the development workflow.

Editorial analysis by NHI Mgmt Group, based on content published by LEGIT Security: “The Missing Security Layer in AI-First Development”.

Key questions

Q: How should security teams prevent AI coding agents from making unsafe changes at generation time?

A: Put policy checks at the moment the agent acts, not only after code is written.

Q: Why do AI coding assistants increase AppSec governance risk?

A: They increase risk because they optimise for speed and plausible output, not for context-aware security validation.

Q: What are the signs that an AI coding agent is crossing from helpful automation into unsafe execution?

A: Look for command execution that does not match the visible approval, file writes outside the intended workspace, unexpected skill or MCP server installation, and autonomous changes to config or database targets.

Practitioner guidance

  • Enforce generation-time policy controls Block unsafe actions while the agent is still making decisions, rather than waiting for code review or CI to catch the result later.
  • Vet every connected MCP server Create an allowlist for Model Context Protocol servers, assess their reputation and block unapproved servers from influencing agent behaviour.
  • Limit developer credential exposure to the agent Scope the agent to the minimum credentials, APIs and filesystem paths required for the task so a prompt injection cannot reach everything the developer can.

Bottom line: AI coding agents are changing the security boundary from committed code to live generation-time behaviour, which means risky actions can happen before standard review ever begins.

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 5 months ago
Posts: 17012
 

Generation-time control is now the right security boundary for AI coding agents. Once an agent can browse, execute commands and call tools, post-commit scanning is only a backstop. The organisation is no longer governing a static code artefact, it is governing a non-human actor inside the build path. Practitioner conclusion: move policy checks to the moment the agent decides to act.

A few things that frame the scale:

  • Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
  • Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap, according to the State of Secrets in AppSec.

A question worth separating out:

Q: Should organisations rely on code scanning alone to secure AI-generated code?

A: No. Scanning is essential, but it is a detection layer, not a primary control. If the agent can already inject secrets, unsafe dependencies or destructive commands into the workflow, the organisation is correcting damage after the fact. Prevention has to start with agent access, tool trust and generation-time policy enforcement.

👉 Read our full editorial: AI coding agents need security controls at generation time



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.