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. Plus audit trail receipts, detection pipelines, observability hooks, and policy hot-reload.
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 pipeline: parse, validate, merge, resolve, evaluate. Plus audit trail receipts, detection, and observability.
| SDK | Level | Parse | Validate | Merge | Resolve | Evaluate | Audit | Detection |
|---|---|---|---|---|---|---|---|---|
| Rust | Level 3 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| TypeScript | Level 2 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Python | Level 2 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| Go | Level 2 | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
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.