What
Add an example script (examples/hot_reload_demo.py) demonstrating policy hot-reload and policy merge.
Why
runtime.update_policy() and Policy.from_yaml_files() were added in v0.1.3 but lack a standalone example. These features are important for production deployments where policies change without restarts.
Expected behavior
- Start with a permissive policy (auto-approve reads)
- Execute some actions
- Hot-reload a stricter policy (block deletes)
- Show the same actions now get blocked
- Demonstrate
Policy.from_yaml_files() for merging base + override policies
Acceptance criteria
Difficulty
Beginner — straightforward API usage.
What
Add an example script (
examples/hot_reload_demo.py) demonstrating policy hot-reload and policy merge.Why
runtime.update_policy()andPolicy.from_yaml_files()were added in v0.1.3 but lack a standalone example. These features are important for production deployments where policies change without restarts.Expected behavior
Policy.from_yaml_files()for merging base + override policiesAcceptance criteria
examples/hot_reload_demo.pyruns without errorsruntime.update_policy()Policy.from_yaml_files()orpolicy.merge()examples/README.mdDifficulty
Beginner — straightforward API usage.