Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededsandboxSandbox, container, and execution isolationSandbox, container, and execution isolationsecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Description
Parent: #32
问题概述 / Summary
真实容器生命周期尚未形成可供 Agent 安全使用的 I/O 合同。需要把工作区输入、stdin、stdout/stderr、输出目录和 Artifact 提交做成有界、不可逃逸、可验证的事务。
当前基线 / Current baseline
- Workspace、Artifact、事件 Store、Secret redaction 与输出限长已有通用能力。
- Docker foundation 尚未把这些边界组合成产品级容器 I/O。
- 当前不得把宿主工作区可写挂载或无限日志直接交给模型。
范围 / Scope
- 创建只读输入快照或等价只读 mount;容器不得直接修改原始 Workspace。
- 为输出提供独立、Run-scoped、容量受限的 writable staging 目录。
- stdin 默认关闭;只有显式协议允许时才开放有界输入。
- stdout/stderr 按字节、行数和持续时间限制,保证 UTF-8、截断标记和 Secret 脱敏。
- 输出文件执行路径规范化、symlink/reparse-point、文件数、单文件/总大小和媒体类型检查。
- 验收后以哈希、大小和来源收据原子提交 Artifact;失败时不留下半提交结果。
非目标 / Non-goals
- 不开放网络。
- 不负责产品 UI 或通用 Shell。
- 不允许运行容器安装钩子改变宿主机。
涉及目录 / Affected directories
internal/sandbox/internal/runner/internal/workspace/internal/artifact/internal/application/internal/store/internal/events/internal/policy/docs/adr/
依赖 / Dependencies
- 与容器生命周期所有权 Issue 协调 generation/attempt identity。
- 产品准入 Issue 依赖此 I/O 合同。
验收条件 / Acceptance criteria
- 容器无法写原始 Workspace,写入只发生在专用输出 staging。
- traversal、absolute path、symlink/junction/reparse-point 逃逸均被拒绝。
- stdout/stderr 超限、非 UTF-8、Secret 和超时有稳定、可审计结果。
- stdin 在默认路径中不可用;显式输入有大小、次数和时限上限。
- 失败/取消不提交 Artifact;成功只提交验收清单中的文件。
- Artifact 包含 SHA-256、字节数、媒体类型、Run/Attempt/generation 与创建时间。
- Windows/Linux 路径边界、并发输出和磁盘写满有定向测试。
-
go test、go vet与 diff check 通过。
安全边界 / Security boundaries
容器输出属于不可信证据。任何日志或文件都不得自动变成系统 Prompt、审批结论、命令或宿主机可执行内容。
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededsandboxSandbox, container, and execution isolationSandbox, container, and execution isolationsecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Activity
docs: record the bounded Docker container I/O contract (ADR 0098)
Merge pull request #61 from pppolf/feat/docker-container-io-contract