By NHI Mgmt Group Editorial TeamBased on GitGuardian: “Three Tips To Use AI Securely at Work” (January 12, 2024)

TL;DR: GitGuardian argues that AI is becoming unavoidable in developer tooling, but insecure third-party services, prompt injection, and over-trusting model output can expose code, secrets, and flawed logic, so teams need governance, inspection, and data classification instead of blanket prohibition or blind trust. The governance problem is not AI adoption itself, but assuming developer workflows can absorb untrusted inputs without changing control points.


At a glance

What this is: This is an analysis of secure AI use in developer tooling, with the key finding that trust, data handling, and verification controls matter more than simply allowing or banning AI.

Why it matters: It matters because IAM, security, and engineering teams need to decide which data, prompts, and outputs are allowed into AI-assisted workflows without creating new leakage and integrity risks.

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


Context

AI in developer tooling is best understood as a governance problem, not just a productivity choice. The moment developers place sensitive code, secrets, or internal context into externally hosted systems, the organisation extends trust beyond its own control boundary.

The core failure mode is not that AI exists in the workflow, but that teams treat the model or service as if it can safely ingest whatever a developer can see. That assumption breaks once prompts, outputs, training data, and third-party retention are all in scope for the identity and data model.

For engineering and IAM teams, this puts data classification, external service approval, and output verification into the same conversation as software delivery. The article is firmly about developer workflows, but the security question is who can expose which information to which service, under what controls.


Key questions

Q: How should security teams classify data in environments where employees use AI tools?

A: Security teams should classify data at the moment it moves, not just when a file is created. The practical model combines content, context, and user input, then applies controls based on sensitivity. That approach is better suited to AI use because sensitive material can be pasted into a chatbot before a manual label is added.

Q: Why do third-party AI tools create risk in developer workflows?

A: Third-party AI tools create risk because prompts and outputs may leave the organisation’s control boundary and be retained or reused under the provider’s terms. Even when the tool is useful, it can become a disclosure path for source code, secrets, and internal context if data handling is not tightly governed.

Q: How can teams tell whether AI-generated code needs extra review?

A: Track where code or changes were produced by AI agents, then apply deeper static analysis and human review to paths that touch authentication, secrets, input handling, or sensitive data. The goal is not to distrust every generated line, but to concentrate scrutiny where the likely failure modes are highest.

Q: How should teams compare on-premises AI with public AI services?

A: Teams should compare them on data exposure, retention terms, inspection rights, and operational control. On-premises or private deployments can reduce exposure to third-party retention, but they still require policy, logging, and review controls. The right choice is the one that matches the sensitivity of the workflow, not the one that is easiest to adopt.


Technical breakdown

Why externally hosted AI tools behave like untrusted third parties

Externally hosted AI tools sit outside the corporate trust boundary even when they are embedded inside developer workflows. The risk is not only data transfer, but the provider’s ability to retain, inspect, or reuse prompts and outputs under its own terms of service. That makes the tool a foreign processing environment rather than a neutral utility. In identity terms, the user’s authority to act does not extend to the provider’s downstream handling of content. Once source code or secrets leave the environment, the organisation loses direct control over retention, training use, and secondary exposure paths.

Practical implication: Classify external AI services as untrusted data destinations and require explicit data-handling rules before developers can use them.

How prompt injection turns model input into an attack path

Prompt injection works by shaping the model’s behavior through malicious instructions embedded in prompts, documents, or retrieved content. The model does not reliably distinguish user intent from hostile instruction, so an attacker can steer it toward disclosure, policy bypass, or unwanted action. In developer tooling, that becomes dangerous when the model has access to repositories, internal documentation, or secrets-laden context. The issue is not that the model “knows” secrets in a human sense. It is that the model can be induced to surface training or contextual content that should never have been queryable in the first place.

Practical implication: Treat prompt content and retrieved context as attack surfaces and restrict what sensitive material the model can see.

Why AI-generated code still needs human and automated verification

Large language models generate plausible output, not verified correctness. They are pattern engines, so they can produce secure-looking code that is logically wrong, insecurely configured, or based on poisoned training examples. In software delivery, that means AI can accelerate drafting while still requiring the same controls applied to junior output: code review, static analysis, dependency checking, and test coverage. The bigger governance mistake is assuming that speed of generation implies trustworthiness of the result. For development teams, AI should change throughput, not the assurance bar.

Practical implication: Route AI-generated code through the same review and testing gates used for any other untrusted contribution.


Threat narrative

Attacker objective: The attacker wants to extract sensitive code, secrets, or misleading output from AI-assisted workflows and turn ordinary developer usage into a disclosure channel.

  1. Entry occurs when sensitive source code, internal prompts, or operational context are submitted to a third-party AI service under routine developer workflows.
  2. Credential or data exposure follows when the service retains, reuses, or becomes able to surface that content through prompt injection or model output.
  3. Impact occurs when proprietary code, hard-coded secrets, or unsafe logic escape into places where the organisation no longer controls their disclosure or use.
  • New York Times GitHub breach 2024: An exposed GitHub token gave an attacker The New York Times' repositories; the 270GB leak held 4,875 unique secrets.
  • Twitch breach 2021: A server misconfiguration leaked Twitch source code and payouts; the repositories held nearly 6,600 secrets, including 194 AWS keys.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 150+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

External AI services are now a data-governance problem before they are a developer productivity problem. The article correctly frames third-party AI tools as foreign processing environments, which means the real control question is what data is permitted to cross that boundary. That shifts the centre of gravity from tool approval to information classification and usage policy. The practitioner implication is that AI governance must sit inside secure development and identity governance, not beside it.

