[P1] Add four-tier host-controlled authority policy and approval/diff API #53
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#53
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Add a reusable four-tier authority policy to
prolog-rlmcore so downstream builders can limit model autonomy consistently.The authority modes belong in the RLM codebase. They are runtime policy primitives for hosts/builders. They are not controlled by the model/agent itself.
Interactive rendering remains outside core:
prolog-rlmowns authority state, approval state, pending diffs/operations, fingerprints, and approve/deny/edit predicates; clients such asagentProlog/decide how to display them.Required four-tier authority modes
approve_diff— applicable side effects become pending reviewable operations/diffs and require explicit approval.allow_once— authorize exactly one matching pending operation, then consume that authorization atomically.allow_session— authorize matching side effects for the current runtime/session only.dangerous— explicit dangerous/unattended mode; otherwise-valid side effects execute without interactive approval.There is no
yolopublic mode name. Tier 4 isdangerousin APIs, status, traces, and downstream UI.Ownership and control
Trusted host/application code may set policy:
Exact naming may follow project conventions.
The model/agent must not receive an unrestricted tool/predicate that can call
rlmSetAuthority/1or otherwise raise its own authority. Authority changes originate from trusted host code or an explicitly mediated user action.A child agent may inherit an equal or stricter authority policy, but must never widen beyond the authority ceiling established by its parent/host.
rlmSetAuthorityIfUnset/1is idempotent and never overwrites an existing host-selected mode.Unset authority defaults to
approve_diff; it must never silently becomedangerous.Core approval/diff API
The library exposes structured pending operations that any UI can render. At minimum provide equivalents of:
Approve, deny, and edit are required first-class operations.
A pending approval contains enough structured data for downstream clients to render:
Approval
Approval authorizes the exact fingerprinted proposal. A changed payload requires fresh approval.
Denial
Denial records a structured reason/event and performs no target mutation.
Edit
Editing creates a new proposal/fingerprint. Approval attached to the old fingerprint cannot authorize the edited operation.
The edit predicate is a library primitive, not an editor UI.
Authority ordering
Capabilities remain the hard allow-list. Authority controls how much human mediation an otherwise-capable model receives.
Tier semantics
approve_diffEvery applicable mutation enters the pending-approval API. Core returns structured
approval_required(...); it renders nothing.allow_onceallow_sessiondangerousdangerousin status and trace data;call/1or arbitrary shell execution.Child-agent rule
Authority is narrowing-only across delegation, analogous to capability narrowing.
Examples:
No child/model may widen upward.
Side-effect metadata
Tool metadata should declare classes such as:
Pure reads should not require diff approval unless host policy explicitly requests it.
UI boundary
prolog-rlmMUST NOT own:It only exposes structured APIs/events/state.
agentProlog/and other downstream clients render them.Acceptance criteria
approve_diff,allow_once,allow_session, anddangerous.yoloas a public authority-mode name.approve_diff.allow_onceis atomically single-use under retries/parallel execution.allow_sessionis runtime/session scoped and non-persistent by default.dangerousremains subject to capability/schema/budget/confinement checks.Integration
Compose with:
agentProlog/editor/TUI.MCP install/start and other side-effecting operations must use this same host-controlled authority policy rather than inventing separate confirmation systems.
Non-goals
rlmLoadTools/1orrlmLoadAllTools/0.dangerousdoes not disable hard runtime boundaries.Core-hardening update from PR #62:
Implemented and deterministically green on the current PR head:
allow_onceconsumption/replay at tool + MCP lifecycle boundaries#53 is not ready to close yet. The hardening audit found two P0 invariants that must be resolved first:
The configured REAL OpenRouter gate is also externally blocked by HTTP 429
free-models-per-day-high-balance; the gate has not been weakened or moved to a paid model.Keep #53 open until #63 and #64 are satisfied and the exact final PR head clears required deterministic + REAL gates.