Skip to content

fix(spawn): give claude crewmates a safe permission allowlist - #380

Closed
mperaltamews wants to merge 1 commit into
kunchenguid:mainfrom
mperaltamews:fm/crew-autonomy-fix
Closed

mperaltamews wants to merge 1 commit into
kunchenguid:mainfrom
mperaltamews:fm/crew-autonomy-fix

Conversation

@mperaltamews

Copy link
Copy Markdown

Summary

  • `claude --dangerously-skip-permissions` is confirmed broken on this machine: crews still get a per-command approval prompt for every tool call, stalling autonomous work (data/learnings.md 2026-07-09 entry).
  • The captain explicitly does not want full bypass permissions even if they worked (no guardrail against rm -rf, network egress, sudo, etc).
  • Adds bin/fm-crew-permissions.json: a curated permissions.allow list of safe, worktree-contained Bash(...) patterns (git read/status/add/commit/checkout, file inspection, build/test/lint tooling for bun/npm/go/cargo/python, read-only gh pr/gh issue/gh repo lookups).
  • bin/fm-spawn.sh's claude launch path now merges this allowlist (via jq -s '.[0] * .[1]') into the worktree's .claude/settings.local.json alongside the existing Stop-hook turn-end signal, instead of clobbering it. Falls back to the old Stop-hook-only write if jq or the permissions file is unavailable.
  • Explicitly NOT allowlisted: rm -rf, sudo, curl/wget/network egress, git push*, git merge*, gh pr merge* — those still prompt for a human.

Test plan

  • bash -n bin/fm-spawn.sh — syntax OK
  • Verified the jq merge produces both permissions.allow and hooks.Stop in one settings file
  • Live-tested with claude -p in a scratch dir using the generated settings.local.json:
    • git status → ran with zero permission_denials
    • curl -s https://example.com → blocked, permission_denials populated, confirming deny-by-default still holds for anything not on the list

--dangerously-skip-permissions is confirmed broken on this machine (still
prompts per tool call, stalling autonomous work; see data/learnings.md
2026-07-09). Rather than chase bypass mode - which the captain doesn't want
even working, since it has no guardrails - merge a curated allow list
(bin/fm-crew-permissions.json) into each claude worktree's
.claude/settings.local.json alongside the existing Stop-hook turn-end signal.

Allowlisted: read-only/worktree-contained git, file, and build/test/lint
commands. Still gated: network egress, git push/merge, gh pr merge, sudo,
rm -rf, and anything else not on the list.

Verified live: `git status` runs with zero permission_denials under the
allowlist; `curl` is blocked with a permission_denials entry, confirming
the deny-by-default backstop still holds for anything not listed.
@mperaltamews
mperaltamews deleted the fm/crew-autonomy-fix branch July 9, 2026 14:21
@mperaltamews

Copy link
Copy Markdown
Author

Sorry, firstmate went above and beyond with this PR :D

zeeshaanahmad added a commit to zeeshaanahmad/firstmate that referenced this pull request Aug 13, 2026
…#2)

* fix(brief): guard no-mistakes ship briefs against unreachable-CI wedges

no-mistakes' ci step polls for a check result with no reachable end
condition when the forge can never report one, wedging the run for its
full timeout while holding branch custody
(kunchenguid/no-mistakes#475, kunchenguid#666, kunchenguid#380 - open, unfixed upstream).

Add bin/fm-ci-probe.sh, which derives none/present/unknown from the
forge's own actions/runs history for a given repo, and wire every
generated no-mistakes ship brief to run it before starting the pipeline:
skip ci on "none", proceed normally on "present", and refuse to guess
on "unknown".

* no-mistakes(document): docs(scripts): list fm-ci-probe.sh in bin/ toolbelt inventory
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