Skip to content

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

Description

@dyoshikawa

Summary

rulesync's Amp permissions adapter only emits amp.tools.disable (a coarse disable-only list), so allow and ask rules are silently dropped and argument-level patterns are collapsed to the bare tool name. Amp has a richer declarative permission model (amp.permissions) that can express all three actions plus argument matchers, which rulesync does not emit.

Recent Releases

Gaps

  • permissionsproject + global (partial / lossy). Upstream amp.permissions is an array of entries { tool, matches: { cmd }, action } where actionallow | reject | ask | delegate, supports tool-name wildcards (*, mcp__*) and per-argument glob matchers (matches.cmd), first-match-wins. rulesync's src/features/permissions/amp-permissions.ts maps only denyamp.tools.disable[] (tool name), dropping allow/ask rules with a warning and discarding the per-pattern glob. So rulesync's {category: {pattern: action}} model does not round-trip: ask/allow data is lost, and deny patterns lose their argument specificity.

Proposed Follow-up

  • Emit amp.permissions (array form) so rulesync's permission model round-trips fully:
    • deny{ tool, matches: { cmd: <pattern> }, action: "reject" } (keep amp.tools.disable only for the bare whole-tool "*" case if desired)
    • askaction: "ask" (currently dropped)
    • allowaction: "allow" (currently dropped)
    • Preserve the per-pattern glob in matches instead of collapsing to the tool name.
  • Keep the schema loose (project convention) and retain the existing shared-settings.json merge / no-delete guard.
  • Note: amp.permissions is documented as activating Amp's internal (legacy-compat) permissions plugin but remains functional; confirm the active settings file (settings.json vs settings.jsonc, see Amp settings-file extension divergence: MCP defaults to settings.jsonc, permissions to settings.json (splits config) #1989) when wiring output.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    consideringenhancementNew feature or requestmaintainer-scrapRough notes for AI implementation. Not for human eyes.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions