Skip to content

feat(amp): emit amp.permissions for allow/ask/argument-specific deny#2043

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-2000-amp-permissions
Jun 25, 2026
Merged

feat(amp): emit amp.permissions for allow/ask/argument-specific deny#2043
dyoshikawa merged 2 commits into
mainfrom
resolve-scrap-issue-2000-amp-permissions

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Background

Follow-up to #2000. The Amp permissions adapter mapped only whole deny rules onto amp.tools.disable, so allow/ask rules were silently dropped and argument-specific deny patterns collapsed to a whole-tool disable.

Per the maintainer decision (option c), this emits amp.permissions only for the lossy cases while keeping amp.tools.disable for whole-tool deny.

What changed

  • Export: deny+star stays in amp.tools.disable; argument-specific deny becomes a reject entry with matches.cmd; allow/ask become amp.permissions entries. Entries ordered fail-closed and specific-before-catch-all for first-match-wins.
  • Existing delegate entries preserved verbatim, placed after rulesync-owned entries.
  • Import reads both amp.tools.disable and amp.permissions back (reject->deny, allow->allow, ask->ask; delegate skipped); deny wins on conflict.
  • Prototype-pollution hardening.
  • Tests, docs with the legacy/backwards-compat caveat.

Closes #2000

Generated with Claude Code

cm-dyoshikawa and others added 2 commits June 24, 2026 07:55
Closes #2000

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Emit every reject before every ask before every allow as the primary sort key, so a catch-all allow on a glob tool name (e.g. mcp__*) cannot shadow a more specific reject (e.g. mcp__github) under first-match-wins. Add a regression test.
@dyoshikawa dyoshikawa merged commit a300c47 into main Jun 25, 2026
8 checks passed
@dyoshikawa dyoshikawa deleted the resolve-scrap-issue-2000-amp-permissions branch June 25, 2026 00:59
@dyoshikawa

Copy link
Copy Markdown
Owner Author

@dyoshikawa Thank you!

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.

Follow up Amp upstream updates: emit amp.permissions (allow/ask/reject) instead of dropping non-deny rules

2 participants