Hedera Policy Creation
Installation
SKILL.md
Creating Hedera Agent Kit Policies
Policies are blocking validation rules layered on the BaseTool lifecycle. A policy checks the call at one or more stages and throws to abort execution — the error propagates back to the LLM agent. Use them to enforce thresholds, allowlists/blocklists, rate limits, business hours, compliance rules, etc.
Policies fire only for tools that extend
BaseTool. A tool that implements theToolinterface directly without extendingBaseToolbypasses policies entirely.
Policy vs. hook
| Goal | Use |
|---|---|
| Stop a call when a condition holds | Policy (this skill) |
| Reject specific tool methods | Policy |
| Threshold / rate-limit / allowlist / blocklist | Policy |
| Log, audit, enrich context | Hook (see agent-kit-hook skill) |
AbstractPolicy extends AbstractHook, so policies live in the same Context.hooks array and run through the same lifecycle.