Skip to content

feat(hooks): honor project allow rules only from trusted owners #32

Closed

Description

@furedea-agent

プロジェクトの .agents/hooks/rules/allowed_commands.json は,今はどのリポジトリのものでもそのまま取り込まれる.他人のリポジトリを開くと,その許可で sandbox の外に影響する操作まで確認なしになりうる.
信頼する持ち主の一覧をファイルに置き,その持ち主のリポジトリ(fork を除く)の許可だけを取り込む.

リポジトリ 現在 期待
持ち主が一覧にある(fork でない) 取り込む 取り込む(変わらない)
持ち主が一覧にない 取り込む 取り込まず,効いていないことを知らせる
一覧の持ち主の fork 取り込む 取り込まず,知らせる
持ち主や fork かどうかが分からない 取り込む 取り込まず,知らせる

受け入れ条件

  • agents/hooks/rules/trusted_owners.json に {"owners": ["furedea"], "exclude_forks": true} を置く.書式と中身をテストで検査する
  • 持ち主は,リポジトリの origin の URL から決める(フォルダの場所は使わない)
  • fork かどうかは GitHub から調べ,結果を hook の状態ディレクトリに覚えておく.調べられないときは信頼しない
  • 取り込まないときは,その理由と「agent-config の trusted_owners.json に足せば効く」ことを 1 度知らせる
  • 止める規則(forbidden_commands.json)は,持ち主に関係なく今までどおり取り込む
  • 表の 4 つの場合それぞれに,修正前に失敗するテストがある
出典

Activity

  1. added a commit that references this issue on Oct 24, 2026
    305d391
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions