agentguard_core/policy/init.rs
1//! Initialize a fresh agentguard store with the starter schema.
2
3use crate::error::Result;
4use crate::policy::store::PolicyStore;
5use std::path::Path;
6
7/// Initialize a new agentguard store at `root` with the starter schema.
8pub fn init_store(root: impl AsRef<Path>) -> Result<()> {
9 let store = PolicyStore::open(root.as_ref())?;
10 let starter = include_str!("../../../../schemas/starter.cedarschema");
11 store.write_schema(starter)?;
12 Ok(())
13}