Spot a Compromised AI Coding Agent Before Production
A coding agent that already ran a hostile setup can push new instructions and use your tokens. These are the signs to check before it reaches production.
By Muhammad Saif and Aashan Khan · Techtribe co-founders
A compromised coding agent is a developer identity that is already doing someone else's work. The model does not have to be "hacked" in the cinematic sense. The product can read a repository, start a hook, and use the tokens already on the machine. By the time a deploy pipeline runs, the useful question is whether that identity is still only yours.
Bitdefender's November 17, 2026 report is the current reason to ask the question on a schedule. The lab write-up, How AI Agents Become New Targets in a GitHub Malware Campaign, describes repositories that persuade an assistant to run a setup script, and settings that can start the script when the folder is trusted. After that, the payload is built to steal credentials and to plant new agent instructions into repositories the victim can change. The file-by-file audit of AGENTS.md and CLAUDE.md is in how to audit those instruction files. This note is the period after a script may have run, and the gate you want in front of production while you find out.
The gate is a list of changes that should be impossible for a quiet laptop to make over a weekend: new instruction files on the default branch, new hooks, new workflow files, new deploy keys, and token use from a place your team does not recognize. None of those require you to reverse a loader. They show up in git, in the org audit log, and in the cloud trail you already pay for.
What "compromised" means for an agent
The agent is a process with the user's rights, plus whatever extra rights its tools were given. Compromise, for this purpose, means untrusted code or untrusted instructions have used those rights, or are in a position to use them on the next session. That includes a hook that has already executed, a rules file that will execute on the next open, and a token that was copied and has not been revoked.
It also includes a second hop that looks like your own automation. Bitdefender says the campaign can modify repositories and plant new AI-agent instructions. A commit authored by your developer, or co-authored by the coding agent, can be the delivery mechanism for the next developer. The git history looks internal. The instruction was not written by anyone on the team who would recognize it.
Production access is the line that turns this from a laptop cleanup into an outage or a data incident. Production access is any credential that can change the live system: a deploy key, a cloud role the CI job assumes, a Kubernetes config on the laptop, a database URL in an environment the agent can read, a GitHub environment secret used by the release workflow. If the compromised user can reach one of those, assume the attacker can too, until rotation proves otherwise. The permissions that make a normal agent dangerous are laid out in what Claude Code and Cursor can reach. A compromised agent uses the same doors. It does not need a new one.
A staging key that is actually the production key still counts. Teams label .env files more carefully than they separate the secrets inside them. If the value in the staging file opens the production account, the agent that read the file read production.
The moves that show up before a deploy
You are looking for the attacker using the developer's habits. The campaign's spread, as Bitdefender describes it, is repository edits and new instructions, plus credentials taken from the machine. Those leave ordinary traces.
Instruction files arriving without a human story. AGENTS.md, CLAUDE.md, .claude/settings.json, Cursor rules, and Copilot instruction files changed on a branch nobody was working on, or on several repositories in the same hour. The diff tells the agent to run a script, or not to display a file. That pattern is the audit in the companion post. Here, the detection point is the surprise: the people who own the repo do not recognize the change, and the commit is recent.
Hooks and workflow edits. A session-start hook is one line in a JSON file and it runs code. A GitHub Actions change can print secrets into a log or push a token to an endpoint the workflow did not call last week. Read workflow diffs the way you read application diffs. An agent that can push to the default branch can change the workflow that deploys the default branch. That is production access even when the application code is untouched.
Pushes from an agent identity. Many teams let Claude or Cursor commit, and some let CI bots push. In the Apiiro research on Claude Code settings, hundreds of public repositories had a commit listing Claude as a co-author on the settings file that held secrets. A co-author line is not proof of malware. It is a filter. Review agent-authored commits that touch settings, workflows, Dockerfiles, and infrastructure before they merge. A human can still be the one who clicked. The review is of the diff.
Tokens used from a new network. A GitHub personal access token, a cloud key, or a registry token that suddenly authenticates from a hosting provider you do not use is the loud version of theft. Audit logs are delayed and incomplete, and they are still the first place a second hop shows. Look at the window between "someone opened an untrusted repo" and now. If you do not know that window, use the date you first saw a bad instruction file, then go back at least to the clone.
New keys, new collaborators, new apps. Attackers who have a live token often create a key of their own so that rotation of the stolen one does not lock them out. A new deploy key, a new OAuth app, a new cloud access key, or a collaborator invite you did not send is persistence. Rotation that skips "what else was created" leaves the backdoor in place under a name your team has never seen.
Packages published or retagged. Bitdefender includes infecting software packages in the campaign's capability. A publish from CI, or a new version of an internal package you did not release, is in scope if the compromised user could publish. Check the registry audit log for the same window.
None of these signs require the payload to be unique. They are the things a stolen developer token is good for. A campaign that wants to spread through agent instructions will do several of them. A simpler theft will do the token part only. Either way the production gate is the same: no deploy from an identity you have not cleared.
A gate that runs before production, not after
Put the check on the path that ships, where a person still has to agree.
The release branch accepts commits from named humans and from CI identities you can list on one page. Agent co-authors can propose. They do not merge their own change to a workflow, a settings file, a Dockerfile, or an infrastructure directory. Branch protection that requires a review is the control. A bot that is the only required reviewer is the same as no reviewer, if the bot approves agent output by default.
CI credentials cannot do the next-worse thing. The job that runs tests does not hold the production deploy role. The job that deploys does not hold a token that can rewrite every repository in the org. A personal access token on a laptop is not the deploy credential. If today those are the same string, the gate does not exist yet. Split them before you debate detection rules.
Production systems do not trust a laptop that also opens arbitrary GitHub repos in an agent. That split is organizational and it is the one that fails in small teams, because the founder is the person with the cloud key and the person trying an example at midnight. Give the example-running environment a token that can read one sandbox repo. The production key stays in the cloud account's own secret store, assumed by CI, not exported into the shell the agent inherits.
Logs exist for git pushes to protected branches, for cloud API calls by the deploy role, and for registry publishes. Someone is named to look when an alert fires. An alert that pages nobody is a setting. The look can be small: a daily review of protected-branch pushes is enough for a team of ten, until the volume forces a narrower rule. The failure mode is a channel nobody owns.
Write the gate down as a release condition. "We can deploy" means the instruction files on the branch were reviewed, the workflow diff is empty or approved, and no uncleared credential incident is open for the identities on that pipeline. If any of the three is false, the deploy waits. A team that treats the wait as optional will skip it on the day it matters, which is the day a customer launch is already late.
What to check this week if agents already have production reach
- List every identity that can deploy: GitHub environments, cloud roles, cluster credentials, registry tokens, and the humans who can assume them from a laptop. Mark which of those humans run a coding agent, and which CI jobs start an agent with a token in the environment.
- Diff instruction files and hooks on the default branch of every repo that deploys, against the version from two weeks ago. Two weeks covers the public window around Bitdefender's November 17 post with a little margin. Anything you cannot explain is a stop.
- Pull org audit events for git pushes, new deploy keys, new OAuth apps, and invitation events in that same window. A burst of writes across repos by one user is the spread pattern. One write of
.claude/settings.jsonis enough to open that user's other repos. - Pull cloud trail, or the equivalent, for new access keys and for console or API use from networks you do not operate. Do this for the production account and for the account where CI lives, if they differ. Attackers move from the laptop's cloud key to the account, then create their own key.
- Check package registries and container registries the CI user can write to. A new tag on an image you did not build is a deploy, delayed until something pulls it.
- If any check fails, stop the production pipeline for that identity, rotate from a clean machine, and only then return to feature work. The order is in the key-exposure guide. Deleting a markdown file while the token still works leaves the pipeline available to whoever copied the token.
- After rotation, read the repos again. A token that was live may have pushed the instruction file back, or pushed it to a second repo, between your first reading and the revocation. The second reading is part of the incident, not a courtesy.
Record the time you revoked each credential and the last successful use before that time. Support conversations and customer notices get easier when the window is a pair of timestamps instead of "sometime this month."
What a laptop review looks like without a forensics team
You can learn a lot from files and logs a developer can collect without imaging the disk. Ask for a copy of the project's .claude directory, the user-level Claude and Cursor config, and a list of recent git commands. Compare hooks to a teammate's machine that did not clone the suspect repo. A command path you cannot find in the repository the team thinks it installed is a finding.
Ask when the folder was trusted. Editors record that decision in a workspace file or a user setting. The timestamp starts the window. Credentials used on that machine after the timestamp are the rotation list: GitHub tokens in the keychain and in gh, cloud profiles, npm or package-registry logins, SSH keys that authenticate to git or to servers, and any SaaS token that was in the environment because a deploy was tested locally.
Browser-stored sessions are the awkward part. A script running as the user can reach browser data on many setups. If the campaign write-up you are responding to includes browser theft, and Bitdefender's public description includes that class of credential, plan on signing the person out of the admin tools they use in that browser and requiring a fresh login. That is disruptive and it is cheaper than discovering a week later that the session cookie for the cloud console still worked.
Do this from a second machine when you can. Guiding the cleanup through the same agent that may be hooked is how the instructions get a vote.
What does not hold
A promise from the model that it "only ran the tests" does not hold. The instruction campaign is written so the agent does not display the script. A transcript can be incomplete because the hook never went through the model. Trust the process list, the file, and the audit log.
Antivirus on the laptop does not hold as your only signal. A script the developer ran on purpose, because the agent asked, is a process Node started. Many machines will record it as a normal node invocation. The distinctive part is which file, and whether that file was in a repo the team means to maintain. Hash checks help after a vendor publishes hashes. Behavior in git helps the same day.
Reinstalling the coding agent does not hold. The hook lives in the repository and often in the user's home directory. A fresh install of Claude Code or Cursor will read the same project settings and start the same command. Clean the settings, then reinstall if you want a clean binary. The order matters.
Waiting for a vendor bulletin that names your company does not hold. This class of incident starts from a public repo and a token you issued to yourself. GitHub, Anthropic, and Cursor may have nothing to notify you about. Your audit log is the notice.
"We would notice a production change" does not hold if the production change is a new cloud key that has not been used yet, or an instruction file that will fire the next time someone opens the repo. Dormant persistence is still persistence. Look for creation events, not only for damage.
How this connects to the way the team already ships
Teams that moved fast with generated code often have the agent, the deploy token, and the production project on one machine. That shape is common in the first months of a product. It is also the shape this campaign is built to tax. Separating "open experimental repos" from "ship the product" is a smaller change than rebuilding the product, and it removes the path from a malicious example to the live database.
If the experiment is the product, because the whole app was generated last month, the same separation still applies inside one repo. The agent that refactors the UI does not need the production database URL. The workflow that runs migrations does not need to start from a laptop hook. The review of generated apps for security issues in the code is a separate pass, covered across the vibe-coding security notes. A clean application can still be shipped by a dirty identity. Check the identity too.
MCP servers configured in the same repo are another path a planted instruction can call. Inventory them with the hooks. A server nobody added on purpose, started by a project file, is the same finding as a session-start script. The review steps for those servers are in MCP server security.
Tell the team what "stop" means in practice. Stop means the production workflow is paused, the suspect laptop is off the VPN, and a named person owns rotation. It does not mean everyone argues in Slack while the token stays valid. Write that down before you need it. Incidents go better when the first hour is a checklist the team has already seen.
A monthly pass that stays short
Once the first gate exists, keep it small enough to survive a busy month. On the first Monday, a named person checks three things: instruction-file diffs on deploy repos, new keys and new OAuth apps in the org, and cloud keys created outside the usual automation. The pass fits in an hour when nothing is wrong. When something is wrong, that hour becomes the start of the incident, which is what you want. A quarterly deep dive that nobody schedules will not catch a campaign that spreads in a day.
Rotate the human who does the pass. The point is that more than one person knows where the audit logs live. A single founder who is also the only one who can read CloudTrail is a single point of failure the moment their laptop is the one under review.
If this is your app, send the repo.
A 30-minute scope call. We read what is live, name what is dangerous, and quote a fixed scope.
How Techtribe checks an agent before it can ship
We map the identities that can change production, then we read the instruction files, hooks, and workflow diffs on those paths. You get a written gate: what may merge, which tokens have to be split before the next deploy, and which machines are waiting on rotation. If something has already run, the list of credentials to treat as burned comes first, from a machine that is not the one under suspicion.
A one-time pass fits a product that is about to go live, or a team that just found a repository it does not trust. A Dedicated Team fits when agents stay in CI and new services keep appearing, because the gate has to be re-checked as the token list grows. The code stays in your repo. The keys stay in your cloud.
Bring the deploy config, the repos CI can push to, and a straight answer about whether a laptop with production credentials has opened a third-party project in Claude Code or Cursor recently. That answer sets the order of the call. If you want the instruction files read line by line, start with the repository audit and send us the same repos.
The fixed scope for taking a generated app to production is a page per tool: Lovable, Bolt, v0, and Replit.
Questions
How can a coding agent be compromised without a new CVE?
The agent runs as the developer. A repository instruction file or a session-start hook can start a script with that developer's tokens, SSH keys, and cloud credentials. Bitdefender's November 17, 2026 write-up describes a campaign that then plants new instructions into other repositories those credentials can write.
What is the sign that should stop a production deploy?
An instruction file, hook, or workflow the team did not mean to add, especially one pushed by an agent account or by a developer whose laptop just opened an untrusted repo. Treat the deploy credentials on that path as exposed until someone has read the diff and rotated what the laptop could reach.
Will the agent tell us it was compromised?
Do not wait for that. The campaign Bitdefender describes tells the agent not to display the script it runs. Logs of git pushes, new hooks, and token use from an unfamiliar place are the record. A clean chat transcript only means the chat looked clean.
What should we bring to a review if we already deploy with an agent in CI?
The CI config, the token that job holds, the list of repos it can push to, and whether a developer laptop with production cloud keys has opened a third-party repo in the agent this month. Those four facts decide whether you are looking at a file cleanup or a credential incident.