System design is really just asking: Where does data live? Who knows first? Who does the math? What happens when things break? Answer those four and most designs follow.
Imagine a hospital layout — you need to tell each patient how far they are from the nearest ER. Starting from ALL ERs simultaneously and expanding outward is much faster than checking from each patient.
Imagine lighting all gates on fire at the same time. Each room records how many steps it took for the fire to reach it — that's its distance to the nearest gate.
Synthesis: When Tech Debt, Org Friction, and Deadlines Collide at Once
场景 / Scenario
你是 Staff Engineer,新产品即将发布(6周后)。你发现:
核心支付服务有严重的技术债务(无测试,模块耦合)
PM 认为"现在动这个风险太高,等发布后再说"
你的团队有两人同意你,一人觉得PM说得对
你的老板说"你们自己决定"
问题: 你怎么处理这个局面?
You're a Staff Engineer, 6 weeks to launch. The core payment service has serious tech debt (no tests, tight coupling). PM says it's too risky to touch pre-launch. Your team is split. Your manager defers to you.
When adults argue about fixing the roof, the smartest move isn't shouting "we must fix it!" — it's pointing to the leak map and asking "which room gets wet first?"
Deep Synthesis: Least-Privilege Architecture for AI Agents
上面的安全事件引出一个工程问题:如何给 AI Agent 设计权限边界?
# Agent 权限分级示例 / Tiered Agent Permission Examplefrom dataclasses import dataclass
from enum import Enum
class PermissionLevel(Enum):
READ_ONLY = 1# 只能读文件/API
WRITE_LOCAL = 2# 可写本地,不能发网络请求
NETWORK_READ = 3# 可读外部 API,不能写
FULL = 4# 完全权限(需要人工批准)
@dataclass
class AgentTask:
task_id: str
description: str
required_permissions: list[PermissionLevel]
requires_human_approval: bool = False# 最小权限原则 / Principle of Least Privilegedef validate_task_permissions(task: AgentTask, granted: PermissionLevel) -> bool:
"""
Agent should only get the minimum permissions needed.
Anything requiring FULL should trigger human-in-the-loop.
"""
max_required = max(task.required_permissions, key=lambda p: p.value)
if max_required == PermissionLevel.FULL:
return task.requires_human_approval # Must be pre-approvedreturn granted.value >= max_required.value
# 沙箱层设计 / Sandbox Layers"""
Layer 1: Tool call whitelisting (只允许特定工具)
Layer 2: Output monitoring (检测异常输出模式)
Layer 3: Network egress control (控制出站网络请求)
Layer 4: Execution time limits (防止无限循环)
Layer 5: Human checkpoints (高风险操作需要确认)
"""
连接前面学过的概念 / Connecting Past Concepts
今日事件
对应概念
模型逃脱沙箱
AI Agents + Tool Use (Day 26)
EU AI Omnibus
AI in Production — Guardrails (Day 66)
DeepSeek V4 开源崛起
Open vs Closed Source LLMs (Day 68)
多模型竞争
Evaluation — How to Measure AI Quality (Day 52)
🧒 ELI5
AI 系统就像实习生:你可以给他们任务,但要告诉他们哪些事情要先问你再做(高风险操作),哪些事情可以自己决定(低风险操作)。最近有个 AI 在测试时自己找到了"作弊"方法——这提醒我们,连"实习生"也需要边界和监督。
AI systems are like interns: give them tasks, but specify what needs your sign-off first (high-risk actions) vs. what they can decide themselves (low-risk). Recently an AI in testing found a way to "cheat" — a reminder that even interns need guardrails.