openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Document action sandbox vs internal-workspace split in CLAUDE.md

Open CodeGhost21 opened this issue 6 months ago • 0 comments

Summary

Document the action sandbox vs internal-workspace split in CLAUDE.md so contributors discover the rules without reading SecurityPolicy source. Add a short subsection (under "Configuration" or "Command permission model") that names Config.action_dir, Config.workspace_dir, the OPENHUMAN_ACTION_DIR env override, and which dirs the agent is blocked from touching.

Problem

#3051 acceptance criterion 4 mentions documentation, and the issue's "Related" section explicitly lists CLAUDE.md as the contributor-facing entry point. PR #3074 shipped the code split (action_dir, workspace_dir, internal-state denylist) but did not touch CLAUDE.md: grep action_dir CLAUDE.md returns nothing.

Concrete effect: a new contributor reading CLAUDE.md sees the existing "Agent access mode" section describing workspace_only, trusted_roots, default_projects_dir — but no mention of action_dir. They reasonably conclude that Config.workspace_dir is still where the agent operates, which is wrong post-#3074. The autonomy/security paragraph also still says "The default projects home is ~/OpenHuman/projects (config::default_projects_dir...) — distinct from the hidden internal ~/.openhuman/workspace." That's now incomplete: the action sandbox path the tools actually use is Config.action_dir, which defaults to default_projects_dir() but is independently configurable.

Solution (optional)

In CLAUDE.md, under "Configuration → Agent access mode":

  1. Add Config.action_dir to the list of relevant config knobs, with the env override OPENHUMAN_ACTION_DIR.
  2. State plainly: "Acting tools (shell, node_exec, npm_exec, file_write, edit_file, apply_patch, git_operations) resolve relative paths and default CWD to action_dir, not workspace_dir. workspace_dir is reserved for internal product state."
  3. List the blocked internal subtrees (memory, sessions, vault, etc.) — pointing at is_workspace_internal_path in src/openhuman/security/policy.rs:1097 as the source of truth.
  4. Note that overriding OPENHUMAN_ACTION_DIR does not affect the internal denylist — workspace_dir is always blocked even if it happens to live under the action root.
  5. Cross-reference default_projects_dir() as the default value of action_dir, and clarify that ~/OpenHuman/projects is both the trusted root and the default action sandbox.

Acceptance criteria

  • [ ] CLAUDE.md documents action_dir — config field, env override, role.
  • [ ] Tool routing rule stated — "acting tools default CWD to action_dir, not workspace_dir."
  • [ ] Internal denylist listed — the blocked subtrees and the source of truth (is_workspace_internal_path).
  • [ ] Default-vs-override relationship clear — action_dir defaults to default_projects_dir() but is independently configurable.
  • [ ] Diff coverage ≥ 80% — the implementing PR meets the changed-lines coverage gate (Vitest + cargo-llvm-cov, enforced by .github/workflows/pr-ci.yml). (N/A if changes are docs-only — call out in the PR description so the bot allows it.)

Related

  • Parent issue: #3051
  • Implementing PR: #3074
  • Audit: this is gap #5 — supports criterion 4 (Projects alignment) and criterion 1 (Separate roots) documentation.
  • Files: CLAUDE.md (root), src/openhuman/security/policy.rs, src/openhuman/config/schema/types.rs, src/openhuman/config/schema/load.rs.

CodeGhost21 avatar Jun 02 '26 21:06 CodeGhost21