Skip to content

security(agents): restrict read-only auditors to read-only Bash usage#735

Merged
kcenon merged 1 commit into
developfrom
security/issue-733-readonly-bash-guard
Jun 13, 2026
Merged

security(agents): restrict read-only auditors to read-only Bash usage#735
kcenon merged 1 commit into
developfrom
security/issue-733-readonly-bash-guard

Conversation

@kcenon

@kcenon kcenon commented Jun 13, 2026

Copy link
Copy Markdown
Owner

변경 내용

read-only 감사 에이전트 4개(code-reviewer, dependency-auditor, qa-reviewer, test-strategist)의 본문에 ## Tool Constraints 섹션을 추가하여, Bash를 읽기 전용 진단 명령으로 제한함을 명문화했다(plugin/ + project/ 두 레이어, 총 8개 파일).

배경

이 4개 에이전트는 description·본문상 "reports findings" 순수 read-only 역할인데 tools에 무제한 Bash를 보유한다. 무제한 Bash는 파일 쓰기(>, sed -i), 네트워크 호출(curl), 패키지 설치까지 허용하므로 read-only 계약과 모순되고 최소 권한(least-privilege) 원칙을 위반한다. 특히 dependency-auditornpm audit / pip-audit은 설치나 lockfile 변경을 유발할 여지가 있다. permissionMode가 미설정이라 allow된 환경에서는 별도 가드가 없다.

구현

  • code-reviewer / qa-reviewer / test-strategist (6파일): 공통 가드 — Bashgit diff, git log, linter, tsc --noEmit 같은 읽기 전용 진단 명령으로 한정하고, 파일 수정·패키지 설치·네트워크 호출 금지를 명시.
  • dependency-auditor (2파일): audit 실행이 본질이므로, npm audit --package-lock-only · 설치 없는 pip-audit · 읽기 전용 cargo audit 등 부작용 없는 플래그를 표준으로 명시하고, 설치·lockfile 변경·파일 쓰기·읽기 전용 취약점 DB 조회 외 네트워크 호출을 금지.
  • 각 에이전트의 ## Reporting 섹션 바로 앞에 삽입했고, plugin/project 사본에 동일 텍스트를 적용했다.

검증

  • grep "## Tool Constraints" → 대상 8개 파일만 매칭(나머지 4개 에이전트 미변경)
  • scripts/check_agents.shcheck_agents: OK (8 agent pairs in sync) (sandbox OFF 기준)
  • tools / permissionMode 등 frontmatter는 변경하지 않음

비고

적대적 검토(skeptic) 반영: qa-reviewerBash 전면 제거(과도)와 전역 settings.json 개입(범위 확대)은 의도적으로 배제하고, 4개 에이전트에 동일한 본문 가드 명문화로 통일했다.

Closes #733
Part of #726

code-reviewer, dependency-auditor, qa-reviewer, and test-strategist held unrestricted Bash while being read-only reporters, allowing file writes, network calls, and package installs (least-privilege violation). Add a Tool Constraints section to each of the four agent bodies in both layers, limiting Bash to read-only diagnostic commands; dependency-auditor additionally standardizes side-effect-free audit flags. tools and permissionMode are unchanged.
@kcenon kcenon merged commit 98940d6 into develop Jun 13, 2026
1 check passed
@kcenon kcenon deleted the security/issue-733-readonly-bash-guard branch June 13, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant