Crate agentguard_policy

Source
Expand description

Policy operations: versioned bundles, hot reload, diff, blast radius.

v2.0: provides:

  • PolicyVersion — monotonic version identifiers
  • PolicyBundle — a snapshot of schema + policies, addressable by version
  • BundleRegistry — in-memory version store with persistence
  • diff — line-level diff between two bundles (uses the similar crate)
  • blast_radius::analyze — classify decision changes across a corpus
  • hot-reload watcher (gated behind the watch feature, enabled by default)

Re-exports§

pub use version::PolicyVersion;

Modules§

blast_radius
Blast-radius analysis: classify decision changes across a replay corpus.
diff
Line-level diff between two PolicyBundles.
version
Policy version identifiers.
watcher
Hot-reload watcher for policy files.

Structs§

BundleRegistry
In-memory registry of policy bundles, keyed by version, scoped per tenant.
NamedPolicy
A single named policy within a bundle.
PolicyBundle
A policy bundle: schema + named policy sources, identified by version.

Functions§

now_unix
Helper: current Unix timestamp.
read_bundle_from_path
Helper: read a bundle from disk.
sha256
Helper: hash a string with SHA-256.
write_bundle_to_path
Helper: write a bundle to disk as JSON.