dev.to | 📄 原文链接 | 2026-09-08 收录

AI agent 不过是个 while 循环——70 行 Python 造一个,再骗它泄露 .env

来源:dev.to — 2026-09-07

📋 概述

每个框架、每个招聘帖、约一半 LinkedIn 都想告诉你「AI agent」是什么,多数定义是营销。能塞进索引卡的定义是:agent 是一个语言模型、一小串它被允许请求的函数、加一个 while 循环。作者用不到 70 行 Python 无框架证明它——然后在一张网页里藏一段话,看着 agent 交出自己的 API key。接着修复,而有趣的部分是:所有修复都不涉及模型。作者在 Tigera 做 Kubernetes 端。

🔑 核心要点

💡 金句

If you can't see what the agent did, you can't tell whether it did something wrong. Until you read the log, you have Schrödinger's agent.
← 返回 dev.to 首页