安全

密钥不进聊天 句句有依据

这一页讲​清楚:Tofu 保管​什么、​从不保管​什么,​你批准后 agent 能做​什么,​部署前的​安全检查​具体看​哪些​内容。​每一条​旁边,​都写明了​它的局限。

franks-kitchen / Environment variables
  • MAIL_API_KEYsecret••••Qm7xProdPreview
  • SMS_API_KEYsecret••••c9d2Prod
  • NEXT_PUBLIC_SITE_URLhttps://frankskitchen.comProdPreviewDev
  • DATABASE_URLmanaged••••••ProdPreview

Secrets are write-only — once saved, the value is hidden and never shown again.

What Tofu keeps
key
"SMS_API_KEY"
secret
true
value
null
preview
"••••c9d2"

The value went to the hosting provider, write-only.

Tofu 从不保管的东西

有些东西,​永远到不了 Tofu 所以也不可能从 Tofu 泄露

最敏感的​信息,​都留在​各自的​服务商​那里:​你的托管​服务商、Google 或 GitHub、DNS 服务商、Stripe。

  • 密钥内容

    你保存的​密钥内容

    密钥内容​直接交给​托管​服务商,​之后​只能写入,​不能读出:​控制台里​看不到,Tofu 自己也读​不到。Tofu 保存的是​名称、​作用范围​和打码​预览。

  • 密码

    你的账号密码

    你用 Google 或 GitHub 登录。Tofu 从不替​你设置​或保存​密码,​所以也不会有​密码​从这里​泄露。

  • 服务商密钥

    你粘贴的密钥或 token

    连接​服务商时,Tofu 从不要求​你粘贴​密钥或 token。​连接 DNS 时,​你在​服务商的​页面上​批准​就行。​你批准后​生成的​授权​凭据,​由 Tofu 保管,​也由 Tofu 撤销。

  • 银行卡号

    你的银行卡信息

    你直接在 Stripe 的结账​页面​填写,​这些信息​永远到不了 Tofu。Tofu 保存的是​你的套餐​和订阅​状态。

例外​只有一个,​而且由你​掌控。托管​数据库​有一个“显示​数据库​密钥”的​操作,​只有所有者​能用,​会在你​要求时​现场重新​组合出​这串​密钥。​每用一次,​都会留下​一条审计​记录,​任何 agent 都碰不到​这个操作。​目前​还不支持​更换​数据库​密码。

agent 的权限

你的 agent 替你办事 但必须先经过​你批准

coding agent 连接 Tofu 的方式,​跟在电视上​登录视频 app 差不多:agent 在屏幕上​显示​一个验证码,​你在​自己的浏览器里​登录 Tofu,​核对后点​批准。

你复制的​安装​提示词里​写明了​客户端和 skill 这两个​文件的​大小和 SHA-256 校验值。​提示词会让 agent 下载后​逐一​核对,​只要有​一个对不上,​就停下来,​什么​都不运行。

Your agent

tofu · login

Approve this sign-in in your browser. The code is

7F3A-C09B-21DE

app.trytofu.ai/dashboard/agent?code=7F3A-C09B-21DE

Approve only a code your own agent printed.

Connect Claude Code (MCP)?

Check that this code matches the one in your coding agent:

7F3A-C09B-21DE

Approve this connectionMhello@trytofu.ai
  1. agent 发起请求

    agent 里的 Tofu 客户端​会发起​登录​请求,​显示​一串像 XXXX-XXXX-XXXX 这样的​验证码。​这个请求 10 分钟内​有效。
  2. 先核对,​再批准

    认准你​登录 Tofu 用的​那个网址,​在那里​打开批准​页面。​页面上的​验证码​和你自己的 agent 显示的​一模​一样,​才点​批准。
  3. 有效期 7 天

    批准后,​客户端​会把登录​凭据存在​本地,​只有你​能读,​也只对这一个 Tofu 网址​有效;Tofu 那边只存​它的哈​希值。​你​随时可以在控制台的“coding agent”页面​撤销它。​光删掉​本地​文件,​不算​撤销。

批准之后,agent 能做什么

