By NHI Mgmt Group Editorial TeamPublished 2024-01-12Domain: Agentic AI & NHIsSource: GitGuardian

TL;DR: AI is moving into developer tooling and workflows, but insecure external services, prompt injection, and over-trusting model output can expose code, secrets, and bad logic, according to GitGuardian. The practical conclusion is that AI adoption needs governance, inspection, and data classification, not blanket prohibition or blind trust.


At a glance

What this is: This is a developer-focused analysis arguing that secure AI use depends on treating external AI tools as untrusted, limiting what data they can see, and verifying any code or output they produce.

Why it matters: For IAM and NHI practitioners, the article maps AI adoption to access control, data handling, and verification problems that look increasingly like non-human identity governance.

👉 Read GitGuardian's analysis of secure AI use in developer workflows


Context

AI in developer tooling creates a governance gap because the model, the platform, and the connected data sources all become part of the trust boundary. Once employees use AI to draft code, summarize repositories, or process sensitive inputs, identity and access decisions extend beyond human users to machine-assisted workflows and the secrets they can expose.

The core issue is not whether AI should exist in the workplace. The issue is whether organisations can classify what AI is allowed to see, what it is allowed to return, and what must still be reviewed by a human before it reaches production. That is an NHI governance problem because AI systems increasingly operate with execution authority, data access, and persistence similar to other non-human actors.

The article's starting position is typical of current enterprise reality: AI adoption is happening faster than control design. That mismatch is now common across development, security, and platform teams.


Key questions

Q: How should security teams govern AI use in developer tooling?

A: Security teams should govern AI use as a data and access problem, not only a productivity feature. Define what information can be sent to models, require human review of generated code, and apply least privilege to connected repositories and tools. Approved use cases should be explicit, monitored, and revisited as model capabilities expand.

Q: Why do AI assistants increase secrets exposure risk?

A: AI assistants increase secrets exposure risk because developers can paste sensitive material into tools that may retain, process, or surface that data beyond the intended scope. If the model is connected to repositories or logs, prompt injection and broad context retrieval can make exposure worse. The safe answer is to prevent secrets from entering AI workflows unnecessarily.

Q: What is the difference between AI governance and code review?

A: AI governance decides what data, tools, and use cases are allowed. Code review checks whether the output is correct, secure, and maintainable. Both are needed because governance controls the input boundary while review validates the result. Without governance, sensitive data can leak into the model. Without review, insecure AI-generated code can still reach production.

Q: When should organisations allow AI in development workflows?

A: Organisations should allow AI in development workflows when they can classify the data being shared, limit model access to the minimum needed, and enforce review before release. If a workflow depends on exposing secrets, sensitive code, or unbounded internal context, the control gap is too large and the use case should wait for stronger guardrails.


Technical breakdown

Why external AI tools behave like untrusted third parties

External AI services sit outside the corporate control plane, even when they appear embedded in familiar developer workflows. If code, tickets, or configuration data are sent to a hosted model, the organisation inherits the provider's retention, training, and access policies. That changes the security model from internal processing to delegated processing. For IAM teams, the key question is not whether the tool is useful, but whether the data it receives is already classified for external handling and whether the resulting outputs can be trusted without review.

Practical implication: classify AI tools as third-party processing paths and apply explicit data handling rules before developers can use them.

How prompt injection turns AI into a data disclosure path

Prompt injection works by manipulating the instructions or context that guide an AI system, causing it to ignore intended boundaries or reveal memorised or supplied information. In developer environments, the risk increases when models are exposed to large, unsanitised codebases, documentation, or tool outputs. The model does not understand secrecy in the human sense, so it can surface information that was never meant to be user-visible. This is especially relevant when AI assistants are connected to repositories, issue trackers, or internal knowledge stores.

Practical implication: limit the data available to AI assistants and assume any connected context may be retrievable unless actively constrained.

Why AI-generated code still needs human review and testing

AI coding assistants generate likely answers, not verified implementation. They may produce insecure patterns, obsolete libraries, or code that looks correct but fails in edge cases. The control problem is similar to onboarding a junior developer, except the assistant can produce output at machine speed and at scale. Static analysis, code review, dependency checks, and test coverage still matter because the model does not validate correctness or security. In practice, AI increases throughput only when review discipline keeps pace with output volume.

Practical implication: keep AI output inside the normal SDLC review chain instead of treating it as production-ready code.


Threat narrative

Attacker objective: The attacker wants to extract secrets, proprietary code, or unreliable generated logic from AI-assisted development workflows.

  1. Entry occurs when developers paste sensitive source code or internal context into a hosted AI service during routine work.
  2. Escalation happens when the model is connected to broad repository context or unsanitised training data, allowing prompt injection or memorised leakage to surface protected information.
  3. Impact follows when secrets, proprietary code, or insecure generated code move into production pipelines without sufficient human review.

Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

AI-assisted development creates an identity and data governance problem before it becomes a code-quality problem. The first control failure is usually not the model output itself. It is the decision to let an autonomous or semi-autonomous system see information it should not process in the first place. That is why AI use in developer tooling belongs in the NHI governance conversation, not just the AppSec conversation. Practitioners should treat model access as a policy decision, not a convenience feature.

Prompt injection is the AI equivalent of a context-bound privilege escalation. The model is given legitimate inputs, but those inputs can be reshaped to produce illegitimate disclosure or action. That means boundary enforcement must happen around prompts, connected tools, and data scope, not only around authentication. Security teams that focus only on user login and ignore the model's effective context will miss the real attack surface. Practitioners should secure the prompt path as carefully as they secure the API path.

