Restrict profiles per session: read-only, interactive-only and deny-list permissions
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- go
- 領域
- authorization, cli
調査の方向性
The issue points to docs/auth.md and describes changes to core auth resolution and verb dispatch, but does not name source files or tests. Start by reading docs/auth.md and tracing how the active profile and canonical command are resolved before request construction. Done means the policy rules are enforced with a distinct non-zero refusal code and the error identifies the profile, command, rule, and policy path; the open questions need decisions first.
索引モデルが issue の本文から書いたものです。
説明
Problem
Any process that can run harness can use every profile and run every command, including deletes. For production-like profiles, and for AI-agent or autonomous use, there is no way to say "this profile is read-only" or "this profile must not run unattended".
Proposed
A cooperative guardrail, not a security boundary: the CLI reads a policy file and refuses commands the active profile doesn't allow. It does not try to stop a process that is working around it (env var mode, direct API calls, other profiles).
Policy file
A TOML file next to the profile files (path TBD, e.g. ~/.harness/permissions.toml), edited by hand. [all] applies to every profile; a [<profile>] section adds to it.
[all]
deny_commands = ["delete project"]
[harness0]
read_only = true
interactive = true
[default]
deny_commands = ["delete repository"]
-
Per-profile options, each independent (a profile is not in a "mode"); a command runs only if every option and the deny list allow it:
read_only: only read verbs (list,get) run.executeis blocked unless listed inallow_commands(for read-type executes such ashql:run).interactive: refuses when stdin or stdout is not a terminal, so scripts, CI and agents can't use the profile.
-
deny_commands: commands not allowed under the profile, matched against the canonicalverb noun[:variant]. An entry is one of:- a literal command:
delete repository - a wildcard with
*:delete * - a regular expression wrapped in slashes:
/^(delete|update) (repository|branch)$/
- a literal command:
-
Deny lists from
[all]and the profile section add up; a profile section can't remove an[all]entry. -
Session profile is chosen the usual way (
export HARNESS_PROFILE=<name>); see docs/auth.md.
Enforcement
One check before the request is built, after noun aliases are resolved (repositories -> repository), so spec-driven commands and custom handlers are covered. A refusal exits with a distinct non-zero code.
Error message
One message for every reader (human, script or agent): which profile, which command, which rule blocked it, and where the policy file is. Example:
blocked: 'delete repository' is not allowed by profile 'harness0' (read_only) - see <policy file path>
Open questions
- Regex syntax (Go RE2), anchoring (whole command vs substring), and the
/.../delimiter for telling a regex from a literal. - Policy file name and location, and Windows path if supported.
- Exact exit code.
allowed_profiles(refuse--profileother than the pinned one) as a follow-up.- Whether
interactiveshould treat pipeline mode (docs/auth.md) as non-interactive and refuse. - Core change (auth resolution and verb dispatch); land before any module work.
Related: #157.
- 主要言語
- Go
- スター
- 29
- フォーク
- 24
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 111
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
harness/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
slavakurilyak/awesome-ai-agents#1137 ·
メンテナーはふだん 1 日以内に返信
-
Make the HTTP server's keep-alive and headers timeouts configurable対応中かも @mattgodbolt が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
compiler-explorer/compiler-explorer#9902 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
ready-for-agent
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
jordansmall/spindrift#7895 ·
メンテナーはふだん 1 日以内に返信
-
documentation priority: medium skill: intermediate status: ready for dev
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
hyperledger-labs/fabric-smart-client#2830 ·
メンテナーはふだん 1 日以内に返信