What is Policy Hot Reload?
Policy hot reload is the ability to update policy files without restarting Intercept, with changes taking effect on the next tool call to enable zero-downtime policy updates.
WHY IT MATTERS
In production environments, restarting a proxy to update configuration is unacceptable. Active MCP sessions would be interrupted, in-flight tool calls dropped, and agents left without their tool infrastructure until the proxy comes back up. Hot reload eliminates this operational burden — you edit a YAML file, save it, and the new policy applies to the next tool call.
Hot reload also changes how teams work with policies. Without it, policy updates require a deployment — pull request, CI/CD pipeline, restart. With hot reload, a security engineer can respond to an incident by editing a policy file and having the change take effect in seconds. This operational agility is critical when an agent is misbehaving and you need to restrict its access immediately.
The implementation watches the policy directory for file changes using filesystem notifications, re-parses and validates the modified files, and atomically swaps the in-memory policy set. If the new file is invalid (syntax error, schema violation), Intercept logs the error and continues operating with the previous valid policy. This ensures a typo in a policy file never takes down the enforcement layer.
HOW POLICYLAYER USES THIS
Intercept watches the configured policy directory for filesystem changes using OS-native notification mechanisms (fsnotify on Linux, kqueue on macOS). When a policy file is modified, created, or deleted, Intercept validates the new file, and on success, atomically swaps the internal policy index. The swap is lock-free for readers, so in-flight evaluations are not blocked. If validation fails, the previous policy remains active and an error is logged with the file path and line number of the issue.