What is a Policy Evaluation Pipeline?
The policy evaluation pipeline is the sequence of steps Intercept follows to evaluate every tool call: match server, match tool, evaluate conditions, apply action, and log the decision.
WHY IT MATTERS
A policy system is only as trustworthy as its evaluation logic. If the evaluation is opaque, inconsistent, or unpredictable, no one will trust the policies it enforces. Intercept's evaluation pipeline is deliberately simple and deterministic — the same input always produces the same output, and every step is logged for transparency.
The pipeline follows a funnel pattern. First, Intercept identifies which MCP server the tool call targets. Then it finds matching tool-level rules, falling back to server-level defaults and global rules according to the inheritance hierarchy. For each candidate rule, it evaluates conditions against the tool call's arguments. The first rule whose conditions pass produces the final action. If no rule matches, the default action (fail-closed or fail-open) applies.
This design makes policy behaviour predictable and debuggable. When a tool call is unexpectedly denied, you can trace the pipeline: which server was matched, which rules were candidates, which conditions were evaluated, and which rule ultimately produced the deny action. Every step is recorded in the decision log, creating a complete audit trail of the enforcement logic.
HOW POLICYLAYER USES THIS
Intercept's pipeline executes synchronously for each tool call in the MCP message stream. The steps are: (1) extract server name and tool name from the MCP request, (2) look up global rules, (3) look up server-level rules, (4) look up tool-level rules, (5) sort all candidate rules by priority, (6) evaluate conditions for each rule in order, (7) apply the action from the first matching rule, (8) write the decision to the decision log with the full evaluation trace. The pipeline is implemented as a chain of pure functions, making it deterministic and testable.