All writing

6 min read

Your AI Coding Assistant Is Part of Your Attack Surface

AI coding assistants can expose session tokens, API keys, and developer data. Understand the risks and how to secure your AI development tools.

Your AI Coding Assistant Is Part of Your Attack Surface

AI coding assistants have become part of our everyday development workflow.

We use them to write code, debug issues, understand repositories, generate tests, connect APIs, and even execute commands.

Tools like Cursor, Claude Code, ChatGPT Desktop, and Codex are becoming increasingly integrated into how we build software.

But there is something developers often overlook.

Every tool that has access to your code, credentials, files, or development environment can also become a potential target for attackers.

And AI coding assistants are no exception.

AI Assistants Are Becoming Attractive Targets#

Traditionally, attackers looked for browser passwords, authentication cookies, SSH keys, Git credentials, and cloud access tokens.

Now, AI application credentials are becoming another target.

In October 2026, Check Point Research published findings about an information stealer called Aokigahara.

What makes this malware interesting is that it doesn't only target traditional credentials.

It specifically searches for authentication files, session data, and configuration files associated with AI applications, including:

  • Claude and Claude Desktop
  • ChatGPT Desktop
  • OpenAI Codex
  • Cursor
  • Windsurf
  • GitHub Copilot
  • Gemini CLI

It also targets Git credentials, SSH-related files, and cloud configurations associated with AWS, Azure, and Google Cloud.

The malware collects the available information and sends it to an attacker-controlled server.

Symantec's Threat Hunter Team also reported on this malware family under the name Aoki, documenting its collection of AI application credentials and session information.

This tells us something important.

Attackers are no longer interested only in the accounts we use. They're also interested in the tools we use to build software.

Check Point Research: Infostealers Are Targeting AI (opens in a new tab)

Symantec: Aoki Infostealer Targets AI Coding Assistant Credentials (opens in a new tab)

1. Stolen AI Sessions Can Be More Valuable Than You Think#

Let's understand a simple scenario.

You use an AI coding assistant every day. You have already logged in, connected your account, and started working on multiple projects.

Your conversations might contain:

  • Source code and architecture discussions.
  • Database schemas and API structures.
  • Debugging information.
  • Internal project details.
  • Configuration examples.
  • Occasionally, sensitive information shared during development.

Now imagine your computer gets infected with an information stealer.

The malware searches for locally stored application data, including authentication and session information.

If it successfully steals a valid session token or authentication cookie, an attacker may be able to access the associated account without going through the normal login process.

That could expose conversations, uploaded files, project context, or other information available to the compromised account.

The exact impact depends on the application, the stolen credential, its permissions, and whether the session is still valid.

This is why session data should be treated with the same seriousness as passwords.

Being logged in doesn't mean your account is safe if someone can steal the session that keeps you logged in.

2. Your API Keys Can Become Someone Else's Access#

Another major risk is exposed API keys.

Developers frequently store API keys in:

  • .env files
  • Configuration files
  • Local development environments
  • Project repositories
  • AI tool configurations
  • MCP server configurations

These keys are useful because they allow applications to communicate with external services.

But if an attacker gets hold of them, the consequences can be significant.

For example, a stolen AI API key could allow someone to:

  • Make API requests using your account.
  • Consume your available credits.
  • Generate unexpected usage costs.
  • Access resources permitted by the key.
  • Abuse connected services, depending on its permissions.

And AI isn't the only concern.

A developer's machine may also contain GitHub tokens, SSH keys, cloud credentials, and database access information.

A compromised machine can therefore expose much more than one AI account.

Google's Threat Intelligence Group has also reported increasing interest in stolen AI accounts and developer configurations, including configurations that can contain plaintext API keys.

Google Cloud: The Evolution of Adversarial AI (opens in a new tab)

3. Attackers Can Abuse the AI Assistant Itself#

Credential theft isn't the only way attackers can target AI coding tools.

Another interesting attack vector is prompt injection.

Imagine you clone a repository from GitHub.