This connection can upload your app’s source or import it from a public GitHub repository, download your app’s code into a new folder on your computer when the agent runs there, get the link that opens your app in Tofu’s builder, which you open yourself, run the safety check, deploy it — its build runs any migration step it has — once you have a hosting plan, save and remove your app’s public settings — an address, a feature flag, a key meant to be public — when the agent runs on your computer, but never a hidden value, which you type yourself in Keys & settings, create the app’s managed database, on its own or in the same call as a deploy, which Tofu runs and pays for as part of your plan, read the app’s build and runtime diagnostics, restore a previous deployment, connect, verify, release or withdraw the authorization for a domain you already own, read domain quotes and prepare a dashboard link for you to review a fresh price, agreements and payment when the agent runs on your computer — it cannot place an order or submit payment, read the stored status of domains you bought through Tofu and ask the registrar to send its confirmation email again to the registrant, without seeing your owner details or changing renewal settings, read and add DNS records on a domain you bought through Tofu, and delete one of yours — never its mail (MX) or verification (TXT) records, which stay with you, read your app’s own traffic — the first read for an app that has no counter yet issues its key — and turn that counter on or off, read whether your app is answering its visitors, and turn Tofu’s emails about it on or off, change how your app’s users sign in and how its sign-in email is sent, see who has an account in your app, add a person by email or remove one — which signs them out — choose whether anyone can sign up or only the people you add, and make the app private — only people with a link can open it — or open to everyone again, send a short message to up to ten of your app’s users, from your app’s own email address, get an invite link that lets one person into your private app — you hand the link out yourself, and the first person who opens it gets in for up to 30 days — list the links you made and turn one off again, choose who can open your app — anyone with the link, only people you list by email, or anyone with a code you share, which puts a sign-in page in front of the whole app — add or remove those people, make a new code, sign everyone out, and keep exact paths open for services like webhooks, connect your app to your own Stripe account when the agent runs on your computer — you install Tofu’s app on Stripe’s own page — then create payment links there, pass their payment events to the app or disconnect it, with the money going straight to you and nothing in its reach that moves money out of your account, set up email your app sends from its own address, pause it, give it a new key or remove it, when the agent runs on your computer — Tofu writes the app’s sending key into its settings, and nothing is sent until the app sends email itself, restore an archived database into a new one Tofu runs and pays for as part of your plan, and hand you a short-lived link to download its archive, keep a database Tofu warned you about from being archived for going unused, list your database’s daily backups and ask a person at Tofu to put it back to one, which loses what was saved after it, see which of your app’s database setup steps are done, choose whether Tofu runs them for an app, and mark one as done so it never runs, when the agent runs on your computer, delete an app — the source you uploaded is kept until you ask Tofu to erase it — or its database, with nothing kept, send Tofu’s team a problem report you approved word for word, with your app’s status attached, sign in to Tofu, read the account’s id and email address, report the plan and the account’s GitHub state, and turn automatic updates off.

It cannot buy, renew or transfer a domain, submit a payment, read domain owner details, an environment value or a database password or connection string, change your plan or billing, or import a private repository from GitHub. Those stay with you.

Your agent acts on your instructions, and Tofu tells it to ask for your agreement before any call that spends money, writes to a live service or destroys something. Tofu can’t see your conversation with it, so it can’t check that the agent asked: connect only agents and apps you trust, and disconnect any of them on the Coding agent page.

安全检查

查过的,​都写清楚 没查的,​也写清楚

每次构建前,Tofu 都会检查​马上要部署的​那批​文件。​它特意​只承诺​一件事:​查了什么​就说​什么,​绝不​夸大。

你的 agent 会用到的工具

  • detect
  • setFramework
  • scan

每次部署前,​先过一道关

只要发现​下面​任何一种情况,Tofu 就会拦下​这次部署:​代码里​写着真实​可用的​密钥​(不是​测试​用的);​登录表单​会把访客​填的账号​密码发到​别的​网站;​有代码​在收集​钱包助​记词。​有文件读​不了,​也会拦下。​这道关​查的,​正是​马上要上传的​那批​文件。

靠规则,​不靠 AI 模型

Tofu 用一套固定​规则检查​你上传的​内容,​查这些问题:​暴露​在外的​服务​密钥、​没开 Row Level Security 的表、​谁都能写​入数据的​访问​策略、​不验证​来源的 Stripe webhook。​还有​已知的​恶意代码​特征,​比如​会自己​解码​再运行的​代码、​会下载​并运行​程序的​安装​脚本。​可能伤害​别人的​问题,​一发现​就拦下​部署:​已知的​恶意​代码、​钓鱼​页面、​泄露的​密钥。​只影响​你自己 app 的做法,​比如​让一张表谁​都能改,​一律标成​警告,​绝不拦下​部署。

每份结果都写​明检查范围

结果里​会写明:​收到了​多少个​文件、​实际读了​其中​多少个、​做了哪些​检查。​还会附​一份清单,​列出​所有检查​都不查的​风险。​这份清单​永远不会是​空的:​总有检查​管不到的​地方。

发现问题,​还告诉你怎么修

每个问题​都会写明​触发了​哪条​规则、​出​在哪个文件、​具体是​怎么回事,​还附上​一段修复​提示词,​直接​交给你的 coding agent 就行。

没有需要拦下​部署的问题时,​结果会这样写
No blocking finding among the checks that ran.
一个文件​都没读到时,​结果会这样写
Nothing was inspected, so this is not a pass.
上线之前

能打开,​才上线 上一个能用的​版本继续在线

  • 健康检查

    先检查,​再切换网址

    构建​完成后,Tofu 先访问​新版本​专属的​网址。​能打开,​才把 app 的网址​切到新​版本。

  • 构建失败

    构建失败,​线上一切照旧

    上一个版本​照常在线。​构建过程中​数据库迁移​出错,​也算构建失败。

  • 回滚

    一步回到​旧版本,​不用重新构建

    回滚会把 app 的网址​切回之前​某个​能正常​打开的​版本。​你的数据​不会跟着回​退。