Trust in model output is not an assurance model. LLMs generate statistically likely answers, which makes them useful for drafting but unreliable for verification. That distinction matters because secure development has always depended on independent checks, and AI does not remove the need for review, testing, or static analysis. The practitioner implication is that AI output should be treated as untrusted contribution, not validated control evidence.

Prompt injection exposes a runtime trust gap, not just a content-filtering gap. The model can be manipulated by hostile instructions embedded in context, which means the boundary between user input and attacker input is much weaker than many teams assume. This is especially relevant when developer assistants can access repositories or internal documentation. The practitioner implication is that access scope and retrieval scope must be designed together, not separately.

AI in developer workflows creates a new version of secrets sprawl: sensitive material now moves through prompts as well as repositories. GitGuardian’s own observations about secrets leakage map cleanly to the article’s warning that developers may hand private code to systems they do not control. The governance lesson is that a prompt can become a shadow channel for code, credentials, and policy violations. The practitioner implication is that AI usage has to be governed as part of the broader secrets lifecycle.

Security teams should stop asking whether AI is allowed and start asking which trust assumptions still hold once AI enters the workflow. The article shows that prohibition alone does not work, but permissive adoption without inspection is equally weak. That leaves teams with a governance design problem: decide what the model may see, what it may return, and what must always be independently verified. The practitioner implication is a controlled adoption model, not a binary yes or no.

From our research library:

What this signals

AI adoption in engineering teams is becoming a control-design problem. The practical question is no longer whether developers will use AI, but which workflows can absorb it without exposing code, secrets, or unverified logic. Security teams need policy, review, and content controls around the model boundary, not just acceptance rules for the tool itself.

Secrets handling now extends into prompt handling. If only 44% of developers are reported to follow security best practices for secrets management, the gap becomes more dangerous when those same developers can paste sensitive material into AI tools at the speed of daily work, according to the State of Secrets in AppSec.


For practitioners

  • Define approved data classes for AI tools Specify which code, logs, secrets, customer data, and internal documents may be entered into external AI services, then train developers on the boundary.
  • Block secrets from AI prompts and retrieval context Apply repository scanning, DLP, and prompt hygiene controls so that API keys, tokens, and private code do not enter model context.
  • Require review for AI-generated code Treat generated code as untrusted input and run it through code review, static analysis, and tests before it reaches production.
  • Assess external AI retention and training terms Review whether provider terms allow content retention, training, or secondary use, and reject services that conflict with your handling rules.
  • Document safe alternatives for developer use Provide approved on-premises or enterprise AI options where teams need assistance but cannot expose sensitive material to public services.

Key takeaways

  • AI in developer tooling changes the trust boundary around code, prompts, and outputs, so governance has to move closer to the workflow.
  • The main risk is not simple misuse of AI, but uncontrolled exposure of sensitive material and overconfidence in unverified model output.
  • A workable programme treats AI-generated code and external AI services as untrusted until classification, review, and verification controls have been applied.

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, OWASP Agentic AI Top 10 and OWASP API Security Top 10 address the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe article centres on secrets and code exposure through AI-assisted developer workflows.
NHI-10 — Human Use of NHIDevelopers are manually using AI services as identity-bearing tools in workflow decisions.
Recommendation — Prevent secret leakage into AI prompts and outputs by scanning, blocking, and training developers on approved data use. Govern how people use AI services so human actions do not turn the service into an uncontrolled disclosure path.
OWASP Agentic AI Top 10ASI02 — Tool MisuseThe article warns that AI tools can be steered into unsafe or unintended actions through prompt-driven misuse.
Recommendation — Limit what tools and data the AI can access so prompt-driven misuse cannot expand its effective authority.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article is fundamentally about controlling what data and services AI-assisted workflows can reach.
Recommendation — Apply PR.AA-05 to restrict AI tools to only the data and services required for the task.
OWASP API Security Top 10API8 — Security MisconfigurationExternal AI services and integrations are only as safe as the configuration and data-sharing settings around them.
Recommendation — Review AI service configurations for retention, sharing, and data exposure settings before allowing use.

Key terms

  • Prompt Injection (Agentic): An attack where malicious instructions are embedded in content that an AI agent reads, causing the agent to execute unintended actions using its own legitimate credentials. A primary vector for agent goal hijacking and identity abuse.
  • Third-Party AI Agent: A third-party AI agent is an external autonomous software entity that connects into an organisation’s systems to perform tasks, query data, or invoke tools. Because it operates outside direct human interaction, it needs tightly scoped identity controls, audited access, and clear accountability for every action it takes.
  • GenAI Generated Code: GenAI generated code is source code produced or heavily shaped by a generative AI system rather than written line by line by a developer. The code may be functional, but it still needs the same controls as human authored code, including review, testing, dependency checks, and security validation.
  • Data Classification Boundary: A data classification boundary is the point at which information is judged too sensitive for a given workflow, system, or service. For AI-assisted development, it defines which code, secrets, and internal data can be exposed to prompts, retrieval, or model context.

What's in the full article

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

  • The specific examples of insecure AI usage in developer workflows, including external service handling and training-data exposure
  • The full discussion of prompt injection and why models can surface information developers did not intend to share
  • The practical reasoning behind treating AI output like junior code that still needs review and testing
  • The source article's closing guidance on using AI cautiously rather than banning it outright

👉 GitGuardian's full article covers prompt injection, third-party service risk, and code-review implications in more detail.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 1, 2026.
Updated on October 7, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org