It looks like a normal project. You open it in your IDE and ask your AI assistant to understand the codebase.

But somewhere inside the repository, there is malicious content.

It could be hidden in a README, an issue description, a source file, or an instruction that the assistant processes.

The content attempts to manipulate the AI into performing actions that benefit the attacker.

For example, it might try to convince the assistant to:

  • Read sensitive environment variables.
  • Access files outside the intended task.
  • Execute an unexpected command.
  • Send information to an external destination.
  • Use available credentials in an unintended way.

This is known as indirect prompt injection.

The important distinction is that the malicious instruction doesn't necessarily come directly from the developer. It can arrive through content the developer asks the AI to inspect.

Research by Check Point demonstrated vulnerabilities in Claude Code involving malicious project configurations, hooks, and MCP server settings. Under affected conditions, opening an untrusted repository could lead to command execution and API credential exposure.

These specific vulnerabilities were disclosed to Anthropic and subsequently remediated. They illustrate why project configuration and AI tool permissions deserve careful security review.

Check Point Research: RCE and API Token Exfiltration Through Claude Code Project Files (opens in a new tab)

4. Your AI Tool's Configuration Is Also Part of the Attack Surface#

We often think of configuration files as harmless settings.

For AI coding assistants, they can control much more.

They may define:

  • Which tools the assistant can access.
  • Which commands it can execute.
  • Which MCP servers it connects to.
  • What instructions it follows.
  • Which environment variables are available.
  • What actions run automatically.

This creates another potential attack path.

A malicious project configuration or modified AI assistant settings file could introduce unwanted commands or change how the assistant behaves.

Tenable's July 2026 research described attacks targeting AI agent configuration files, including hooks and project instruction files. It documented malware modifying these configurations to establish persistence across future AI coding sessions.

Think about that for a moment.

You might clean up a suspicious file or close an infected project, but a modified configuration could cause unwanted behaviour the next time your AI assistant starts.

T enable: How Attackers Are Targeting the Developer Agent Harness (opens in a new tab)

5. How Can Developers Protect Themselves?#

The answer isn't to stop using AI coding assistants.

These tools provide real productivity benefits. The goal is to use them without giving them unnecessary access to sensitive resources.

Here are some practices worth following.

1. Protect your session data

Treat local AI authentication files, session cookies, and tokens as sensitive credentials. Keep your machine protected, use trusted software, and avoid sharing application data directories.

2. Never expose API keys

Keep secrets out of source code and public repositories. Use environment variables or a secrets manager, and rotate keys if exposure is suspected.

3. Review permissions before granting access

Don't automatically allow an AI assistant to execute every command, access every directory, or connect to every external service.

4. Be careful with untrusted repositories

Review project configurations, hooks, scripts, and MCP server definitions before allowing an AI tool to interact with an unfamiliar repository.

5. Limit MCP server permissions

Only connect MCP servers you trust. Give them access to the resources they actually need rather than granting broad permissions.

6. Monitor API usage

Unexpected API consumption, unusual authentication activity, or unfamiliar account sessions can be early indicators of compromised credentials.

7. Keep your tools updated

Security vulnerabilities are regularly discovered and patched. Keep your IDEs, AI assistants, extensions, and development dependencies updated.

If you suspect a compromise, revoke affected sessions, rotate exposed API keys and other credentials, and investigate the device before trusting it again.

The Bigger Picture#

AI coding assistants are changing how software gets built.

They can read repositories, interact with tools, execute commands, access files, and connect to external services.

That makes them much more than simple chat interfaces.

They are becoming part of the development environment itself.

And wherever there is access, there is a responsibility to secure it.

We spend a lot of time discussing how AI can make developers faster and more productive. We should spend just as much time understanding the security implications of giving these tools access to our systems.

Because your code repository isn't the only valuable thing on your development machine anymore.

Your AI sessions, API keys, configuration files, and connected services are valuable too.

The next time you install an AI coding assistant, don't just ask what it can do for your development workflow. Ask what someone else could do if they gained access to it.

Related writing

All writing