Never give an AI tool a shell on the same machine or process that holds your production secrets; run code tools in a separate sandbox with no env vars
teai: the chat AI's code tool ran as root next to the app, so users could ask it for the server's ~100 production secrets · Security incident · teai · teai · Nov 9, 2026
What happened
Enabler Inc., which runs the Japanese AI service teai, published a technical report on 9 Nov 2026. Its chat AI had a code_execute tool that ran as root on the same machine as the service, so a user could ask the AI to read the main process's environment variables, which held almost all production secrets (about 100). Between 8 Sep and 9 Nov the stolen keys gave an attacker read and write access to the database, took over the CEO's account, wrote to backup storage, sent about 76,000 phishing emails from the company's domains and granted usage credits. Up to 2,536 users' names, emails and usage records may have been read.
How to prevent it
Run AI code execution in an isolated sandbox or separate VM with no secrets in its environment, split secrets per service instead of one shared env, and alert on unusual use of email, payment and database keys from the provider side.
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 building an app with AI agent. Please review how login, sessions and access control work in my project. 1) Explain in plain English how a user signs in, how long a session lasts and what happens on logout. 2) Check that sessions expire, that logout really ends the session on the server, and that every API route and database query checks the user is allowed to see that data (not only the UI). 3) List each problem you find with the file name and a suggested fix, most serious first. 4) Give me a short manual test plan: log in, log out, wait for expiry, and try to open another user's data with a second account. 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: auth, sessions & access
AI tools generate sign-up and login screens quickly, but the hard parts are invisible in a demo: session expiry, real logout, password reset, and checking on the server that a user may see the data they ask for.
A quick checklist before you ship
- Test logging out, then pressing back and refreshing: you should not see private pages.
- Create a second account and try to open the first account's records by changing IDs in the URL or request.
- Check that every API route and database query verifies the user, not only the UI.
- Test native and social login on a real device before launch.
More on this: every auth, sessions & access story and our related guide.
Tools involved
AI agent stories, Fly.io stories, Stripe stories
Related stories
- Fix login when wrapping a web app for iOS
Going native broke authentication three ways - Turn on Row Level Security for tables your AI agent created
UpGuard finds 16,326 Supabase databases with tables anyone can read - Make sure your login page sends no data before sign-in
Vibe-coded Bootlegger dashboard sent franchise data with its login page
Source: original post on teai ↗. Summarised in our own words; numbers are as stated by the source. Browse all stories.