TL;DR: Coding agents are now writing more code, taking more actions, and operating across developer environments that AppSec teams were not built to monitor individually, according to GitGuardian. The practical problem is not only policy drift but enforceable control drift: teams need deterministic guardrails around credentials, egress, sandboxing, and action approval, or the lethal trifecta becomes a repeatable exposure pattern.
At a glance
What this is: This is a GitGuardian guide on securing coding agents at team scale, with the key finding that policy alone cannot control what agents read, run, or send.
Why it matters: It matters because AppSec and IAM teams now have to govern developer-facing agent activity, MCP server access, and CI/CD credentials as a single control problem.
By the numbers:
- Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap.
👉 Read GitGuardian's guide on securing coding agents across your team
Context
Coding agents are changing the shape of developer identity risk because they can read code, invoke tools, and move data across IDEs, CLIs, MCP servers, and CI/CD pipelines. That creates a control gap for AppSec and IAM programmes that were designed around human decision-making, not agent-driven action at runtime. For teams that are already dealing with secrets sprawl, this is the next layer of exposure.
The governance problem is not whether teams can write policies for agent use. The problem is that policies do not prevent an agent from accessing a secret, calling a tool, or forwarding data unless those controls are enforced in the environment itself. That makes coding-agent security a practical identity and access management issue, not just a developer workflow issue.
For identity teams, the article sits at the intersection of NHI governance, secrets control, and operational guardrails across the software delivery path. The starting position is typical: most organisations have more guidance than enforceable agent controls.
Key questions
A: Security teams should separate the authority to request work from the authority to execute it, then scope each agent to the minimum repositories, tools, and pipeline stages needed for its task. The safest design uses explicit approval points for sensitive actions, strong logging for delegated steps, and periodic review of which agent identities still need those permissions.
Q: Why do coding agents increase the risk of secret leakage?
A: Coding agents expand the places where a secret can be exposed, including chat logs, local files, terminal history, and provider retention. That means a single disclosure can create multiple persistent traces, turning one action into a longer-lived access problem. The risk grows whenever the secret is visible outside a tightly controlled retrieval path.
Q: What breaks when agent tool access is governed only by guardrails?
A: Guardrails can shape model behaviour, but they do not reliably deny execution. That creates a false sense of safety, especially when planners, parsers, or local hooks can still emit or pass through risky calls. The result is inconsistent enforcement across tools, sessions, and environments.
Q: Who should own coding agent risk, AppSec or IAM?
A: Both, because the problem spans application workflow and identity governance. AppSec owns the runtime guardrails and detection points, while IAM owns the credential scope, lifecycle, and trust boundary. The article makes clear that coding agents cannot be safely managed by either team in isolation.
Technical breakdown
Why policy cannot control coding agents at runtime
Coding agents operate inside developer workflows where policy text is easy to ignore and hard to verify. Once an agent can read files, call tools, and communicate externally, the security question becomes whether the environment enforces what the agent may do, not whether the policy describes it. This is especially relevant when agents can chain actions across IDE plugins, MCP servers, and pipeline steps. Practical controls need to live in permission modes, sandboxing, hooks, and credential boundaries rather than in a handbook.
Practical implication: move control from written guidance into enforceable defaults across the agent runtime.
How the lethal trifecta creates credential exposure
The lethal trifecta is the combination of private data, untrusted content, and external communication. In agentic developer environments, that pattern matters because code, secrets, and tool outputs can be combined in ways that humans would normally inspect before release. A coding agent with broad access can leak credentials indirectly by reading a secret and then forwarding it through an approved outbound channel. That is why secrets detection and egress control have to operate together.
Practical implication: pair secrets discovery with outbound communication controls so one control cannot bypass the other.
Why MCP servers change the trust boundary
MCP servers act as the connective tissue between agents and tools, which means they become part of the access perimeter. If publisher verification, scope boundaries, and credential scoping are weak, the agent inherits tool reach that is broader than the business process requires. The practical risk is not MCP itself, but unmanaged trust in the tool layer that agents can invoke. In identity terms, this is a workload access problem wrapped in a developer experience.
Practical implication: treat MCP server onboarding like identity onboarding, with scoped credentials and verification before exposure.
NHI Mgmt Group analysis
Coding-agent governance is now an NHI control problem, not a policy exercise. Once a non-human actor can read code, invoke tools, and transmit data, the security model has to move from human compliance to enforced runtime boundaries. Written rules help, but they do not stop secrets from being read or tools from being called. Practitioners should treat coding agents as governed non-human identities whose permissions must be constrained where the action occurs.
Policy-as-code for agents is really policy-as-access. The article points toward a useful concept: enforceable agent defaults. That means the decisive control is not whether a policy exists, but whether permission modes, sandboxing, approval gates, and credential scope are defined in the tooling stack. For AppSec and IAM teams, the governance question is whether the environment can make unsafe actions unavailable by default.
Secrets detection alone will not contain agent-driven exposure. The guide correctly ties credential controls to egress, sandboxing, and action-level hooks because agents can move from discovery to disclosure in one flow. That is why teams that separate secrets monitoring from runtime enforcement will continue to miss the actual exfiltration path. The practical conclusion is that secrets governance and agent governance now have to be designed together.
MCP and CI/CD inherit identity risk when trust is granted too broadly. Headless agents, publisher verification, scoped credentials, and OIDC-backed least privilege are all signs that the access boundary has shifted from the human developer to the system acting on their behalf. That shift forces IAM teams to rethink where trust is established, who approves it, and how quickly it can be revoked. The implication is broader lifecycle governance for every machine actor in the delivery chain.
Developer experience is now a security control surface. Controls only work when developers keep them enabled, which makes usability part of the threat model. If a sandbox is too brittle or an approval gate is too noisy, teams will bypass it; if controls are usable, they become durable guardrails. Practitioners should measure agent security by how consistently defaults survive real developer behaviour, not by how complete the policy document looks.
From our research:
- 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.
- Our research shows that organisations maintain an average of 6 distinct secrets manager instances, creating fragmentation that undermines centralised control.
- That fragmentation makes runtime governance harder, which is why The 52 NHI breaches Report is a useful next reference for understanding how identity sprawl turns into exposure.
What this signals
Agent guardrails will only hold if they are embedded where developers work. Security teams should expect coding-agent controls to be judged by adoption, not policy volume. A brittle approval gate or overreaching sandbox will be bypassed, which means the real programme objective is durable defaults that survive everyday developer pressure.
With 6 distinct secrets manager instances on average, fragmentation is already a control issue. When agent activity spans IDEs, MCP servers, and CI/CD, fragmented vaulting turns secrets governance into an enforcement problem rather than a visibility problem. The next maturity step is cross-environment control consistency, not another isolated scanner.
The broader signal is that NHI governance is moving closer to software delivery. Teams that still separate secrets, pipeline identity, and developer tooling into different operating models will struggle to contain agent-driven exposure. The practical response is to unify access scope, detection, and lifecycle review across the full delivery chain.
For practitioners
- Standardise agent permission modes Define one approved set of permission defaults for IDE, CLI, and headless coding agents, then lock those defaults into policy-as-code so individual developers cannot weaken them ad hoc.
- Separate secrets detection from secrets exposure Place secrets scanning, sandboxing, and egress controls in the same workflow so an agent cannot both discover a credential and transmit it through an allowed channel without being blocked.
- Scope MCP server access like workload identity Require publisher verification, narrow tool scope, and short-lived credentials before allowing an MCP server into the development estate, especially where the server can touch production-adjacent data.
- Gate irreversible agent actions Use approval points for destructive or externally visible actions such as merges, deployments, or data export, and make those gates part of the platform rather than a manual checklist.
- Review CI/CD identity lifecycles together Treat coding agents, service accounts, and pipeline tokens as one governance chain, then review where standing access persists after the task has ended or the tool has changed hands.
Key takeaways
- Coding agents create a runtime identity problem because they can read, act, and communicate across developer tools without human pacing.
- Policy text is not enough when the environment still permits unsafe access, so enforcement has to move into defaults, sandboxing, and scoped credentials.
- Secrets governance, MCP onboarding, and CI/CD identity lifecycle review now need to be designed as one control surface.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST Zero Trust (SP 800-207), NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | The article focuses on non-human access to code, secrets, and tools. |
| NIST Zero Trust (SP 800-207) | section 2.1 | The guide emphasises least privilege and continuous verification for agent access. |
| NIST CSF 2.0 | PR.AC-4 | Least privilege and access governance are central to the controls discussed. |
| NIST SP 800-53 Rev 5 | AC-6 | Least privilege is the core control pattern for coding-agent permissions. |
Apply zero-trust principles to agent runtimes, tool access, and credential scoping across developer environments.
Key terms
- Coding Agent: A coding agent is a software system that can plan, generate, and modify code with limited human prompting. In governance terms, it is not just a tool but an actor whose permissions, tool access, and rollback path must be managed as part of the delivery process.
- Lethal Trifecta: A risky AI agent condition where one system can read private data, consume untrusted content, and communicate externally. When those three capabilities overlap, the agent can be tricked into disclosing sensitive information through legitimate tools without a conventional exploit.
- Policy as Code: Policy as code stores authorization logic in version control and evaluates it through testable, reviewable rules. For agent governance, it makes runtime decisions reproducible and measurable, which is critical when actions can be triggered by untrusted content and executed at machine speed.
- MCP Server: An MCP server is a tool endpoint that connects an AI agent to external systems and data sources through Model Context Protocol. Because it extends what the agent can reach, it becomes part of the identity and access surface and must be reviewed like any other privileged connector.
What's in the full article
GitGuardian's full whitepaper covers the operational detail this post intentionally leaves for the source:
- Standardised permission-mode patterns for IDE and CLI agents that can be deployed across a team.
- Action-level hooks and sandboxing guidance for reducing risky agent behaviour without relying on manual review.
- Publisher verification, scoped credentials, and OIDC patterns for MCP servers and headless agents.
- A team security checklist for coding agents, CI/CD pipelines, and credential hygiene.
Deepen your knowledge
NHI governance, agentic AI identity, and machine identity security are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an identity security programme, it is worth exploring.
Published by the NHIMG editorial team on August 27, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org