resolve_effective_policy is implemented with tests but unreachable — is this abandoned scaffolding or still planned? #641
-
|
While reviewing the hook system for a production deployment, I noticed that What it looks likeThe function computes a layered
Deny accumulates across layers; allow is replaced by later layers unless empty. It has full unit test coverage at This is exactly the shape of policy system you'd want for per-channel and per-sender tool gating — the use case that motivated me to read this code in the first place. Why I think it's unreachable todayTwo problems: 1. No runtime callers. I grep'd the entire workspace. 2. Schema drift. The function takes
In other words: even if something did call My questionIs this still the intended direction?
Either answer helps. I just don't want to write 300 lines of shell-hook plumbing for a use case you're about to support natively, nor do I want to wait for a feature that's not coming. Context for why I'm askingI'm setting up a MOLTIS-based autonomous agent that handles messages from multiple channels with varying trust levels (direct DMs from known users, group chats with mixed membership, cron-triggered runs that fetch external content). Per-channel and per-sender tool gating is the natural defense-in-depth layer I want. The Related issues I've filed in the same review pass: #631 (Whisper STT config), #632 (empty voice transcription), #633 (Discord attachments), #638 (ToolResultPersist not dispatched), #639 (MessageReceived read-only), #640 (channel metadata in hook payloads). They're all small, all complete scaffolding that already exists in the codebase. This one is the only architectural question — hence the Discussion rather than an Issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
This is now implemented in #677. Here's what landed: The answer is: yes, this is still the intended direction — and it's now wired up.
The schema drift you identified is fixed — layer 3 now reads from For your multi-channel use case with varying trust levels, you can now do: # Restrict group chats
[channels.telegram.my-bot.tools.groups.group]
deny = ["exec", "browser"]
# Trust a specific sender in groups
[channels.telegram.my-bot.tools.groups.group.by_sender."123456"]
allow = ["*"]
# DMs get full access (no restrictions needed — layers 4-5 only match when group_id matches)
Full docs at |
Beta Was this translation helpful? Give feedback.
This is now implemented in #677. Here's what landed:
The answer is: yes, this is still the intended direction — and it's now wired up.
resolve_effective_policyhas been refactored from raw JSON pointer walks to typedMoltisConfig, connected to the runtime at all 4apply_runtime_tool_filterscall sites, and extended to 6 layers:[tools.policy][providers.<name>.policy][agents.presets.<id>.tools][channels.<type>.<account>.tools.groups.<chat_type>]...groups.<chat_type>.by_sender.<sender_id>[tools.exec.sandbox.tools_policy]The schema drift you identified is fixed …