Will an AI Coding Agent Leak Your API Keys? | KAIHE AIBOX
Short answer: yes, and it has happened. The risk is rarely how smart the AI is; it is that you hand it a credential that opens a private repository, and one action from the agent writes that credential into public code. On November 21, 2026, Together AI disclosed exactly this. An AI coding agent, while developing a public repository, committed a credential that gave access to a private Hugging Face repository. An unauthorized party used it to download stored prompt samples and then searched those samples for credentials to other services. So the useful question is not "should I use AI to write code," but "in what form did I hand over the credentials?"
One: what actually happened at Together AI
📖 Glossary
AI Box (also known as Agent Computer / Agent PC), is a dedicated local hardware device that runs AI Agents. Pre-installed with an AI agent management system, plug-and-play, running 24/7. Users can remotely command AI to work via Discord, Slack, Telegram, WhatsApp, and more.
The company's own disclosure lays out a clear timeline.
For routine software testing, Together AI collected a set of prompt samples authorized for that use and stored them in a private Hugging Face repository. The samples came from requests to its serverless inference service in June and July 2026, covering MiniMax M3, GLM-5.2 and Kimi K2.6, mostly on four dates: June 24, July 4, July 8 and July 14.
The problem arose while developing a public GitHub repository called xorl: an AI coding agent committed a credential that happened to open that private Hugging Face repository.
The company says automated scanning detected the exposed credential and it reverted the commit. But during the exposure window, an unauthorized party obtained the credential and downloaded the samples.
Two: the part worth noticing is what came next

Downloading samples was not the end.
According to the disclosure, the party then searched those prompt samples for credentials to other services and tested whether they worked. Five of the credentials tested were canary credentials from a Dragos security experiment, planted specifically to catch attackers.
That detail is the crux of the whole incident: a prompt sample may not be worth much on its own. But if other keys are sitting inside it, it becomes a way to open more doors. The leak escalated from "some text" into "a chain of credential risk" at exactly that step.
The company also stated that it has no reason to believe the data was leaked further and understands it has now been deleted; that it engaged an external forensic firm and law enforcement; and that its review of the affected prompt contents, including whether sensitive personal information was exposed, is ongoing, with direct notice to affected customers as needed. All of that should be read plainly: this was neither a large-scale loss of control nor a non-event.
Three: the judgment you can actually use
The value of this story for ordinary users and teams is not in watching a company's accident. It is that it puts three pieces of common sense on the table, and they line up with the remediation Together AI published.
First, make credentials hard to take. The company's first change was to use scoped or short-lived credentials, and keyless access where supported. In plain terms: a key that opens one door and expires is far safer than a master key that works forever.
Second, check before it goes out. Its second change was to check all pull requests for credentials. Letting AI write code is fine, but what it submits should pass a scan for "did it write a key in here" before it is merged.
Third, be able to stop the bleeding. The company made zero data retention, or ZDR, the default for new accounts, and advised customers handling sensitive prompt data to enable it. The less you retain, the less can leak.
Those three, plus updating its development processes for AI coding agents, are the entire published remediation. Notice that none of them says "stop using AI." They all say "manage the keys properly while you use it."
Four: an honest boundary, and it is not only a cloud problem

Someone will say this is a story about a cloud inference service and has nothing to do with using an AI assistant locally.
The same logic applies to a person. When you let an AI assistant connect to your email, your cloud drive and your payment tools, do you not also hand over a password or an API Key? Once those credentials can be invoked and written somewhere, the nature of the risk is the same category as this incident.
Two things are worth stating. First, running locally is not the same as being automatically safe. Keeping data on your own machine solves the "data leaving the building" problem; it does not solve the "how do I hand a credential to an AI" problem. Second, this is a matter of degree. Letting an assistant organize notes and read documents is a very different grant of authority from letting it touch your accounts and keys.
Five: when to ignore this, and when to take it seriously
If you only use AI for formulas, copy edits and lookups, with no accounts or keys involved: this incident is far from you. Knowing the gist is enough.
If you let AI connect to your accounts, read your email and touch your files, especially with an API Key or password: then how you hand over credentials deserves real thought. If you can give it a credential limited in scope, in lifetime and in what it is allowed to do, do that instead of the one that opens everything.
For ordinary users who need this, a good fit is KAIHE AIBOX(铠盒AIBOX), a dedicated computer for agents and a local personal AI assistant. Its Key Vault is built for exactly this. Passwords, API Keys and secrets are stored locally. When an agent needs one, it requests it from the vault, and you can limit the number of uses, the validity period and the interface scope. The agent receives the ability to use the credential without ever learning the real password. In plain terms: grant read access without transfer access, grant mail-reading without mail-sending. The key stays in your hand; the AI only gets permission to use it. Inference runs on cloud models, while this local box handles the credentials and the authorization itself.
One line to close: whether an AI will leak your keys often depends on which key you gave it — a master key, or one that is limited in time and place and void when used.