Option C Tools
Loading...
Searching...
No Matches
oct.mcp.policy.McpPolicy Class Reference

Public Member Functions

None __init__ (self, McpProfile profile="default", bool safe_mode=False)
McpProfile profile (self)
PolicyDecision check (self, str tool_name)

Protected Attributes

McpProfile _profile = profile
bool _safe_mode = safe_mode

Detailed Description

Stateless policy engine for the MCP tool manifest.

Parameters
----------
profile
    Active MCP profile. One of ``"default"``, ``"strict"``, or
    ``"airgapped"``.
safe_mode
    If ``True``, all tool calls are denied regardless of profile.
    Mirrors ``McpConfig.safe_mode``.

Definition at line 262 of file policy.py.

Constructor & Destructor Documentation

◆ __init__()

None oct.mcp.policy.McpPolicy.__init__ ( self,
McpProfile profile = "default",
bool safe_mode = False )

Definition at line 275 of file policy.py.

Member Function Documentation

◆ check()

PolicyDecision oct.mcp.policy.McpPolicy.check ( self,
str tool_name )
Check whether *tool_name* is permitted under the active policy.

Parameters
----------
tool_name
    MCP tool name, e.g. ``"oct_lint"``.

Returns
-------
:class:`PolicyDecision` with ``allowed=True`` or ``allowed=False``.
Never raises.

Definition at line 295 of file policy.py.

Here is the call graph for this function:

◆ profile()

McpProfile oct.mcp.policy.McpPolicy.profile ( self)
Active profile name.

Definition at line 291 of file policy.py.

Member Data Documentation

◆ _profile

McpProfile oct.mcp.policy.McpPolicy._profile = profile
protected

Definition at line 286 of file policy.py.

◆ _safe_mode

bool oct.mcp.policy.McpPolicy._safe_mode = safe_mode
protected

Definition at line 287 of file policy.py.


The documentation for this class was generated from the following file:
  • G:/PythonApps/Option_C/oct/oct/mcp/policy.py