Human review remains the control plane for AI-generated code. The article's most defensible point is that AI output should be treated as untrusted draft material, not as code with implicit correctness. That stance aligns with least privilege, separation of duties, and verification-first governance. In NHI terms, the model may assist the workflow, but it should not inherit authority to bypass review, testing, or release gates. Practitioners should preserve human accountability for anything that can reach production.

AI policy will fail if it is only a prohibition policy. Users respond to blanket bans by routing around them, which creates shadow AI and weaker visibility. The more durable model is to allow approved use cases, restrict sensitive data exposure, and define verification requirements for all AI-assisted output. That approach reduces cat-and-mouse behavior while keeping the organisation inside a measurable control framework. Practitioners should replace bans with enforceable guardrails.

Ephemeral productivity gains create lasting trust debt when AI tools are not governed. Every shortcut that speeds code generation can expand the amount of unreviewed logic and exposed context entering the pipeline. Over time, that compounds into larger review backlogs, broader secret exposure risk, and more dependence on tools that the organisation does not fully control. Practitioners should treat AI enablement as a lifecycle governance issue, not a point-in-time adoption decision.

From our research:

  • Organisations maintain an average of 6 distinct secrets manager instances, creating fragmentation that undermines centralised control, according to The State of Secrets in AppSec.
  • The average estimated time to remediate a leaked secret is 27 days, despite 75% of organisations expressing strong confidence in their secrets management capabilities.
  • For a broader control lens, review Top 10 NHI Issues alongside this analysis to map where AI workflows expand non-human identity risk.

What this signals

AI adoption in developer tooling will pressure identity programmes to define policy at the workflow level, not only at the account level. The next control gap is not whether a user can authenticate. It is whether a model, plugin, or connected assistant can see the right data and return output that deserves trust. Teams should expect more requests to approve AI services as sanctioned non-human actors, with tighter logging and scope limits attached to each use case.

With organisations maintaining an average of 6 distinct secrets manager instances, fragmentation already makes centralised control difficult according to The State of Secrets in AppSec. AI tools that touch code, tickets, and documentation only widen that sprawl unless teams standardise access paths and review gates.

The practical signal for programme owners is that AI enablement and NHI governance will converge quickly. If developers can use AI to draft code, summarise repositories, or query internal systems, those workflows need lifecycle controls, access scoping, and auditability before they become part of everyday delivery.


For practitioners

  • Define approved AI data classes Create a policy that specifies which source code, logs, tickets, and documents developers may submit to external AI systems. Classify secrets, customer data, and internal design material as prohibited unless the tool is explicitly approved for that data type.
  • Gate AI-assisted code through normal review Require static analysis, peer review, dependency checks, and test execution for all AI-generated code. Treat the model as a drafting aid, not as an authority that can bypass SDLC controls.
  • Restrict model context to least privilege Limit repository access, connector scope, and prompt context so the model only sees what is needed for the task. Reduce the blast radius by keeping sensitive systems out of broad all-company-facing assistants.
  • Add explicit controls for prompt injection Test AI workflows for instructions hidden in code, documentation, and retrieved content. Sanitize inputs, strip untrusted context where possible, and monitor for outputs that disclose memorised or adjacent sensitive information.
  • Track shadow AI use in developer teams Inventory the AI services employees use in practice, not just the ones that are officially approved. Close the gap between policy and behaviour by offering secure alternatives and logging usage where feasible.

Key takeaways

  • AI in developer workflows becomes an access control issue as soon as sensitive data can enter a model prompt.
  • Prompt injection, broad context retrieval, and unreviewed code generation create distinct but connected NHI governance risks.
  • The durable control pattern is allow, scope, verify, and monitor, not ban or trust by default.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10NHI-01AI assistants can expose data or act on unsafe prompts through connected tooling.
OWASP Non-Human Identity Top 10NHI-05Secrets and tokens in AI-assisted workflows need stronger discovery and protection.
NIST CSF 2.0PR.AC-4Least-privilege access applies to AI tools connected to code and documentation.

Inventory secrets used in AI-enabled development and remove them from broad-access workflows.


Key terms

  • Prompt Injection: Prompt injection is an attack technique that manipulates an AI system's instructions so it behaves in unintended ways or reveals information it should not. In practice, the malicious content can arrive through user input, retrieved documents, code comments, or other context that the model treats as authoritative.
  • Shadow AI: Shadow AI is the use of AI systems, assistants, or agents that operate outside approved governance and visibility. These tools may process sensitive data, connect to internal systems, or generate business outputs without the controls, logging, or review that the organisation expects.
  • AI-assisted Code Generation: AI-assisted code generation is the practice of using a model to draft or modify source code for a developer. It can speed delivery, but it does not verify correctness, security, or compliance, so the output still needs the same review, testing, and change control as human-written code.

What's in the full article

GitGuardian's full blog post covers the operational detail this post intentionally leaves for the source:

  • The original Security Repo Podcast framing and the three-tips structure that shaped the discussion
  • Specific examples of how external AI services handle uploaded content and why that matters for developer policy
  • The prompt injection and code-review examples discussed in the source conversation
  • The article's practical recommendations for using AI without turning development into an unsanctioned data-sharing channel

👉 GitGuardian's full post covers the podcast examples, prompt-injection discussion, and developer policy guidance.

Deepen your knowledge

AI-assisted development, prompt injection, and non-human access scoping are covered in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building controls for developer AI use, the course offers a practical governance baseline.
NHIMG Editorial Note
Published by the NHIMG editorial team on 2024-01-12.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org