Skip to content

feat: add cdk, lsof, go, mcp-atlassian, pnpm policies + expand npx/npm#10

Open
3stacks wants to merge 6 commits into
brycehans:mainfrom
3stacks:feat/new-policies
Open

feat: add cdk, lsof, go, mcp-atlassian, pnpm policies + expand npx/npm#10
3stacks wants to merge 6 commits into
brycehans:mainfrom
3stacks:feat/new-policies

Conversation

@3stacks

@3stacks 3stacks commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds five new built-in policies and broadens two existing ones, then bumps to 0.5.0.

New policies

  • allow-go — read-only Go subcommands (build, vet, version, etc.)
  • allow-mcp-atlassian — Atlassian MCP read tools
  • allow-pnpm-package-script — pnpm scripts declared in the project's package.json
  • allow-lsoflsof for inspecting open files / sockets / ports
  • allow-cdk — read-only CDK subcommands (ls, diff, synth, doctor, context, metadata, notices); deploy, destroy, bootstrap, import, migrate, rollback, and watch fall through to prompt since they mutate live infrastructure

Expanded policies

  • allow-npx-safe — adds tsc and typescript (typechecking is read-only)
  • allow-npm-install — switches to safeBashCommandOrPipeline so npm ci 2>&1 | tail -5 no longer prompts

Other

  • Expands PURE_COMMANDS in parse-bash-ast.ts (clear, date, env, hostname, id, printenv, uname, uptime, which, whoami)

Test plan

  • bun test — 1381 tests pass
  • New policies have dedicated test files covering allow / require-approval / reject-chaining cases

3stacks and others added 6 commits May 9, 2026 08:46
…e commands

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- New allow-lsof policy permits lsof inspection (ports, PIDs, files), with safe pipeline support
- Add tsc/typescript to npx safe-package allowlist for typechecking
- Switch allow-npm/pnpm/yarn install to safeBashCommandOrPipeline so `npm ci 2>&1 | tail -5` works

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Auto-allows informational cdk commands (ls, diff, synth, doctor, context,
metadata, notices); deploy, destroy, bootstrap, import, migrate, rollback,
and watch fall through to prompt since they mutate live infrastructure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The AWS CLI policy previously only matched profiles passed via --profile.
Shells that export AWS_PROFILE (a common workflow) fell through to a
permission prompt even for ReadOnly profiles, and Admin profiles weren't
gated at all. Profile resolution now falls back to call.context.env.AWS_PROFILE
when no flag is set, matching AWS CLI's own precedence (flag wins over env).

Bumps to 0.7.0. Adds six tests covering ReadOnly/Admin via env, destructive
override, flag-wins-over-env, and unknown-profile fall-through.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- ASK verdict short-circuits the policy chain like allow/deny, emitting
  permissionDecision='ask' to force a prompt regardless of settings.json
  auto-allows. Used by ko-work's "Ask before Xero writes" project policy.
  Exposed as ask(reason?) helper from src/index.
- New built-in policies:
  - allow-docker-read-only, allow-docker-compose-exec-mysql-readonly,
    allow-docker-compose-exec-tests for non-destructive docker use
  - allow-subshell-cd-test for cd-in-subshell patterns used by tests
  - allow-toolgate-cli-readonly for toolgate's own read-only CLI subcommands
  - allow-rm-project-tmp expanded for additional temp paths
- runner.ts now logs every NEXT-verdict tool call to
  ~/.claude/permission-requests.jsonl for audit visibility.
- Version 0.7.0 -> 0.10.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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