Files
CASAN/.github/agents/protocols/tool-registry-policy.md
T
thanhnvandClaude Opus 4.8 18997caf49 docs: align all documentation with the new repo structure
Update agent protocols (.claude/agents, .github/agents), guides, runbooks and READMEs
to the post-restructure layout: .specify/{scripts,tests,security,config,templates,
governance,memory,level5-config} -> packages/casan-harness/...; docs/input +
golden-runs + traceability-map -> apps/okr/domain/...; drop AINative_OKR_CASAN5/ prefix.
Runtime-state paths (.specify/logs, .specify/agentops, .specify/level5/central-governance)
kept as-is. Historical evidence under docs/output/ left untouched (immutable run records).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 14:36:27 +09:00

2.2 KiB

Danh mục và Giao thức Quản lý Công cụ (Tool Registry Policy)

Giao thức này quy định danh sách trắng các công cụ và câu lệnh hệ thống (Tools & CLI Commands) được phép thực thi tương ứng với từng loại Agent để đảm bảo nguyên tắc đặc quyền tối thiểu (Least Privilege).

1. Danh sách trắng công cụ (Tool Whitelist per Agent)

A. Boss Orchestrator (okr.bossbuiltin)

Được phép điều phối và chạy toàn bộ các chuỗi công cụ chuẩn bị và kiểm thử:

  • Read, Write, Edit, Glob, Grep (IDE Tools)
  • Các script hỗ trợ: packages/casan-harness/scripts/bash/casan-harness.sh, security-check.sh, governance-check.sh, agent-metrics.sh
  • CLI Commands: npm install, npm run build, npm run start:dev, docker compose

B. Special Design/Specification Agents (srs, bd, specify, plan, dd, tasks)

Chỉ được phép làm việc trên các tệp tin tài liệu (Read-only on source code, Write-only on specification files):

  • Read (toàn bộ workspace)
  • Write, Edit (chỉ trên thư mục docs/ và specs/)
  • CẤM HOÀN TOÀN: Sử dụng công cụ Bash để thực thi shell command tùy ý.

C. Implementation Agent (speckit.implement)

Được quyền viết code và tự động xác minh lỗi:

  • Read, Write, Edit (trên toàn bộ workspace bao gồm backend/, frontend/)
  • Bash (chỉ giới hạn cho các lệnh: npm install, npm run build, npm test, npx prisma, git diff)

D. Testing & Quality Agent (okr.testkit, okr.reviewcode)

Được quyền chạy kiểm thử và review:

  • Read (toàn bộ workspace)
  • Bash (chỉ chạy lệnh kiểm thử: npm test, npm run test:cov, jest, mocha)

2. Quy tắc kiểm tra (Tool Access Guard)

  • Trước khi thực thi bất kỳ lệnh hệ thống nào thông qua Bash tool, script kiểm duyệt governance-check.sh sẽ phân tích cú pháp câu lệnh (Command Line Parsing).
  • Nếu lệnh chứa các từ khóa cấm hoặc hành vi gọi ứng dụng không nằm trong whitelist của Agent đang gọi, hành động sẽ bị Block và ghi nhận sự kiện vi phạm an toàn tool.