Who can read the secrets in your coding agent's promptsEvery hop, what it keeps, and a test
Every system between your agent and the GPU can read the whole prompt, and a privacy flag binds only the first one. In November 2026, Dragos showed what that means in practice: planted AWS keys and URLs from about two million prompts surfaced at breached hosts, marketplace resellers and AI labs. This page maps the hops and gives you a test you can run this week.
-
01
Source
Agent context
The agent reads a key from a file or env and sends it with the prompt
your laptop -
02
Channel
Every hop
Router, reseller, host and lab each see the full request
flag binds hop one -
03
Exposure
Canary fires
A planted AWS key or URL gets used days or weeks later
the only proof you get
TL;DR· the answer, in twenty seconds
What happened: Dragos sent about two million prompts carrying unique AWS keys and URLs to AI services from July to November 2026. The canaries fired from three breached hosting providers, from marketplace resellers who logged requests, and from AI labs that scraped prompts marked for zero data retention.
The minimum fix: List every base URL your agents use, pin the upstream provider and turn off router fallbacks, and plant one unique canary credential per route in a file the agent reads. Treat any use of it as an incident.
The lesson: A prompt is a copy of whatever the agent could read, and you cannot audit the hops it passes through. Keep real credentials out of what the agent can read, and use canaries to find out which route leaks.
A coding agent's prompt holds whatever the agent read on the way to its next answer: source, terminal output, a .env it opened, the token it found in a shell profile. That prompt then passes through a chain of companies you cannot see. On November 19, 2026, Dragos published a large measurement of what happens to it there: people copy it, keep it and use what is inside.
This page is a reference for that path. It covers what the study found and where its limits are, every hop a prompt can cross and what each one can see, what zero data retention settings bind, how to list the routes your agents use, and how to plant a canary that tells you which route leaks.
What two million planted secrets showed
HD Moore and the Dragos research team sent about two million prompts to common AI services between July and November 2026. Each prompt carried unique URLs and credentials that no legitimate system would ever touch. They started with Thinkst Canarytokens, then built a service that derives a unique hostname, URL and set of credentials for every prompt and runs the DNS, web, git, SSH, database and mail endpoints behind them. The AWS keys were real keys on empty accounts with full logging. Any contact maps back to one prompt, model, router and privacy setting.
Three kinds of leak came back.
Breached hosting providers. Attackers were stealing requests from three providers, the earliest from mid-July, and none of the three knew until Dragos told them. In the largest case, a couple hundred AWS keys went to one provider in a few windows in late October, one key per request, and the attacker stole every request in those windows. Some came from requests the provider rejected before any model ran, which puts the copying at the provider's front door. In the other two breaches, some stolen requests carried the ZDR flag. The attacker tested keys within hours in some cases, listed S3 buckets, searched Secrets Manager and Parameter Store, then tried to enable Bedrock models, mint Bedrock API keys and add IAM users. One key seeded on October 21 was first used the next day and was still in use three weeks later. On November 1 the same attacker added ARTEX, an LLM-driven pentest framework, whose user agents artex-agent and artex-judge-r121 appeared in no public indicator list Dragos could find.
Marketplace resellers. On an inference marketplace, the cheapest seller gets the request. Dragos caught sellers who listed a model at the lowest price, turned on request logging and waited. Two prompts sent through one seller had both secret URLs opened about a day and a half later from a home broadband line, followed by username guessing at the login page. The same model through a different seller stayed quiet, so the leak followed the seller. Someone on a Mac in France took passwords from two prompts and tried them as root over SSH by hand, four times in two minutes. One of the keys that Mac tested had gone to a different router, which turned out to forward some traffic to the marketplace without saying so.
Labs that ignored privacy settings. A Chinese AI lab's systems fetched the secret URLs from more than half the prompts sent to its models between July and October, including about two-thirds of the requests marked "no data collection" or ZDR, two or three days after each request. U.S. hosts that resell the lab's models triggered the same scraper. One large U.S. provider crawled a secret URL more than two months after a single call to its search endpoint. One secret link from a ZDR-flagged prompt turned up in a Feishu chat 24 days after the request. Within two minutes, someone opened it from three desktops and three phones in Beijing and Shanghai.
The limits matter for how you use this. Dragos names none of the breached providers, the lab or the sellers. It traced about two thousand routes, and several hundred of them included a system it could not identify, so the study cannot always say which hop leaked. It is one team's dataset, and the post ends with a runZero trial offer. The r/netsec discussion on November 21 split between readers who took it as an indictment of model providers and readers who saw a router problem. The post supports a narrower reading than either: hosting providers, resellers and some labs leaked, and you could not tell which from the client side.
The finding lines up with a wider count. Aikido's review of 50 AI incidents disclosed in 2026 through November 19 found exposed secrets were the most common stated root cause, and 35 of the 44 incidents with a stated cause had more than one failure point.
Every hop between your agent and the GPU
Dragos puts the rule in one line: "every hop can see the entire prompt and response." The table lists the hops a coding agent's request can cross, in order. Most setups skip some of them.
| Hop | Examples | What it sees | What governs it | What the Dragos data showed |
|---|---|---|---|---|
| Agent harness on your machine | Claude Code, Codex, Cursor, plugins and hooks | Every file and command output the agent read | Your OS user account | Not measured; the source of every secret in the prompt |
| Your own gateway or proxy | LiteLLM, an internal Claude Code gateway | Full request and response, plus its own logs | Your config and retention | Not measured |
| Router | A single endpoint that forwards to a pool of hosts | Full request and response | Its privacy policy and your routing settings | A router forwarded traffic to a marketplace it did not disclose |
| Marketplace seller | The lowest-priced listing for a model | Full request and response, through platform logging | Whatever the seller does with its logs | Sellers opened secret URLs and tried stolen passwords |
| Hosting provider | A company running open-weight or resold models | Full request at the front door | Its contract, and whether it is breached | Three providers breached; ZDR-flagged requests stolen |
| Model lab | The company whose model you picked | Prompts routed to its models, even through resellers | Its policy and data-sharing agreements | One lab scraped URLs from ZDR and no-collection prompts |
| Tools the model calls | Web search or fetch plugins on the router | The query and often the page content | That tool's own policy | One provider crawled a URL two months after a search call |
Three rows deserve a second look. The router and marketplace rows are where your choice of upstream stops being yours. Dragos found one seller adding about a thousand hidden tokens to every prompt and another fetching images through a shared consumer subscription, and neither appears on the advertised route. The last row is easy to forget: OpenRouter's ZDR docs state that ZDR enforcement applies to provider routing for inference, and not to plugins and tools such as web search, which third parties may operate under their own retention rules.
The first row sets the ceiling for all the others. No hop downstream can leak a key the agent never read. Dragos makes the same point in its advice section: "AI agents will happily send whatever they can read, including credentials."
What a zero data retention flag binds
ZDR is a promise from one company about its own storage. It does not travel with the prompt. Dragos: "a privacy flag only binds the first hop." Three facts from the vendors' own docs set out how narrow the promise is.
At Anthropic, ZDR is an arrangement per organization that the sales team enables. Under it, Anthropic does not store prompts or responses at rest after the response returns. Anthropic's retention page says it covers Claude Code used with API keys from a Commercial organization. It excludes Claude Free, Pro, Max and Ultra plans, including Claude Code on those plans. It excludes third-party integrations. Some current models, including the Fable 5 and Mythos 5 families, require 30-day retention and are not available under ZDR unless Anthropic authorizes it. If your developers run Claude Code on a personal Max plan, no ZDR arrangement covers those sessions.
At OpenRouter, the provider routing docs give two separate request fields. data_collection: "deny" routes only to endpoints that do not train on your data, and those endpoints may still retain prompts. zdr: true routes only to ZDR endpoints and fails the request if none qualifies. There is also a middle tier, Safety Retention, where a provider may keep any request to detect abuse. Self-serve accounts that enforce ZDR allow Safety Retention unless you choose "ZDR only". OpenRouter also announced in-flight screening of all traffic, ZDR included, for child sexual abuse material from October 27, 2026, with flagged content retained for review.
The marketplace case defeats all of this. When the seller is the hop that logs, the flag you set on the router decides which sellers qualify, and it cannot stop a qualifying seller from logging. Dragos found lab scraping on two-thirds of requests that carried a ZDR or no-collection flag. Treat the flag as a contract term you can cite after an incident. It does not keep a secret in the prompt safe.
The strictest OpenRouter routing block the docs support names the upstream, refuses fallbacks and requires ZDR. Add it to each request body:
{
"provider": {
"only": ["anthropic"],
"allow_fallbacks": false,
"zdr": true,
"data_collection": "deny"
}
}
With allow_fallbacks off, a request that cannot reach the named provider fails instead of drifting to whoever is cheapest. That is the behavior you want for agent traffic. Dragos's advice for routers is the same: pick the upstream yourself, then verify that the setting changes where the request goes.
List every route your agents use today
Ask which company served the request that held your staging key. Start with the client side, where most of the answer sits in a config file. These commands read config and print base URLs. They hide key values and change nothing.
# Claude Code: user and project settings
grep -rn -E 'ANTHROPIC_(BASE_URL|BEDROCK_BASE_URL|VERTEX_BASE_URL)|allowedProviders|apiKeyHelper' \
~/.claude/settings*.json .claude/settings*.json 2>/dev/null
# Codex: user config and profiles (project .codex/config.toml cannot set these)
grep -n -E 'openai_base_url|model_provider|base_url' \
~/.codex/config.toml ~/.codex/*.config.toml 2>/dev/null
# Shell environment: show base URLs, hide keys
env | grep -E '_BASE_URL='
env | grep -E '^(OPENROUTER_API_KEY|ANTHROPIC_AUTH_TOKEN|ANTHROPIC_API_KEY|OPENAI_API_KEY)=' \
| sed 's/=.*/=<set>/'
# Which hosts are agent processes talking to right now?
lsof -nP -iTCP -sTCP:ESTABLISHED 2>/dev/null | grep -iE '^(claude|codex|node|cursor)' \
| awk '{print $1, $9}' | sort -u
Read the output this way:
- Every base URL should map to a provider you have a contract with or a gateway your team runs. A router or reseller you cannot name is the Dragos marketplace case. Symantec's relay report from October found one-line setup scripts that rewrote these values on developer machines, so check machines you did not set up yourself.
- A router key in the environment is a route, even when no config file names it. Find which tool uses it and what its routing settings are.
- Codex ignores
openai_base_url,model_providerandmodel_providersin a repository's.codex/config.tomland prints a warning, per the Codex config docs. A cloned repository cannot reroute Codex that way, so look in the user config. - The connection list catches what the config misses, such as a plugin with its own endpoint. Compare it against the providers you expect.
On managed Claude Code machines you can turn the inventory into a rule. The gateway docs describe setting allowedProviders to ["customEndpoint"] in managed settings, with the gateway's ANTHROPIC_BASE_URL in that file's env block. Claude Code then refuses any session pointed elsewhere, including Anthropic direct or a developer's own proxy. It needs Claude Code v2.1.285 or later. Do the matching thing for Codex by owning ~/.codex/config.toml through your device management.
Pinning the endpoint closes the client side. The server side stays out of view. Your gateway forwards to a provider, and you rely on that provider's contract and its security. Dragos calls one first-tier provider with one contract "the smallest exposure you can buy," and self-hosting the only option where nobody else reads the prompt. It lists hardware from $6,950 for a DGX Spark to $570,000 or more for an eight-GPU B300 server, and says that for most teams self-hosting only makes sense for the most sensitive work.
Plant a canary in what your agent reads
You cannot audit a router's logs or a lab's scraper. You can plant something only a leak would use. Dragos's last recommendation is to add a fake credential to the context your agents already send and treat any use of it as an incident. You do not need their infrastructure. A free AWS key token from Thinkst Canarytokens alerts when anyone calls the AWS API with it, though the alert can lag 2 to 30 minutes behind the call because it passes through Amazon's logging.
The design rule from the study is one token per route. A token that fires tells you only that someone saw the place you put it. If one key sits in a file that three agents send to three providers, a hit tells you almost nothing.
- Make one AWS key token per route: one for Claude Code to Anthropic direct, one for the router, one for each gateway. Put the route name in the token's comment.
- Put each token where the agent on that route will read it and nothing else will. A gitignored file in the working tree works, for example
ops/legacy-billing.envwith anAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYpair. Do not commit it. A public repository brings in GitHub scanners and secret-hunting bots, and a hit from them would tell you nothing about the inference path. - Make sure the token reaches the prompt. Ask the agent on that route to review the file once, the way it would during normal work. The token is now in that provider's request stream and in your local transcript.
- Add an HTTP token for the route as well. Dragos's route tracing began with an image URL in the request, and an HTTP canary records the IP, client and time of anything that fetches it. That catches scrapers that never try a credential.
- When a token fires, write down the time, source IP and user agent, and match them to the route. If you run AWS, search your CloudTrail for
artex-agentandartex-judge-r121while you are there. Then rotate every real credential that has ever passed through the same route, because the canary proves the route leaks, not that it leaked only the canary.
You may see nothing for weeks, and that result has limits. Dragos's July tokens are still firing, and one scraper showed up two months after a request. A quiet canary is weak evidence that a route is clean. A loud one is strong evidence that it is not.
Related reading on this site: the instruction files reference lists the config files that set these routes, coding agent attacks outside the model covers the relay and gateway attacks from October, and the leaked-secret runbook covers what to do once a canary or a real key fires.
What this means for your stack
This week, run the route inventory on one machine, then turn off router fallbacks and pin the upstream for agent traffic. Plant one AWS key canary per route in a gitignored file the agent reads, and write down who gets paged when it fires.
The structural fix is to keep real credentials out of the prompt. The agent should run commands that use a secret without ever reading the secret, so the prompt carries a reference or a redacted value and no hop downstream can copy the key. That means credentials injected into the child process at run time, scoped to the command, with output redacted before it returns to the model.
hasp is one working implementation of that pattern. Install with curl -fsSL https://gethasp.com/install.sh | sh, run hasp setup, connect a project, and the agent runs commands that receive secrets at runtime instead of reading them from files. Source-available (FCL-1.0), local-first, macOS and Linux, no account.
You will not get a full map of who reads your prompts. Dragos traced two thousand routes and still found hundreds of hops it could not name. Plan on the assumption that every prompt is a copy someone may keep, and make sure the copy holds nothing an attacker can use.
Sources· cited above, in one place
- Dragos (HD Moore) Three breaches, endless leaks: Your AI supply chain needs canaries
- r/netsec Researchers planted secrets in 2 million AI inference requests (discussion)
- Aikido AI incidents of 2026: Rogue agents, stolen keys, and other familiar stories
- OpenRouter Zero Data Retention: data policy tiers and enforcement
- OpenRouter Provider routing: only, allow_fallbacks, zdr and data_collection
- Anthropic API and data retention, including zero data retention coverage
- Anthropic Claude Code: other LLM gateways and allowedProviders
- OpenAI Codex advanced configuration: project layers, trust and ignored project keys
- Thinkst Canarytokens AWS API Keys Canarytoken
- Symantec Threat Hunter Team Sandbox flipped to danger-full-access: unauthorized AI relays create risk for organizations
Stop handing the agent your real keys.
hasp keeps secrets in one local encrypted vault, brokers them into the child process at exec, and never lets the agent read the value.
- Local, encrypted vault — no account, no cloud, no telemetry by default.
- Brokered run — agent gets a reference, the child process gets the value.
- Pre-commit + pre-push hooks catch managed values before they ship.
- Append-only HMAC audit log answers "did the agent touch the prod token?" in seconds.
macOS & Linux. Source-available (FCL-1.0, converts to Apache 2.0). No account.