API key leaks and prevention

What the Together AI prompt leak says about coding-agent access

A public commit exposed a private repository credential. Keep coding agents away from credentials that can read production data and rotate secrets at the issuer when exposure is detected.

What Together AI reported

In its 21 November 2026 disclosure, Together AI said an unauthorised party downloaded stored samples from a subset of serverless inference requests made in June and July. The credential opened a private repository that held those samples. The company said scanning detected the exposed credential and the commit was reverted.

The disclosure covers the stored samples in that repository. The exposed credential gave access to the prompt data those samples contained.

“an AI coding agent committed a credential that provided access to the private Hugging Face repository”

Together AI security disclosure, 21 November 2026

Limit what one credential can reach

A token with access to fixtures can sometimes access customer-derived samples too. A developer needs to inspect code and run tests. Most tests can run with synthetic fixtures or with access to a dedicated test project.

Store production or sampling access under a different identity and make it unavailable to the coding agent's environment. Keep production values outside starter configurations, documentation and examples. Audit the entitlements behind each credential, since the visible variable name alone says little about what the key can do.

  1. List the files, tool responses, environment variables and stored logs accessible from a normal agent session.
  2. Separate test and production credentials. Use a short-lived, narrowly scoped credential when a test genuinely needs remote access.
  3. Scan both repository changes and the artefacts your CI publishes. Give each alert an owner and a rotation procedure at the service that issued the key.
  4. Test each boundary in a sandbox with a fake secret. A test passes when the agent can finish its task and the fake production credential is absent from the diff, console output and tool results.

Where request masking helps

A supported client routed through Spendplane can mask detected secrets before sending model requests. Code review, repository scanning, credential permissions, and decisions about whether to store prompts each cover a different part of this incident chain.

References

Practical guides