7月初,Anthropic发布了Claude Tag------一个永久嵌入Slack的AI同事。你在任意频道@它,它自己拉取文件、拆解任务、更新文档,然后回复完成清单。
Anthropic内部65%的产品团队代码已经通过这种方式生成。
这不是Demo,这是已经跑通的产品。作为开发者,你需要理解的不是"AI能干活",而是"AI的权限怎么设计"。
一、Claude Tag的核心架构
工作模式
css
用户@Claude Tag → 任务描述
↓
Claude分析任务 → 拆解步骤
↓
调用工具 → Google Drive/文档/API
↓
执行任务 → 读取/编辑/创建
↓
回复结果 → 完成清单
关键特性
| 特性 | 说明 |
|---|---|
| 永久在线 | 不是对话式,是持续存在于频道中 |
| 工具调用 | 可以操作Google Drive、文档、API等 |
| 任务拆解 | 自动将复杂任务分解为子任务 |
| 上下文记忆 | 记住团队的工作流和偏好 |
二、权限模型:Agent安全的核心
Claude Tag的权限设计是目前最成熟的Agent权限模型之一。核心原则:
1. 频道级隔离
法务频道 → Claude能看合同
工程频道 → Claude能编辑代码
HR频道 → Claude能处理考勤
跨频道 → 架构层面不可能
注意:不是"不让他访问",是"架构层面不可能"。这是硬边界,不是软限制。
2. 操作审计
每一次凭证使用都会被记录。Claude有自己的公司账户------它不是"用你的token",而是"用自己的身份"操作。
3. 最小权限原则
Claude只获得完成任务所需的最小权限。你给它一个"读取文档"的任务,它不会获得"删除文档"的权限。
三、开发者如何复刻这套权限模型
权限分层设计
python
class AgentPermissionSystem:
def __init__(self):
# 资源定义
self.resources = {
'documents': ['read', 'write', 'create', 'delete'],
'code': ['read', 'write', 'execute'],
'api': ['call'],
'database': ['read', 'write'],
}
# 角色定义
self.roles = {
'reader': ['read'],
'editor': ['read', 'write'],
'admin': ['read', 'write', 'create', 'delete'],
}
# 频道-角色映射
self.channel_roles = {}
def bind_channel(self, channel_id: str, agent_id: str, role: str):
"""绑定频道和Agent的权限"""
if channel_id not in self.channel_roles:
self.channel_roles[channel_id] = {}
self.channel_roles[channel_id][agent_id] = role
def check_permission(self, channel_id: str, agent_id: str,
resource: str, action: str) -> bool:
"""检查权限"""
# 1. 检查是否在频道中
if channel_id not in self.channel_roles:
return False
# 2. 检查Agent是否在频道中
if agent_id not in self.channel_roles[channel_id]:
return False
# 3. 检查角色权限
role = self.channel_roles[channel_id][agent_id]
allowed_actions = self.roles.get(role, [])
return action in allowed_actions
def execute_with_audit(self, channel_id: str, agent_id: str,
resource: str, action: str, func):
"""带审计的执行"""
if not self.check_permission(channel_id, agent_id, resource, action):
self._log_denied(channel_id, agent_id, resource, action)
raise PermissionError("Permission denied")
# 执行操作
result = func()
# 记录审计日志
self._log_success(channel_id, agent_id, resource, action, result)
return result
def _log_denied(self, channel_id, agent_id, resource, action):
"""记录拒绝日志"""
print(f"[AUDIT] DENIED: {agent_id} -> {action} on {resource} in {channel_id}")
def _log_success(self, channel_id, agent_id, resource, action, result):
"""记录成功日志"""
print(f"[AUDIT] SUCCESS: {agent_id} -> {action} on {resource} in {channel_id}")
频道隔离实现
python
class ChannelIsolatedAgent:
def __init__(self, agent_id: str, permission_system: AgentPermissionSystem):
self.agent_id = agent_id
self.permissions = permission_system
self.current_channel = None
def join_channel(self, channel_id: str):
"""加入频道"""
self.current_channel = channel_id
print(f"Agent {self.agent_id} joined channel {channel_id}")
def read_document(self, doc_id: str) -> str:
"""读取文档(带权限检查)"""
if not self.current_channel:
raise RuntimeError("Not in any channel")
def _read():
# 实际读取逻辑
return f"Content of {doc_id}"
return self.permissions.execute_with_audit(
self.current_channel, self.agent_id,
'documents', 'read', _read
)
def write_code(self, file_path: str, code: str) -> bool:
"""写入代码(带权限检查)"""
if not self.current_channel:
raise RuntimeError("Not in any channel")
def _write():
# 实际写入逻辑
return True
return self.permissions.execute_with_audit(
self.current_channel, self.agent_id,
'code', 'write', _write
)
四、最佳实践
1. 频道规划
yaml
# 推荐的频道-权限规划
channels:
general:
- agent: claude-tag
role: reader # 只能读,不能写
engineering:
- agent: claude-tag
role: editor # 可以读写代码
legal:
- agent: claude-tag
role: reader # 只能读合同,不能修改
hr:
- agent: claude-tag
role: none # 不允许访问
2. 审计日志
python
# 审计日志格式
audit_log = {
"timestamp": "2026-07-17T10:30:00Z",
"agent_id": "claude-tag-001",
"channel_id": "engineering",
"action": "write",
"resource": "code/main.py",
"result": "success",
"metadata": {
"file_size": 1024,
"lines_changed": 15
}
}
3. 异常检测
python
def detect_anomaly(agent_id: str, actions: list) -> bool:
"""检测异常行为"""
# 规则1:单小时内写入超过100个文件
if len([a for a in actions if a['action'] == 'write']) > 100:
return True
# 规则2:访问不属于任何频道的资源
if any(a.get('channel') is None for a in actions):
return True
# 规则3:跨频道访问尝试
channels = set(a.get('channel') for a in actions)
if len(channels) > 5: # 短时间内访问过多频道
return True
return False
五、开发者需要关注的问题
1. 模型可以换,但公司记忆换不了
Claude Tag在团队中积累的工作流、偏好、经验教训,都深深嵌入了这个平台。如果换一个AI模型,这些积累全部归零。
这是Agent产品的核心壁垒,也是开发者需要警惕的锁定效应。
2. 权限逃逸风险
Agent可能通过间接方式获取超出权限的信息。比如:
- 通过错误信息推断其他频道的内容
- 通过时间序列推断其他用户的操作
- 通过API响应推断系统状态
需要在权限模型中考虑这些边界情况。
3. 多Agent协作的权限冲突
当多个Agent同时工作时,权限冲突的处理变得复杂:
- Agent A在写文件,Agent B同时读取
- Agent A在频道X有写权限,在频道Y没有
- 多个Agent同时修改同一资源
需要引入锁机制、版本控制、冲突检测等机制。
六、总结
Claude Tag的发布标志着Agent从"对话工具"进入"协作工具"阶段。对开发者来说,核心挑战不再是"AI能不能干活",而是"AI的权限怎么设计、怎么审计、怎么保障安全"。
Agent权限设计会成为未来3-5年最稀缺的技能之一。