Skip to content

Support global/MDM-managed Prempti rules outside the user prefix #39

Description

@isoyuki

Hi, nice project!

I thought this tool could also be useful in some enterprise environments to centrally manage developer's machines Claude behaviours (essentially as org-wide security policy), something similar to Claude Code's managed settings, where you can push managed settings file via MDM.

Borrowing its idea, would it be of this project's interests to have global rules tier for organization-managed Prempti policies?

I put together a prototype branch in my fork that adds fixed global rule locations outside ~/.prempti to a system path that requires elevated privileges, loaded after user rules and before seen.yaml like:

  • Linux: /etc/prempti/rules/global
  • macOS: /Library/Application Support/Prempti/rules/global
  • Windows: %ProgramData%\Prempti\rules\global

(hastily written with AI for now for demonstration purposes)

Let me know if this of interest, if so, I can write a proper PR to implement this. I believe there are some work that would be required to also control the behavour of Prempti itself by similar mechanisms (e.g. disabling ability to disable hooks by users).

From what I understand from the current state, a workaround could be to drop rules in somewhere like /etc/prempti/rules.d/ and add that path to rules_files post-install via MDM config script. I think this survives ctl mode/ctl restart, but it does not survive package reinstall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureNew feature or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions