PolicyRuleProviderInterface
Supplies policy rules to the PolicyGate. The Doctrine-backed provider lives in the host; in-memory or config-backed providers are equally valid. Returning null means "no matching rule" and the gate falls back to its channel policies.
PolicyRuleProviderInterface::findMatchingRule()
abstract public function findMatchingRule(string $channel, ?string $principal, string $toolName, bool $mutating): ?Milpa\ToolRuntime\Contracts\PolicyRuleInterfaceFind the policy rule that governs this call, if any. Returning null means "no matching rule" — the gate falls back to its static channel policies rather than treating the absence of a rule as an implicit denial.
Parameters
| Name | Type | Description |
|---|---|---|
| $channel | string | Channel the call originated from (cli, mcp, telegram, web, ...) |
| $principal | (string | null) | Authenticated principal (user or service), if any |
| $toolName | string | Name of the tool being invoked |
| $mutating | bool | Whether the tool call mutates state |