|
Entropic 2.11.1
Local-first agentic inference engine
|
Permission manager for MCP tool access control. More...
#include <entropic/mcp/permission_manager.h>
Public Member Functions | |
| PermissionManager (std::vector< std::string > allow_patterns={}, std::vector< std::string > deny_patterns={}) | |
| Construct with initial allow/deny lists. | |
| bool | is_denied (const std::string &tool_name, const std::string &pattern) const |
| Check if a tool call is explicitly denied. | |
| bool | is_allowed (const std::string &tool_name, const std::string &pattern) const |
| Check if a tool call is explicitly allowed (skip prompting). | |
| void | add_permission (const std::string &pattern, bool allow) |
| Add a permission pattern at runtime. | |
Permission manager for MCP tool access control.
Default-deny model. Deny list takes precedence over allow list. Only returns false for is_denied() if a deny pattern explicitly matches. Unknown tools are not denied — the engine handles prompting for tools not in either list.
Definition at line 34 of file permission_manager.h.
| entropic::PermissionManager::PermissionManager | ( | std::vector< std::string > | allow_patterns = {}, |
| std::vector< std::string > | deny_patterns = {} |
||
| ) |
Construct with initial allow/deny lists.
| allow_patterns | Allow list patterns. |
| deny_patterns | Deny list patterns. |
| allow_patterns | Allow list patterns. |
| deny_patterns | Deny list patterns. @dg_internal |
Definition at line 24 of file permission_manager.cpp.
| void entropic::PermissionManager::add_permission | ( | const std::string & | pattern, |
| bool | allow | ||
| ) |
Add a permission pattern at runtime.
| pattern | Permission pattern string. |
| allow | true for allow list, false for deny list. |
Backs the operator's "always allow / always deny" decision; the new pattern takes effect on the next call. Re-adding an identical pattern is a no-op so repeated approvals do not grow the list.
| pattern | Permission pattern string, at whatever granularity the owning server's get_permission_pattern chose. |
| allow | true to insert into the allow list, false for the deny list. @req REQ-MCP-009 |
Definition at line 94 of file permission_manager.cpp.
| bool entropic::PermissionManager::is_allowed | ( | const std::string & | tool_name, |
| const std::string & | pattern | ||
| ) | const |
Check if a tool call is explicitly allowed (skip prompting).
Check if a tool call is explicitly allowed.
| tool_name | Fully-qualified tool name. |
| pattern | Tool pattern with args. |
| tool_name | Fully-qualified tool name (<server>.<tool>). |
| pattern | The <tool>:<args-summary> pattern for this call. |
Definition at line 67 of file permission_manager.cpp.
| bool entropic::PermissionManager::is_denied | ( | const std::string & | tool_name, |
| const std::string & | pattern | ||
| ) | const |
Check if a tool call is explicitly denied.
| tool_name | Fully-qualified tool name (e.g., "filesystem.read_file"). |
| pattern | Tool pattern with args (e.g., "filesystem.read_file:/path"). |
Consulted before the allow list, so deny takes precedence whenever both lists match the same call.
| tool_name | Fully-qualified tool name (<server>.<tool>). |
| pattern | The <tool>:<args-summary> pattern for this call. |
Definition at line 44 of file permission_manager.cpp.