Treat anything you put in a prompt as something a provider, reseller or attacker can read: keep real keys, passwords and customer data out of prompts

Dragos planted canary keys in about two million AI prompts and caught attackers inside three AI hosting providers · Security incident · Dragos blog · DragosInc · Nov 19, 2026

What happened

On 19 Nov 2026 Dragos published research in which it sent about two million prompts carrying unique canary URLs and AWS keys to widely used AI services between July and November 2026. Data from at least three hosting providers was stolen, and none of them knew until Dragos told them. In the largest case a couple hundred bait AWS keys were taken, including from requests the provider rejected before a model ran. Attackers tested keys within hours, listed S3 buckets, searched Secrets Manager and Parameter Store, and tried to enable Bedrock models and add their own IAM users. Some stolen requests were marked zero data retention. Dragos also saw marketplace resellers logging prompts and providers not honouring privacy settings.

How to prevent it

Never put live credentials in prompts or agent context; if a secret must pass through an AI call, use a short-lived scoped token and rotate it after. Pin trusted providers where your router allows it, and set billing and CloudTrail alerts so a stolen key shows up fast.

Fix prompt for your own AI tool

Copy this into your own AI tool (Cursor, Lovable, Claude Code, Bolt…). It's general guidance written by us. Review what the AI suggests before applying it.

I'm a beginner and want to make sure my API keys are safe in my OpenRouter project. 1) Search the code for hardcoded keys or tokens and for secrets in variables that ship to the browser (NEXT_PUBLIC_, VITE_, REACT_APP_). List the file and line, but don't print the values. 2) For each one, tell me whether it's meant to be public (like a Supabase anon key) or secret. 3) For secret ones, show me how to move them to server-side env vars and call the provider through a server route. 4) Give me the steps to rotate each exposed key in the provider's dashboard and set a spending limit. 5) Make sure .env is in .gitignore and in my AI tool's ignore file. Don't change anything until I've approved your plan. Never ask me to paste API keys, passwords or .env contents; tell me where to check them myself.

Why this keeps happening: leaked secrets & api keys

Secret keys placed in front-end code, mobile bundles or public repositories can be found by automated scanners and abused, often running up large bills on AI or cloud accounts before anyone notices.

A quick checklist before you ship

More on this: every leaked secrets & api keys story and our related guide.

Tools involved

OpenRouter stories, AWS stories

Related stories

Source: original post on Dragos blog ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.

The Honest Build. Real stories, not hype.

Every week: real stories of what building with AI actually took, the one lesson worth keeping, and the security slip-ups to avoid. Free, unsubscribe anytime. Weekly, every Friday.