Repository navigation
프로젝트 설정의 보호 스위치로 에이전트의 위험한 작업을 실행 전에 막는다 - #1201
Merged
Merged
Conversation
The hook reads the per-machine guardrails policy (~/.hide/agent-hooks/guardrails.json) and refuses, in each runtime's own shape, a call that writes into another checkout, changes the base branch, runs a risky Git command or touches a protected path. Hook entries move to version 8 (guidance 5) to select the file tools, and the OpenCode, Pi and omp scripts start the helper for a file tool only while some project has a protection on.
The core writes the policy, empty when no protection is on, at every start and device connection, so a missing file is a fault the hook records once per ten minutes while the call runs (B21).
Call::GuardrailPolicy (protocol 33) replaces the policy file under the node's home, so the core can deliver Project Settings protections to the machine that owns the project, its own or a device.
…ject Project settings records carry the four protections as version 2 (a record without them stays version 1). A save that changes a machine's policy is written to that machine's node first and saved only after it answers; a failed delivery fails the save and writes the confirmed policy once more. The core rewrites its own machine's policy at start and a device's at each connection, and any persisted change to settings or registrations refreshes the policies it moves.
…project's guardrails A project the operator never registered is still guarded once its settings say so; removing a project clears its protections so it starts unguarded when added again.
Four protections with the merge option under the base branch one, the protected path list under the files one, the reason a plain folder cannot take the Git ones, and the agents this machine's hooks do not reach.
Cursor's file reads reach the pre-tool hook as Read, so the separate read-file event's payload was never sent.
…the policy lives, how it fails and what it costs
…ct outside a Herdr pane too - a branch named like a folder is a branch, a tree's paths after -- are paths, -R takes its value, and a fast-forward merge, a rebase, a mirror push and a pattern refspec are judged - untracked files count only for git clean; one git status per checkout and call, taking no lock - a nested repository is a folder of the checkout around it, so a submodule no longer locks an agent out - names compare with or without case as the folder does, judged without writing there - prose with a space is not a path, a listed example stays protected, a bare cd goes home, and the word limit no longer skips later git commands - a command named in another script no longer panics; a panic or a late payload leaves a throttled guard.failed line - path length counts characters, and a cut patch still names its files
… and in order A core on a relocated state folder writes nothing under ~/.hide, so a test or verification daemon never replaces the policy the operator's hooks read. Each write carries a rising sequence the node checks, a device that is not connected is written when it connects, a removed project's save on its way loses its protections, a worker that panics frees its machine, and a settings record keeps fields a newer build wrote.
…nd keep focus on the list The shape and character-length rules match the core's; a refusal that sending again cannot change offers no Try again; Escape closes the field without closing the dialog; a reopened receipt that saved shows nowhere.
…ne, the Windows PowerShell gap and the policy's ordering
… the Korean working-folder note
…_STATE_HOME too, write again past a node's newer sequence, and refuse an unknown protection - A core whose state folder is the one the account's hide picks with no HIDE_STATE_DIR (~/.hide/state, or $XDG_STATE_HOME/hide where that is set) writes this machine's guardrails policy; the host decides it (Env::account_state_folder) and passes it as CoreOptions::account_state_folder. Before, a set XDG_STATE_HOME meant no policy file was ever written. - The node answers a write below the sequence it holds with that sequence (superseded_by) instead of null; a core whose sequence fell behind it (another core, a clock set back) moves past it and writes again, its saves still waiting. - A change naming a protection this build does not know is refused project_settings_invalid_guardrails, so the policy every hook reads cannot grow from the shell.
…named with a space as a path, and keep guard-only scripts quiet without a policy - A git or gh command run inside a clone or submodule nested in a checkout works on that repository, which no protection guards; its files still take the checkout's protections. - A word with a space that does not exist is prose only when it is text: an option's value, what echo or printf prints, or the first pattern or script of grep, rg, sed, awk or jq. Elsewhere it is a path, so cp or touch cannot make a protected file by quoting a space into its name. - OpenCode's plugin and the Pi and omp extension outside a Herdr pane start no helper while the policy is missing or unreadable, and tell the helper they only guard (guard_only), so a nested agent's inherited pane variables bring no spawn or question guard.
…layer, and give focus back to the field after a refused add The shell answers Escape with its innermost layer, which was the Project Settings dialog, so Escape in the path field closed the whole sheet. The field now registers its own layer while open. A refused add re-enables the field and puts focus back in it with the typed text. The desktop e2e presses Escape in the real app and runs its daemon on the account's own state folder under the fixture's XDG_STATE_HOME.
…superseded answer, nested repositories, words with a space and guard-only scripts
… on the account's XDG state folder
… in a row, and keep a record's own unknown protection fields on a change - A machine's writes are one at a time, so any newer sequence a node answers is another writer's; the core retries on each, not only when it is above its own counter, which another machine's write could have moved. - Three superseded answers in a row fail the saves, so a node that always answers one cannot keep the worker writing; the sequence adds without overflow. - A change's guardrails keep the record's copy of fields a newer build wrote instead of refusing them: the shell sends back what it was shown, and nothing a change adds reaches the policy.
…_ variables, read an option's text value by its name, and resolve a relative working folder - git status ran a core.fsmonitor command the repository configures, with the operator's rights; it now runs with -c core.fsmonitor=false and without the hook's GIT_* variables. - A word with a space is text only after an option that takes text (-m, --message, --title, --body, -c, -e, a cluster ending in one, and their = forms), so touch -a 'a b.key' is a path and --message='x.pem' is text; a search's pattern slot skips its valued options. - A relative working folder from the payload is the hook's own, not itself.
…n fields, the text options and the status read's isolation
…or Git, the forges' CLIs, interpreters and searches A program path with a space reached a slice that panicked, and a panic lets the call run, so the rest of the line went unguarded. touch -m or curl -c before a new file name with a space no longer reads it as text; awk's -v and -F count as valued options.
… keep their pattern slot A shared list made rg -F 'load the api.key' read its pattern as a path and refuse. The interpreter test now ends in the protected name, curl -c joins the new-file cases, and the docs say an unknown program spelling reads its text as a path.
The `codex` runtime's PreToolUse matcher holds main's request_user_input_async beside the guardrails' file tools, at hook version 8, the one bump above main's 7; the trust test, the hook-bytes fixtures and agent-hooks.md read the joined matcher, and INSTALL.md keeps both new rows.
…it Bash on Windows needs them Unquoted, a Windows path's backslashes are escapes in a POSIX shell, so the test aimed git -C at a folder that does not exist on Windows; the hook reads the words as the shell runs them. agent-hooks.md says so beside the PowerShell gap.
… as that drive's Windows path On Windows a word such as /c/Users/x/repo/.env named no drive, so it resolved under the current drive's root, matched no project and let the call run. hide_platform::path::shell_drive_path converts the spelling, checked on every system; the hooks apply it on Windows, with a Windows test for the files and working-folder protections.
…rive mount spellings
Main's View feedback call took node protocol 33, so the guardrails' policy write moves to 34 in hide-node-link and ARCHITECTURE.md.
yansfil
added a commit
that referenced
this pull request
Oct 15, 2026
Related: PRD `agents/prd/overview-device-tasks/prd.md` · #1136 (먼저 들어간 Work 탭), #1127 (시안) ## Summary Overview가 프로젝트마다 따로 있던 화면(Project Overview, Issues 보드, Agents 그래프, 대화 기록)을 기기 하나의 한 페이지로 바꿉니다. 탭은 `Tasks · 백로그 · Projects`입니다: 일감(루트 에이전트와 그 자손, 워크트리, PR)을 프로젝트별 카드로, 백로그를 프로젝트의 이슈 출처 하나(GitHub 이슈 또는 메모)로, 프로젝트 상태와 디스크를 한 줄씩 보여 줍니다. 백로그는 양식 없이 바로 쌓입니다: 입력칸, `⌘⇧M` 빠른 추가, 세션 기록의 놓친 일 `백로그로`. GitHub에는 제목만 가고, 끊긴 응답을 다시 시도해도 이슈는 하나만 생깁니다. `되돌리기`는 시작 전이고 Hide가 만든 항목에만 있습니다: 메모는 지우고, Hide가 만든 이슈는 닫고, 남이 만든 이슈는 core가 거절합니다. 에이전트 pane 머리(상태 점, 로고, 제목)를 누르면 그 세션 기록이 레인에 열리고 키보드는 터미널에 남습니다.  ## Review - **판단해 주세요**: Tasks 카드의 정보 밀도(첫 줄 상태와 제목, 둘째 줄 자식 · PR · 항목 칩, 셋째 줄 단계 막대)가 한눈에 읽히는지. - **판단해 주세요**: 놓친 일 `백로그로`는 놓친 문장을 그대로 GitHub 이슈 제목으로 씁니다. 공개 저장소면 버튼에 `공개`, 모르면 `공개일 수 있음`이 붙습니다. - **조심해서 볼 파일**: `herdr-core/src/runtime/backlog.rs` - failure path. GitHub 쓰기, 재시도 수렴, 큐 상한, 되돌리기의 core 거절. - **조심해서 볼 파일**: `herdr-core/src/links/ledger_store.rs` - 만들기 기록이 재시작과 core 이동 뒤에도 "Hide가 만든 이슈"의 근거입니다. - **조심해서 볼 파일**: `herdr-core/src/agent_state/tally/` - runtime mutex 안의 일. 일감 투영과 디스크 측정이 lock 밖에서 도는지. - **조심해서 볼 파일**: `herdr-core/src/runtime/backlog.rs`의 `spawn_backlog_worker` - 모든 백로그 워커가 이 하나로 돌고, panic도 실패 답으로 끝나 칸이 `working`에 남지 않습니다. - **조심해서 볼 파일**: `hided/src/demand.rs`의 `OriginHolds` - 창마다 연 항목 출처를 세고(창당 8), 마지막 창이 놓거나 연결이 끊길 때만 core에 닫기를 보냅니다. - **조심해서 볼 파일**: `herdr-core/src/runtime/session.rs`의 `resync_navigator_focus` - 저장된 선택이 없을 때의 시작 checkout. 노드가 없다고 답한 폴더만 건너뛰고, 모두 없으면 예전처럼 첫 checkout. - **조심해서 볼 파일**: `hide-node-link/src/protocol.rs` - Herdr/core ownership. node protocol 35(main의 33 `feedback`, 34 `guardrail_policy` 다음), 지운 호출. - **비용 검토**: 디스크 측정은 Projects 탭이 보일 때만 기기별로 차례로 돕니다. 일감 투영은 스냅샷 입력이 바뀔 때만 다시 계산합니다. ## Evidence - **확인한 것**: `cargo test`와 lint 통과(herdr-core, hided, hide-node-link nextest, `sasu verify` 최종 head PASS). 웹 vitest 1590개, 데스크톱 typecheck · lint · unit, 디자인 계약 검사 통과. - **확인한 것**: 웹 e2e 72개(겹치는 스펙 전부)와 데스크톱 e2e 14개가 #1136 병합 전 head에서 통과. 최종 head(4648838)에서 다시 빌드한 셸로 영향 받은 스펙 10개 파일 50개 테스트 통과(lane-last-tool, overview-device, overview-modal, s2, s6, s7, interface-language, session-panel, session-work-ledger, work-prs). - **확인한 것**: 실제 GitHub(테스트 저장소)에서 제목만 있는 이슈 생성, 끊긴 응답 뒤 재시도가 같은 이슈로 수렴, 되돌리기가 그 이슈를 닫음. 만든 이슈는 모두 닫음. - **확인한 것**: 리뷰(요구사항, 코드, 보안)의 수정 항목은 모두 고쳤고, 새 core 테스트는 각각 수정을 빼면 실패함을 확인. - **디스크**: 10-16 새벽 이 Mac 디스크가 가득 차(여유 1-6 GB) 로컬 검증 두 번이 빌드 공간 부족으로 멈췄고, 공간이 난 뒤 최종 head에서 `sasu verify`(전체 Rust 테스트와 lint)가 통과했습니다. - **부하 실패**: load average 25-30에서 hided `node_session_activity::serve_preserves_kit_protocol_alongside_activity`(새 프로세스 EAGAIN, 두 번)와 hide-host `gh::tests::timed_out_gh_and_its_pipe_holding_helper_are_terminated`(3초 안에 셸이 pid를 못 씀, 한 번), hide-ai `search_path::claude_found_by_name_answers_its_probe_its_usage_read_and_its_request`(`auth_deadline`, 한 번)가 실패했고, 혼자 돌리면 각각 3/3 통과합니다. 이 PR은 세 테스트와 그 코드를 건드리지 않습니다. CI 결과는 아래 댓글로 남깁니다. - **CI 빨강 세 개 고침(4648838)**: (1) policy checks: `web/e2e/shard-durations.json`이 지운 s8 테스트 둘을 아직 적고 있었음(246f360). (2) web e2e `agent-tab-names`: 기록 버튼이 로고를 `aria-hidden`으로 만들어 `Claude Code` 이름으로 로고를 못 찾음. 로고가 버튼 안에서도 제 제품 이름을 갖게 함(5455c78). 로컬 web e2e `agent-tab-names`, `overview-device` 5개 통과. (3) desktop e2e `restoration`: 저장된 선택이 없을 때 창이 catalog의 첫 checkout에서 시작하는데, 닫혀 있는 동안 폴더가 옮겨진 탭은 활동 없는 자기 프로젝트 행으로 남고, 그 순서는 경로 해시 id로 정해져 절반쯤 그 빈 프로젝트에서 시작했음. main에서도 core는 같은 확률로 그 폴더를 골랐고 사이드바가 `fixture`를 위에 그려 가려졌을 뿐임. 이제 시작은 노드가 없다고 답한 폴더의 checkout을 건너뜀(fd318e2). 고치지 않으면 실패하는 core 테스트 `a_start_with_nothing_saved_skips_a_checkout_whose_folder_is_gone`를 더했고, 스펙은 다시 사이드바 첫 프로젝트를 열며 로컬 8/8 통과(고치기 전 약 절반 실패). - **main 병합(183330c, 다시 #1201 뒤)**: 충돌 해결. node protocol은 main이 33(`feedback`)과 34(`guardrail_policy`)를 먼저 써서 이 브랜치가 35로 올림. #1201 뒤 병합에서 project-settings와 restoration 데스크톱 스펙 4개, protocol · guardrail Rust 테스트 14개 통과. 병합 뒤 web typecheck · lint · vitest 191개 파일, desktop lint, `cargo check --workspace --tests`, protocol · workspace_view 대상 Rust 테스트 65개, `scripts/tests` 361개, 디자인 계약, Herdr 계약 통과. 디스크가 공유되고 거의 차 있어 전체 nextest와 전체 e2e는 로컬에서 다시 돌리지 않았고 CI가 대신합니다. - **확인하지 못한 것**: Windows · Linux CI lane은 이 PR의 CI가 처음입니다. Neutral 테마에서 새 화면을 캡처하지 않았습니다(토큰만 씀을 코드로 확인). - **확인하지 못한 것**: 일감 카드의 PR은 살아 있는 에이전트 행에서 가져옵니다(B10). Pen에서 incoming 카드의 점선이 실선이고, pane 머리 버튼과 놓친 일 `백로그로` 줄은 Pen 시트에 없습니다. - **스크린샷**: 개발 빌드의 gallery `overview` 장면(`/gallery?scene=overview`)이 지어낸 기기 데이터 위에 실제 컴포넌트를 그린 것입니다. 실제 앱에서 같은 화면을 찍은 것은 아닙니다. - **생성물**: `design/hide-screens.pen`, `design/hide-ui.lib.pen`은 `scripts/gen-pen.mjs`, `scripts/gen-screens.mjs`가 다시 만든 파일입니다. <details><summary>화면 더 보기</summary>     </details> <details><summary>후속으로 남긴 것</summary> - 개발 빌드(StrictMode)에서만 레인의 세션 기록이 열리자마자 닫힙니다(기록이 사라질 때 대상을 지우는 정리, main에도 있던 방식). 배포 빌드에서는 핀, 핀 풀기, overlay 폭으로 좁히기를 거쳐도 기록이 남는 것을 e2e로 확인했습니다. - 여러 볼륨 기기의 디스크 여유와 전체가 다른 볼륨에서 올 수 있습니다. - Hide AI 집 에이전트의 자식은 부모가 목록에 없으니 혼자 일감 카드가 됩니다(Needs You일 때만). 부모 아래로 묶을지는 제품 판단입니다. - `data-pane-record`는 이제 테스트만 읽습니다. - 옮길 때 옛 세션 검색 저장소의 보관 기간 행을 상한 없이 읽습니다(운영자 자신의 파일이고 더 늘지 않음). </details> ## Breaking change - **node protocol 35**: 기기 helper가 34 이하면 Hello에서 거절되고 다시 설치됩니다. 기기를 연결해 둔 운영자는 앱 업데이트 뒤 기기 재설치를 한 번 거칩니다. - **대화 기록(Conversation history) 화면과 지난 대화 검색이 없어집니다**: 옛 `session-search.sqlite3`는 지우거나 고쳐 쓰지 않고, 그 안의 프로젝트별 보관 기간만 계속 읽습니다. - **`⌘⇧A`(사이드바 Agents 모드)가 없어집니다**: 저장된 단축키 설정의 그 키는 무시됩니다. - **Project Overview, Issues 보드(List, Dependencies, 완료 열), Agents 그래프가 없어집니다**: 같은 일은 기기 Overview와 오른쪽 레인이 합니다. <details><summary>Verification record</summary> - PRD: `agents/prd/overview-device-tasks/prd.md` (sha256 2c893df06ec44334ffa009a55013f3bbe3e004315a8df7b3df630351a4d7f3c0) - Base 585cd94 → head 4648838, verified 2026-10-15T16:16:09.193Z: PASS - Verification report: `agents/runs/overview-device-tasks/verification-report.json` and `agents/runs/overview-device-tasks/verification-report.md`; source fingerprint f45c399faf2a9dd461a9e1df8af39c5901d241d51480925e5ccfbb7f39fab571 - Suites: - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0) - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0) - Reviews (advisory): - Set 1 and set 2 (Fidelity, Code, Security) on ef81439: every Fix-now item fixed (reconcile adopts only the account's own issue, creates pinned to the attempt's repository, undo refused for issues Hide did not make, one event per 무시, origin release); a follow-up review on 42d5244 found unbounded eviction of unconfirmed creates, fixed in 88d3d4a (32 pending cap, `QueueFull`), re-review clean. - Merge-resolution set (Fidelity, Code, Security) on a4c2376: no Fix-now items; an orphaned doc comment was moved in 22afeb6. - Merging main after #1136 (0a4f557): a record opened while Work was left on PRs did not show; opening a record now turns Work to Sessions in the same lane event (ed43951). The main merge also needed the landing scene to drop retired ui fields (bab54b0) and the core store-touch counts to include the D-20 retention reads (2da0ef3). - Fidelity+Code and Security on aab1374: one Fix-now, `lane에서 보기` read the lane of the checkout left behind, fixed in a30b12c (the lane event is always sent on a checkout switch; unit test fails without it). Security: no Fix-now. - After the Observer check: the Tasks project head's Open and backlog links inherited the heading's 16px; now in the head's caption size (1c3c34b, s6 asserts it). CI found the e2e size baseline still listing the removed s8 Sessions test (e338862). New Overview gallery scene for the screenshots (0e4cfdc, 2836bdd) and the empty Tasks section's 새 에이전트 translation (426ba93). - Observer letter-6364 fixes (feea125, e20e5b2, 2505582, 6c93ca7, 3778ca8, f30498b, 76225fe), then a review set on them: Security no Fix-now; Code one Fix-now, a WebSocket reconnect dropped an open panel's origin, fixed in f637b59 (re-read on live). Follow-ups fixed in the same push: the last close reaches the core under the holds lock (1f4a7a0), empty or overlong keys refused (1f4a7a0), origin cap logged instead of a screen error, a second window no longer blanks a shown turn, an unrecorded put-away logged (4648838), NowCell doc comment (074e2eb). - CI on 4648838: the record button hid the logo from assistive tech, so `agent-tab-names` could not find it by its product name; decision: the logo keeps `role="img"` and its product name inside the button, leaving the agent-mark-quiet contract and spec unchanged (5455c78). - Evidence: none registered separately. - Changed paths: 314 (see Files changed) - Delivery: mode pr, branch `gen-prd/overview-device-tasks`, base `main` </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #1073 (Project Settings, 이 미지원 두 줄을 둔 PR)
Summary
Review
/please위임). 아래는 권장안으로 진행한 판단이다.git pull --rebase와rebase(기준 브랜치),git switch -f(작업 삭제), Cursor의 Delete와 MultiEdit 도구.hide-agent-hooks/src/bin/hide-agent-hooks.rs,src/guardrails.rs,src/guardrails/git.rs- high-frequency path: 모든 에이전트의 파일 읽기·수정 호출이 거침herdr-core/src/runtime/guardrails.rs- runtime mutex: 잠금 아래는 정책 값 계산만, 전달은 owned worker, 재시도 3회 상한hide-host/src/serve.rs,hide-node-link- 기기 wire:Call::GuardrailPolicy, PROTOCOL 34hide-agent-hooks/src/install.rs,src/codex_trust.rs- 운영자 소유 훅 파일: matcher에 파일 도구 추가, HOOK_VERSION 8,Codex CLI재신뢰/usr/bin/true보다 3-5 ms 높음).git status는 변경을 지우는 명령일 때만, fsmonitor를 끄고GIT_*환경을 지운 채 돈다.Evidence
sasu implement verifyPASS:verify-cargo.sh test,lint(main 병합 커밋 기준)verify-web.sh: web 1668, desktop 185 테스트와 디자인 계약, 귀속 표기, 워크스테이션 식별, Herdr pin, core 경계 검사Claude Code(pane 밖 포함),Codex CLI,Cursor,OpenCode,Pi,omp/c/...,/cygdrive/c/...)가 보호 파일 판단을 비껴가던 문제를 찾아hide_platform::path에서 풀게 했다Codex CLI신뢰, hook-bytes fixture, 문서) 해소 뒤 hide-agent-hooks 전체(codex_trust, Windows hook command, plugin JS) 통과Breaking change
Codex CLI세션은 'Hooks need review'를 한 번 볼 수 있다.Verification record
agents/prd/agent-guardrails/prd.md(sha256 e4e785c518c2def78942fabc1787a111c3dabaa243a25738201fe931dbd8f6d7)agents/runs/agent-guardrails/verification-report.jsonandagents/runs/agent-guardrails/verification-report.md; source fingerprint 8fe14a987b81eb57a01eec51a6b82b496b399b367779ead44f7178648c7b9dc1bash scripts/verify-cargo.sh test(exit 0)bash scripts/verify-cargo.sh lint(exit 0)git statusran the repository's fsmonitor and inheritedGIT_*; now disabled and cleared.grep -Tover-refusal, a save stays "saving" after a worker panic, stale comments atcodex_trust.rs:425andinstall.rs:909, duplicate case atcodex_trust.rs:1081/1087,install.rs:1154"earlier" case is not main's v7 matcher.spec/agent-guardrails, basemain