1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Unified tool-use governance plane.
//!
//! A governed call is an MCP tool invocation or a submitted prompt
//! ([`GovernedTarget`]), carrying tool arguments or prompt text
//! ([`GovernedInput`]). This module owns the whole enforcement runtime:
//!
//! - [`types`] — the [`GovernancePolicy`] trait and [`PolicyContext`].
//! - [`config`] — the `governance.policies` YAML declaration
//! ([`GovernanceConfig`]).
//! - [`registry`] — inventory registration
//! ([`crate::register_governance_policy!`]); the [`builtin`] policies (secret
//! scan, scope check, blocklist, rate limit) self-register here.
//! - [`engine`] — [`GovernanceEngine`], the traced first-deny-wins evaluator.
//! - [`audit`] — [`DecisionAudit`], the typed blob persisted through
//! [`record_decision`] into `governance_decisions`.
//! - [`secrets`] — the shared credential scanner.
//!
//! Decisions are the same typed [`crate::authz::types::Decision`] the
//! user→entity resolver returns, so a single audit shape and a single CLI
//! view cover both planes. Enforcement points (webhook handlers, in-process
//! seams) live in extensions; they resolve identity and scope, build a
//! [`PolicyContext`], and call the engine.
//!
//! Copyright (c) systemprompt.io — Business Source License 1.1.
//! See <https://systemprompt.io> for licensing details.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;