Portable security rules for AI agents.
Define what an agent may access, invoke, and send - across runtimes, frameworks, and languages.
View on GitHub →AI agents interact with tools - file systems, network APIs, shell commands, MCP servers. HushSpec provides a standard way to declare which interactions are allowed, blocked, or require confirmation.
It separates policy (what you declare) from enforcement (how an engine applies it). Engines like Clawdstrike implement the spec and add engine-specific features like detection algorithms and receipt signing.
All SDKs implement: parse, validate, merge, resolve, evaluate. Receipts, sinks, and detection helpers are also available across the SDKs. Higher-level integrations vary by language: TypeScript adds adapters and hot reload, Python adds adapters and observers, and Rust adds signing.
import { parseOrThrow, evaluate } from '@hushspec/core';
const spec = parseOrThrow(policyYaml);
const result = evaluate(spec, {
type: 'egress',
target: 'api.openai.com'
});
// result.decision === 'allow' | 'warn' | 'deny'
// result.matched_rule === 'egress'
Every HushSpec document uses the same 10 rule types. Each rule is a pure declaration - no runtime state, no detection algorithms, no plugin systems.
Every SDK implements the full evaluator pipeline: parse, validate, merge, resolve, evaluate. Runtime integrations differ by language, but the core decision model is shared across all four.
| SDK | Level | Parse | Validate | Merge | Resolve | Evaluate | Audit | Detection |
|---|---|---|---|---|---|---|---|---|
| Rust | Level 3 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| TypeScript | Level 3 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Python | Level 3 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Go | Level 3 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
TypeScript adds Anthropic/OpenAI/MCP adapters plus watcher and poller support. Python adds adapters and an observer layer. Rust is the reference implementation and currently the only SDK with Ed25519 signing.
h2h CLI
h2h ("hush to hush") - 11 subcommands for policy management: validate, test, init,
lint, diff, fmt, audit, panic, sign, verify, and keygen.
7 ready-to-use security rulesets covering common deployment scenarios.
Extend them with extends: to customize for your use case.
Three optional extensions add state machines, origin-aware profiles, and detection thresholds without bloating the core.
HushSpec is an open specification. The normative spec, JSON Schema definitions, all four SDKs, the CLI, conformance test fixtures, and built-in rulesets are available on GitHub under the Apache-2.0 license.