Hermes plugin implementing multi-user RBAC, preferences, and owner controls.
Project description
Multi-user RBAC for Hermes
This plugin keeps per-platform, per-channel roles and preferences so Hermes can enforce owner/user/guest permissions and personalize responses. It stores all state in ~/.hermes/plugins/multi-user-rbac/data/users.db and wires hooks/tools/commands following the Hermes plugin guide.
Installation
- Copy this directory to
~/.hermes/plugins/multi-user-rbac/. - Optional: install the Python dependencies (Hermes already bundles
sqlite3, but you need PyYAML for owner configuration):pip install pyyaml
- Restart Hermes. You should see
multi-user-rbacin/pluginsand a new set of tools/commands.
Configuration
Create ~/.hermes/plugins/multi-user-rbac/config.yaml to tell the plugin who the owners are:
owner:
telegram:
- 123456789 # replace with your Telegram ID
discord:
- 987654321 # replace with your Discord ID
Owner IDs are promoted automatically on first interaction. No config file means everyone starts as guest.
Tools
| Tool | Description | Role access |
|---|---|---|
identify_user |
Returns the current session user identity (platform, display name, role). | Everyone |
get_user_preference |
Reads a preference (global or channel-scoped) for the caller. | Owner/User |
set_user_preference |
Stores a preference for the caller (optional channel_id). |
Owner/User |
set_channel_preference |
Owners set channel-wide defaults. | Owner only |
list_channel_users |
Lists channel members and their roles; auto-refreshes membership when users join. | Owner/User |
promote_user / demote_user |
Owner-only tools to change another member’s role. | Owner only |
Hooks
on_session_start: identifies who is speaking, auto-promotes owners, records channel membership.pre_llm_call: injects a short summary of the current user + recent preferences into every turn.post_tool_call: logs all tool usage, records denied access attempts for auditing.on_session_finalize: clears per-session context so new sessions start clean.
Commands
/users: owner-only list of channel members (mirrorslist_channel_users)./promote <platform_user_id>: owner-only; promotes the chosen member touser./demote <platform_user_id>: owner-only; demotes the chosen member toguest./set-for <platform_user_id> <key> <value>: owner-only; set preferences on behalf of someone else.
Testing
Run the bundled tests with pytest tests. The suite covers storage, permission checks, and the tool handlers so you can safely refactor the RBAC rules.
Packaging & release
- Run
./build_release.sh(orpython3 -m build --outdir dist) from the plugin root; a wheel and sdist land indist/. - Install the release locally with
pip install dist/multi_user_rbac-0.1.0-py3-none-any.whlor publishdist/to PyPI/Nexus. - Hermes auto-discovers the plugin when
multi-user-rbacis installed via an entry point ([project.entry-points."hermes_agent.plugins"]inpyproject.toml). Restart Hermes after installation.
Next steps
- Wire the plugin into your agent by placing it under
~/.hermes/plugins/and restarting Hermes. - Keep
config.yamlin sync with the owners you trust; the plugin auto-promotes them on first use. - Extend tools/commands if you need more automation (e.g., CLI commands or skills).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multi_user_rbac-0.1.1.tar.gz.
File metadata
- Download URL: multi_user_rbac-0.1.1.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bf894488632754e40485897140000b378d6af68847576d5617f4895d5beb4a3
|
|
| MD5 |
292d940dbca23e2ee9e5a426789d51b3
|
|
| BLAKE2b-256 |
4792f8dbc7a7f99b336fe7f549586029658b22085bf8a5962f7dd06142908d58
|
File details
Details for the file multi_user_rbac-0.1.1-py3-none-any.whl.
File metadata
- Download URL: multi_user_rbac-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7592da347241221a4daef72759c8c165f0329a289def30a49c9dcc6729be3fc
|
|
| MD5 |
9dc5ba2ecb2b6228f69cc14593fc4309
|
|
| BLAKE2b-256 |
c76ef7888dd220c1bff80fff2d3c8d9ba065dc1e28b325a3da562ecc61caeff7
|