数据存放

你的数据​存在哪里?逐一写明,​不用你猜

下面是​隐私​政策的​摘要。​每项数据​保留​多久、​怎么申请​删除,​完整​说明见隐私政策。

数据存放位置说明
你的账号Supabase邮箱、​你用来​登录的​服务,​还有​这个服务​共享的​名字和头像。​不存​密码。
项目与部署Tofu 自己的数据库名称、​自动​识别的​框架、​部署​历史、​状态​和设置。​只有项目​所属的​账号​能查看。
你交给 Tofu 的源代码私有存储从不对外公开。​用于构建​和部署,​保留到你要求​删除为止。
静态 app 发布的文件Cloudflareapp 在 Tofu 静态​托管上​发布的​内容。​访客打开 app 的 ontofu.app 网址,​就能看到。
环境变量名称在 Tofu,​值在 VercelTofu 保存名称​和作用​范围,​并记下​这个变量​是不是​密钥。​密钥的值​只存在 Vercel,​只能写入,​读不出来。
构建日志​和请求日志VercelVercel 返回的日志,​只覆盖最近​一段时间,​不是存档。
套餐与账单Stripe你的套餐​和订阅​状态。​银行卡​信息只在 Stripe 的结账​页面​填写,​不经过 Tofu。

访问你 app 的人 只统计次数,​不追踪个人

为 app 开启 Tofu 的访问​统计后,​页面浏览​量记在 Tofu 自己的服务器上。​数据归你:​在控制台里​查看,​也能在那里​关掉​统计,Tofu 不会拿​这些数据​另作​他用。

  • 不在访客的​浏览器里设置 cookie。
  • 不往你的 app 里加第三方​统计脚本。
  • 不保存 IP 地址。
  • 不保存​完整​网址:​网址里 ? 和 # 后面的​部分​都去掉;​访客​从哪个网站​点进来,​也只记​那个网站的​域名。
  • 访客​如果开启了 Do Not Track 或 Global Privacy Control,​他们的浏览​不会计入​统计。
  • 统计数据​默认保留 90 天,​最长​不超过 365 天;​删除 app 时​会一起删掉。
报告漏洞

发现漏洞了?先告诉我们

发邮件​告诉我们​你发现了​什么、​怎样​重现。​请只在你​自己的账号和 app 上测试,​公开前​先给我们​留出​修复的​时间。

这个邮箱​地址​也写在 /.well-known/security.txt 里,​安全研究​人员​用工具​找联系​方式时,​会先查​这里。

/.well-known/security.txt
Contact: mailto:hello@trytofu.ai
Expires: 2027-09-27T00:00:00.000Z
Preferred-Languages: en
Canonical: https://trytofu.ai/.well-known/security.txt
Policy: https://trytofu.ai/security#report

Tofu 做不到的事

  • 安全检查​不能保证​没有恶意代码。 安全检查​只能认出​已知的​恶意代码​特征,​看不出​代码想做​什么;​也不查 app 运行​起来后做​什么、​数据库里​存了​什么,​还有 package.json 里没直接​列出的​依赖。

  • 没有详细的​安全报告。 这个功能​还没做出来。​控制台里会如​实写明,​不拿示例​结果充数。

  • 接入的 agent 能访问你​所有的项目,​也能修改。 你批准的 agent 能做你​账号​能做的​一切:​所有项目、​所有操作。​用完​记得到​控制台的 Coding agent 页面撤销​授权。

  • 校验和只能查出​下载出错,​代替不了签名。 我们​公布的 SHA-256 校验和,​能查出​下载的​文件​对不上​或已​损坏。​但校验​和本身​也是从 Tofu 自己的网址经 HTTPS 拿到的,​所以分发​文件的​服务器​一旦​被攻破,​校验​和也查​不出来。

  • 日志里的​密钥不一定​都能打码。 Tofu 显示​日志时,​会给看起来​像密钥、​密码的​文字打码。​但有些​密钥​保存后连 Tofu 也读不回​原文,​也就没法​拿它去​日志里​把每一处​都找​出来。​所以千万别让 app 把自己的密钥​写进​日志。

  • 删除 app 后,​上传的源​码还在。 源码​会一直保存在 Tofu 的私有​存储里,​直到你​联系我们​删除。

  • 不能自己注​销账号。 要注​销账号,​请发​邮件到 hello@trytofu.ai。​我们​会人工​处理,​并告诉你​删掉了​哪些、​哪些删​不了。

  • 没有合规认证。 Tofu 没有 SOC 2 或 ISO 27001 认证,​没有公开的​审计​报告,​也不声明​服务符合 GDPR。

粘贴​一段提示词。10 分钟上线

用你​已经在用的 agent,10 分钟,​把 app、​数据库、​域名和​登录​都弄好。

免费开始