Google Gemini Coding Agent Can Be Tricked Into Leaking GitHub Secrets
AI coding agents are becoming increasingly integrated into software development.
They can read repositories, analyze code, create pull requests and interact with development tools.
But that access also creates a new security problem.
Security researchers have demonstrated a prompt injection attack against Google’s Gemini coding environment that could potentially trick an AI agent into exposing sensitive GitHub information.
The Problem With AI-Powered Development
A traditional developer tool generally executes explicit commands.
An AI coding agent works differently.
It reads code, documentation, comments and other repository content and uses that information to decide what actions to take.
That means seemingly harmless content inside a repository can potentially become an attack vector.
An attacker could place carefully crafted instructions inside:
- source code comments,
- README files,
- documentation,
- issue descriptions,
- pull requests,
- or other repository content.
When an AI agent processes that content, the instructions may influence its behavior.
This is known as indirect prompt injection.
Why GitHub Access Makes This Dangerous
The problem becomes more serious when an AI agent has access to sensitive development resources.
Depending on its permissions, an agent may be able to access:
- repository contents,
- GitHub tokens,
- pull requests,
- CI/CD systems,
- cloud credentials,
- deployment infrastructure,
- and internal documentation.
If an attacker can manipulate the agent’s instructions, the AI system could potentially become an intermediary between the attacker and privileged resources.
The attack chain could look like this:
malicious repository content → AI agent → privileged tool → sensitive data
The attacker does not necessarily need direct access to the secret.
They only need to influence the system that already has access to it.
Least Privilege Becomes Critical
This is another reason why AI agents should not receive broad permissions simply because they are convenient.
A coding agent that only needs to review source code should not automatically have permission to:
- access production credentials,
- modify deployment infrastructure,
- read unrelated private repositories,
- or retrieve secrets.
AI agents should receive the minimum permissions required for the specific task.
Sensitive operations should also require explicit authorization rather than relying entirely on the agent’s interpretation of repository content.

AI Coding Agents Are Becoming Part of the Attack Surface
The traditional software supply chain already includes source repositories, dependencies, CI/CD systems and build infrastructure.
AI coding agents add another component:
the AI decision-making layer.
That layer can interpret untrusted content and then interact with trusted systems.
This creates a new security boundary that developers and security teams need to understand.
The question is no longer simply:
„Is the code safe?”
It is also:
„What will the AI agent do after reading the code?”
As AI coding agents become more autonomous, protecting their identities, permissions and tool access may become just as important as protecting the repositories themselves.
Source: Security research on prompt injection against AI coding agents






