Skip to content

ACP: persist allow_always as a learned permission rule #3

Closed

Description

@JAORMX

What's missing

The ACP permission round-trip treats allow_always identically to allow_once — both map to a one-shot allow=true — so "allow always" doesn't actually persist anything. mecatl's governance has no learned-allow persistence.

Validated (independent cross-check):

  • approvalFor maps both permAllowOnce and permAllowAlways → true, with an explicit comment that allow_always "behaves as allow_once this phase — there is no rule persistence yet" (internal/adapter/acp/projector.go).
  • The verdict reaches the loop via run.Approve(askID, bool) — a pure one-shot bool that never re-enters the policy (internal/agent/loop.go, dispatch.go).
  • permpolicy.Policy wraps a governance.Evaluator built once over an immutable []governance.Rule; no Add/Save/learn method exists (internal/adapter/permpolicy/, internal/governance/evaluator.go).

Proposed approach

A governance rule-store seam that persists a learned allow (keyed by tool + scope/args) when the client picks allow_always, consulted by the permission policy on subsequent asks.

Caveat from review: the one-shot run.Approve(askID, bool) approval path must be widened to carry "persist this decision" (or the ACP adapter records the rule out-of-band keyed by tool+args) — a governance store alone isn't enough. Medium-large, security-sensitive.

Part of ACP Phase 3 long-tail (docs/adr/0001-acp-adapter.md).

Activity

  1. JAORMX commented on Jun 1, 2026

    @JAORMX
    ContributorAuthor

    Done in 67c6da4. allow_always now records a learned, per-session permission rule (3-value verdict enum end-to-end; proto back-compat preserved). Conservative by design: tool + EXACT canonical pattern only, refuse-to-learn for compound/substituted Bash and empty-pattern calls, literal matching (no glob escalation), per-session in-memory store. The deny>allow and plan-mode-hard-deny invariants are preserved structurally (plan gate + deny-dominant fold run before/around learned allows). Panel security review confirmed all 8 enumerated risks resolved with tests.

    Tracked follow-ups (not silently deferred): durable cross-restart persistence + broader granularity (in the ADR), and the gRPC/HTTP session-end eviction gap (#10).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions