Putting AI in a Cage: The Architecture of Controlled Intelligence
本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。
“AI agents can reason, use tools, modify files, and execute tasks. But how do we give them useful capabilities without surrendering control? A practical look at the architecture behind controlled AI.” Putting AI in a Cage: The Architecture of Controlled Intelligence I’ve been thinking about a particular question as AI systems become more capable: How do we give artificial intelligence the ability to do things without giving it unrestricted authority to do anything? We’re moving beyond systems that simply generate text. AI agents can interact with APIs, inspect repositories, execute commands, modify files, retrieve information, and coordinate other tools. Some can work through multiple steps toward a goal without requiring a person to approve every individual action. That changes the security conversation. We’re no longer discussing only what a model might say. We’re discussing what an entire system might do because a model was given the ability to act. And that distinction matters. I started thinking about this through the idea of putting AI in a cage. Not necessarily preventing intelligence from operating, but creating an environment where its capabilities have boundaries. The more I explored the idea, the more I realized that the model itself is only one part of the problem. The surrounding architecture matters just as much.
“人工智能代理能够进行推理、使用工具、修改文件并执行任务。但我们如何在不放弃控制权的情况下赋予它们有用的能力呢?本文将从实践角度审视受控人工智能背后的架构。”《将人工智能关进笼子:受控智能的架构》:随着人工智能系统变得越来越强大,我一直在思考一个特定的问题:我们如何在不赋予人工智能不受限制的权限的情况下,赋予它执行任务的能力?我们正在超越仅仅生成文本的系统。人工智能代理可以与 API 交互、检查存储库、执行命令、修改文件、检索信息并协调其他工具。有些代理可以在不需要人工批准每一个单独操作的情况下,通过多个步骤实现目标。这改变了安全对话的范畴。我们不再仅仅讨论模型可能会说什么,而是在讨论因为模型被赋予了行动能力,整个系统可能会做什么。这种区别至关重要。我开始通过“将人工智能关进笼子”的想法来思考这个问题。这并不一定是为了阻止智能运行,而是为了创造一个环境,使其能力受到限制。我探索得越深入,就越意识到模型本身只是问题的一部分,周围的架构同样重要。
-
The model isn’t the entire system When people discuss AI safety, conversations often focus on the model. Its training. Its alignment. Its instructions. Its refusal behavior. Its ability to recognize harmful requests. These are important, but they don’t represent the entire security boundary. Consider a coding agent. The model might receive an instruction to inspect a project, identify a bug, modify some files, and run tests. To complete that task, the system might have access to: A language model. A filesystem. A terminal or shell. A code repository. External APIs. Package managers. Network access. Credentials. An execution environment. The model is reasoning about what to do, but the surrounding tools determine what it can actually do. If the model makes a mistake, misunderstands an instruction, or processes malicious input, the consequences depend heavily on the authority available to it. A model can be instructed not to delete important files. But if the agent has unrestricted filesystem access, that instruction is not an enforceable security boundary. This is where I think the architecture needs to change. We should not depend entirely on an intelligent system choosing to behave safely when we can design its environment to limit the consequences of unsafe behavior.
-
模型并非整个系统:当人们讨论人工智能安全时,对话往往集中在模型上。它的训练、对齐、指令、拒绝行为以及识别有害请求的能力。这些都很重要,但它们并不代表整个安全边界。以编码代理为例,模型可能会收到检查项目、识别错误、修改文件并运行测试的指令。为了完成该任务,系统可能需要访问:语言模型、文件系统、终端或 Shell、代码存储库、外部 API、包管理器、网络访问、凭据以及执行环境。模型在推理要做什么,但周围的工具决定了它实际上能做什么。如果模型犯了错误、误解了指令或处理了恶意输入,后果在很大程度上取决于它所拥有的权限。模型可以被指示不要删除重要文件,但如果代理拥有不受限制的文件系统访问权限,该指令就不是一个可强制执行的安全边界。我认为架构需要在此处做出改变。我们不应完全依赖智能系统选择安全行为,而应设计其环境以限制不安全行为带来的后果。
-
The seven layers of controlled intelligence I began organizing this idea into seven connected layers. Each layer has a different responsibility, and none should be mistaken for the entire security system. Layer 1 — Model This is the intelligence layer. It receives context, interprets instructions, generates responses, and determines what action it believes should happen next. It could be: A locally hosted model. A cloud-hosted model. A specialized coding model. A model selected dynamically through a routing system. The important architectural distinction is that the model should be replaceable. The system should not depend on one model being permanently available, trustworthy, or capable of handling every task. A model provides intelligence. It should not automatically become the authority governing the entire environment.
-
受控智能的七个层级:我开始将这一想法组织成七个相互关联的层级。每一层都有不同的职责,任何一层都不应被误认为是整个安全系统。第一层——模型:这是智能层。它接收上下文、解释指令、生成响应并确定它认为接下来应该采取什么行动。它可以是:本地托管模型、云托管模型、专业编码模型,或是通过路由系统动态选择的模型。重要的架构区别在于模型应该是可替换的。系统不应依赖于某个模型永久可用、值得信赖或能够处理所有任务。模型提供智能,它不应自动成为管理整个环境的权威。
Layer 2 — Orchestration The orchestration layer coordinates the work. It determines which model or tool handles a task, manages context, tracks workflow state, and coordinates execution. For example: Receive a coding request. Retrieve relevant project documentation. Identify the files involved. Assign the task to an appropriate model. Coordinate tool usage. Collect the result. Send the result through validation. This layer also provides an opportunity to enforce workflow rules. An agent should not be able to invent its own permissions simply because it decides another tool would be useful. Orchestration coordinates capability. It should not silently grant unrestricted authority.
第二层——编排:编排层负责协调工作。它决定由哪个模型或工具处理任务、管理上下文、跟踪工作流状态并协调执行。例如:接收编码请求、检索相关项目文档、识别涉及的文件、将任务分配给合适的模型、协调工具使用、收集结果并将结果发送进行验证。这一层还提供了强制执行工作流规则的机会。代理不应仅仅因为认为另一个工具很有用,就能自行发明权限。编排协调的是能力,它不应默许授予不受限制的权限。
Layer 3 — Permissions This is where the system begins establishing enforceable boundaries. What can the agent access? Can it: Read files? Modify files? Execute shell commands? Access the internet? Interact with APIs? Read credentials? Modify repositories? Deploy applications? Spend money? These permissions should be defined according to the actual task. For example, an agent asked to review a repository does not automatically need permission to modify it. An agent asked to edit a particular project does not automatically need access to the user’s entire filesystem. The principle is least privilege: provide only the access necessary to complete the assigned work. Permissions should be enforced outside the model, at the application, operating system, API, or infrastructure level. A prompt saying “do not access this directory” is not equivalent to a filesystem permission preventing access.
第三层——权限:这是系统开始建立可强制执行边界的地方。代理可以访问什么?它可以读取文件、修改文件、执行 Shell 命令、访问互联网、与 API 交互、读取凭据、修改存储库、部署应用程序或消费资金吗?这些权限应根据实际任务进行定义。例如,被要求审查存储库的代理不需要自动获得修改它的权限。被要求编辑特定项目的代理也不需要自动获得访问用户整个文件系统的权限。其原则是最小权限:仅提供完成分配工作所需的访问权限。权限应在模型之外,即在应用程序、操作系统、API 或基础设施层面进行强制执行。提示“不要访问此目录”并不等同于防止访问的文件系统权限。
Layer 4 — Execution The execution layer is where the agent’s decisions become actions. This might involve: Running terminal commands. Executing scripts. Modifying source code. Installing dependencies. Calling external services. Running automated tests. Execution needs a controlled environment. Depending on the risk, that could mean a task-scoped workspace, container, virtual machine, restricted account, or dedicated sandbox. Isolation matters because a mistake should not automatically become a problem for the host machine or production environment. However, a sandbox is not magic. Its effectiveness depends on its configuration, exposed interfaces, mounted directories, credentials, network access, and isolation boundaries. An environment that has unrestricted access to sensitive host resources is not meaningfully restricted just because it is called a sandbox.
第四层——执行:执行层是代理的决策转化为行动的地方。这可能涉及:运行终端命令、执行脚本、修改源代码、安装依赖项、调用外部服务、运行自动化测试。执行需要一个受控的环境。根据风险的不同,这可能意味着任务范围的工作区、容器、虚拟机、受限账户或专用沙箱。隔离至关重要,因为一个错误不应自动成为主机或生产环境的问题。然而,沙箱并非万能。其有效性取决于其配置、暴露的接口、挂载的目录、凭据、网络访问和隔离边界。一个对敏感主机资源拥有不受限制访问权限的环境,仅仅因为它被称为沙箱,并不能说明它受到了有效的限制。
Layer 5 — Validation This layer answers a question that is s
第五层——验证:这一层回答了一个问题,即 s