Skip to main content

systemprompt_identifiers/
policy.rs

1//! Policy identifiers, and the identity of one governed call.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6crate::define_id!(PolicyVersion);
7crate::define_id!(PolicyId, checked, |value| {
8    crate::macros::validate_external_id("PolicyId", value)
9});
10crate::define_id!(SecretPatternId, non_empty);
11
12impl SecretPatternId {
13    #[must_use]
14    pub fn high_entropy() -> Self {
15        Self("high-entropy-token".to_owned())
16    }
17}
18crate::define_id!(CallId, generate, schema);
19
20impl PolicyVersion {
21    pub fn unversioned() -> Self {
22        Self("unversioned".to_owned())
23    }
24}