Breakdown: an AI hacking agent spent two weeks hunting Perplexity for AI keys, and at another company it found a live credential in deleted git history
By Abbi Labs · Published 3 December 2026
The agent started by reading JavaScript bundles. Check yours first.
The Abbi Labs quick check opens your live, public site as a signed-out visitor and looks for secret-looking keys in its JavaScript (OpenAI, Anthropic, Stripe, AWS, Supabase service_role and others), exposed .env and .git files, and Supabase tables readable with your public key. It doesn't read your git history or test your link-fetching features, so do those checks below yourself. No sign-up.
No app handy?
Example result · our deliberately broken demo app
6 issues found: 3 critical, 1 high, 1 medium, 1 low
- Critical: Stripe live secret key in public JavaScript
- Critical: /.env file readable by anyone
- High: Git repository exposed (/.git/HEAD)
The demo's problems are planted on purpose. Paste your own URL above to see yours.
No sign-up. Read-only public-resource and protocol metadata checks. No model prompts or tool execution. Scan only sites you own or are allowed to test.
Run on every deploy or use from Cursor / Claude Code via MCP →
Weekly AI-app security checklist
One short email a week: a practical check for apps built with Supabase, Next.js and AI tools (RLS, leaked keys, headers and more). Unsubscribe anytime.
Somebody gave a set of AI coding agents one goal: get a key that can call two of the newest frontier models on Amazon Bedrock. Then they let the agents run.
For about two weeks from late October, those agents went at Perplexity. Throwaway sign-ups, around 290 proxy addresses, 48,000 requests in 13 minutes at the peak, and a long list of tricks to make Perplexity's servers fetch AWS's internal metadata address. Perplexity says none of it worked.
Then Perplexity found the attacker's own server sitting open on the internet, and inside it, live workspaces for two other companies. At one, the agent had found a live customer credential in deleted git history and used it to take over that customer's workspace.
Everything below comes from Perplexity's report unless I say otherwise. Where something isn't confirmed, I say so.
What happened
- The setup. The attacker used Cairn, an open-source harness that breaks a goal into tasks and hands them to workers. Per the recovered logs, the workers were CLI coding agents running in a Kali Linux container with shell, network and a headless browser.
- The goal. Every workspace had the same one: an AWS key pair or Bedrock token that can invoke two specific frontier models. The operator's prompt asked for keys with broad permissions and told the agent to sweep every Bedrock region.
- Against Perplexity (24 October to 8 November, UTC): server-side request forgery (SSRF) attempts on features that fetch links people paste in, aimed at the cloud metadata address
169.254.169.254in decimal and hex forms, broken URLs, redirect chains and DNS-rebinding domains. 3,681 failed storage lookups for paths like.env.production,.aws/credentialsandstate.tfstate. Sweeps of 28,000 guessed API routes. Requests for other users' threads and files. Admin endpoints. More than 40 disposable-email accounts, rotated whenever a rate limit hit. - The result at Perplexity. Every attempt was blocked or returned nothing, Perplexity says. No internal services, customer data or platform secrets.
- The attacker's mistake. Callback probes pointed to one server. Perplexity scanned it: 207 open ports and 29 unauthenticated directory listings with more than 10,000 files, including the agents' working folders.
- Company A. The agent found a live customer OAuth credential in deleted git history, took admin control of that customer's workspace, ran code on its compute, reached internal endpoints, grabbed a stored Git token and got short-lived AWS credentials. Those couldn't call Bedrock.
- Company B. It logged into an exposed management API on a demo environment, left a command runner that called home about 1,000 times in 15 hours, and collected password stores, Kubernetes secrets and AWS instance credentials. Its attempts to use Company B's Bedrock proxy were rejected.
- Disclosure. Perplexity told both companies on 4 November, while the intrusions were still running.
How the agent looked for keys
This is the part worth reading slowly, because none of it is exotic. Per the recovered task logs, the agent:
- listed hostnames from certificate-transparency logs and passive DNS, pulled old pages from Wayback and Common Crawl, and tried
-stagingand-testingvariants of names it found - loaded sites in a real browser to grab JavaScript bundles and API schemas when plain requests were blocked
- searched public code, then scanned repositories, Gists, full commit history and even unreachable git objects with tools like gitleaks. One task queued 4,328 forks of ten public repos for full-history scans
- unpacked published npm and PyPI packages, container images, Hugging Face repos, desktop installers and mobile app builds
- only tested complete credentials, like an AWS key ID with its secret, then checked them against the provider's API
- when public sources ran dry, signed up with throwaway email and went looking from the inside: connectors, MCP endpoints, secret stores
The worker agent created 276 follow-up tasks on its own in 19.5 hours, up to 14 at once. When a path was a dead end, it opened new tasks to get around it. One prompt, then no human needed.
What's confirmed and what we don't know
- From Perplexity's own logs: the probing against Perplexity, the numbers above and the fact that it was blocked.
- From the attacker's notes, not checked: everything about Company A and Company B. Perplexity says that picture comes from the agent's own summaries, which "can misread responses or overstate partial access", and that it didn't test the recovered credentials.
- Not public: who the attacker is, the two companies, which models or coding agents the workers used, and what the attacker wanted the frontier models for.
- Who's telling it. Perplexity, about its own defence, and the post also showcases its Computer agent product, which flagged the activity. BleepingComputer and TechCrunch covered it on 2 December. No independent confirmation beyond that.
- Not an AI-built app breach. None of the three targets is said to be vibe-coded. It's on this list because it's AI coding agents doing the attacking, and they went after exactly the things vibe-coded apps tend to leave lying around.
Why this matters if you build with AI
For years the answer to "would anyone bother attacking my little app?" was "probably not by hand". That answer is going. This campaign shows an agent doing patient, boring work for 19 hours without anyone watching: read every commit in every fork, try every staging name, sign up again when blocked. It doesn't care how small you are. It cares whether you have a key.
And look at what actually landed. Not a clever exploit. A credential in git history that someone thought they'd deleted, and a demo environment with an open management API. If you've ever committed a .env and then removed it, or spun up a staging copy and forgot it, that's the same shape.
It also lines up with earlier breakdowns. Google's threat intel team reported stolen AI keys running up $100,000 in a day. AI provider keys are worth stealing now, and the hunt is automated.
Run the agent's checklist on your own app (15 minutes)
- Your git history, all of it. Deleting a file or a commit doesn't remove it from history, from forks, or from other people's clones. Scan everything, including old branches:
Anything real you find: rotate it in the provider's dashboard first. A history rewrite comes after, and it can't reach forks. More in Pushed your .env to GitHub?gitleaks git . # whole history, all commits git log -p --all | grep -nE 'sk-[A-Za-z0-9_-]{20,}|sk_live_|AKIA[0-9A-Z]{16}|ghp_|github_pat_|service_role' | head - Your live JavaScript. The agent pulled bundles with a real browser. Do the same: open your site, then DevTools, Sources, and search the loaded files for
sk-,sk_live_,AKIA,service_role. Or run the free check above. Anything with aNEXT_PUBLIC_orVITE_prefix ships to every visitor. See this guide. - Every hostname you've ever had a certificate for. Certificate-transparency logs are public. This lists what the agent would see:
Old staging, demo and preview apps on that list should be deleted or put behind a login. Company B's way in was a demo environment.curl -s "https://crt.sh/?q=%25.yourdomain.com&output=json" | jq -r '.[].name_value' | sort -u - Files you'd never serve on purpose. The agent guessed
.env.productionand similar paths in storage. Check your site and any public bucket:
You want 404 on every line. For Supabase buckets, see public storage buckets.for p in .env .env.production .env.local .git/HEAD; do echo "$p $(curl -s -o /dev/null -w '%{http_code}' https://yourdomain.com/$p)" done - Any feature that fetches a URL a user gives you. Link previews, "import from URL", "summarise this page", webhooks, an AI tool that can browse. That's where the SSRF attempts went. If it runs on a server with a cloud metadata endpoint, check the destination before fetching. A rough first gate in Node:
This is a first gate, not the whole fix. Perplexity's defence checked the resolved address at connection time, which also stops DNS rebinding (a name that resolves to a safe address when you check and an internal one when you fetch). On AWS, require IMDSv2 on your instances so a plain GET to the metadata address gets nothing.import { lookup } from "node:dns/promises"; import net from "node:net"; const blocked = new net.BlockList(); for (const [ip, bits] of [["0.0.0.0", 8], ["10.0.0.0", 8], ["100.64.0.0", 10], ["127.0.0.0", 8], ["169.254.0.0", 16], ["172.16.0.0", 12], ["192.168.0.0", 16]]) blocked.addSubnet(ip, bits, "ipv4"); for (const [ip, bits] of [["::1", 128], ["fc00::", 7], ["fe80::", 10]]) blocked.addSubnet(ip, bits, "ipv6"); // Call before every fetch of a user-supplied URL, and again on every redirect hop export async function isSafeUrl(raw) { const url = new URL(raw); if (url.protocol !== "https:" && url.protocol !== "http:") return false; const addrs = await lookup(url.hostname, { all: true }); return addrs.every((a) => !blocked.check(a.address, a.family === 6 ? "ipv6" : "ipv4")); } // fetch(url, { redirect: "manual" }) and re-check each Location header yourself - Other people's IDs. The agent asked for other users' threads and files by ID. Sign in as one test user and request another's record. See change the ID, see someone else's data.
- Rate limits that one person can't reset by signing up again. Per-account limits didn't stop this attacker. It made a new account. Limit per IP as well, slow or block disposable email domains on sign-up if you can, and look in your logs for bursts of 404s on paths you don't have.
- A spend cap and an alert on every AI key. If one does leak, a cap turns a disaster into an annoying email. See AI API key in the frontend.
Check what a stranger's agent sees first.
Paste your URL and Abbi Labs opens your live site signed out: secret-looking keys in your JavaScript, exposed .env and .git, open Supabase tables. Read-only, no sign-up. It won't read your repo's history, so pair it with the gitleaks step above.
My take
The funny part is the attacker's own server was wide open, 29 folders of it, and that's how anyone knows any of this. The unfunny part is how ordinary the wins were. A credential somebody thought was deleted. A demo box nobody was watching. An agent will happily read 4,328 forks to find that one commit, so assume it will, rotate anything that was ever committed, and take down the staging copies you forgot about.
Sources
- Perplexity, How Perplexity defended against an autonomous AI attacker, 2 December 2026 (primary; timeline, techniques, the exposed server, Cairn workspaces, Company A and B, scope and limitations, indicators)
- BleepingComputer, Autonomous AI attack targeted Perplexity to steal cloud credentials, 2 December 2026
- TechCrunch, Perplexity caught an autonomous AI hacker trying to steal tokens, 2 December 2026
- Node.js, net.BlockList and dns.promises.lookup (the SSRF gate above)
- AWS, Configure the instance metadata options (requiring IMDSv2)
Know someone shipping with AI tools? Send them this.
Related
- Breakdown: Google says attackers edited .claude/settings.json so starting Claude Code pulled a backdoor, and stolen AI keys ran up $100,000 in a day
- Breakdown: an AI coding agent committed a key to Together AI's public repo, and someone used it before the revert
- Breakdown: a coding agent read the whole .env file 10 times in three weeks to get one token
- Breakdown: 35,578 Grok-built apps found through passive DNS
- Pushed your .env file to GitHub? What to do now
- Is an old API key still sitting in your git history?
- Change the ID, see someone else's data
- Exposed .env, .git and source maps