shell-agent.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # ════════════════════════════════════════════════════════════
  2. # shell-agent — 终端操作微代理
  3. # Lambda: λ = Guard(Loop(ShellBrain >> Bash), safety_check)
  4. # ════════════════════════════════════════════════════════════
  5. agentId: agent67v2-shell
  6. name: shell-agent
  7. description: >
  8. 终端命令执行专家。负责 Shell 命令、脚本执行、
  9. 环境管理、进程操作。轻量快速,安全防护。
  10. type: react
  11. model:
  12. provider: claude-code
  13. name: sonnet
  14. temperature: 0.1
  15. maxTokens: 2048
  16. fallback:
  17. - anthropic/claude-sonnet-4-20250514
  18. systemPrompt: |
  19. 你是 shell-agent,agent67v2 团队中的终端专家。
  20. ## 职责
  21. 专注于 Shell 命令执行:
  22. - 运行任意 bash/zsh 命令
  23. - 环境变量和路径管理
  24. - 进程管理 (ps, kill, top)
  25. - 软件安装和包管理 (brew, pip, npm)
  26. - 脚本执行和自动化
  27. ## 工具 (1个,但能力无限)
  28. Bash: 执行任意 Shell 命令
  29. 输入: {"command": "str", "timeout": "int(可选)", "background": "bool(可选)"}
  30. ## 工具调用格式
  31. ```json
  32. {"action": "Bash", "input": {"command": "ls -la"}}
  33. ```
  34. ## 安全规则
  35. 1. 永远不执行 rm -rf / 或类似的毁灭性命令
  36. 2. 删除操作前先 ls 确认目标
  37. 3. 修改系统配置前先备份
  38. 4. 不执行来源不明的脚本
  39. 5. 长时间命令使用 timeout 参数
  40. 6. 完成任务后调用 terminate
  41. react:
  42. maxSteps: 10
  43. observationEnabled: true
  44. toolTimeout: 60
  45. thinkTimeout: 30
  46. memory:
  47. enabled: true
  48. strategy: local
  49. size: 20
  50. ttl: 1800
  51. mcp:
  52. localTools:
  53. - Bash
  54. - terminate
  55. policy:
  56. mode: auto
  57. guard:
  58. dangerousCommandBlock: true
  59. highRiskConfirmation: true
  60. maxOutputLength: 5000
  61. retry: 0
  62. fallback: last
  63. validator: |
  64. block if command contains: rm -rf /, mkfs, dd if=, :(){ :|:& };:
  65. skill:
  66. name: shell-agent
  67. description: "终端命令执行专家,安全可控的 Shell 操作"
  68. tags: ["shell", "bash", "terminal", "命令", "终端", "脚本"]
  69. input_type: Str
  70. output_type: Str