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
49
50
51
52
//! The single authoritative permission primitive for harn.
//!
//! TUI policy, host IDE approvals, cloud gateway middleware, and cloud
//! sandbox backends all delegate to the same data model, store, and audit
//! channel exposed here, so a user's "remember this answer" rule flows
//! between local sessions and supervised cloud agents identically.
//!
//! The pieces (each in its own file):
//!
//! - [`policy`] — declarative [`PermissionPolicy`]: read/write/exec/net
//! globs, llm provider list with optional cost ceiling, redaction
//! patterns, version content-hashed.
//! - [`request`] — runtime types: [`PermissionRequest`], the
//! [`PermissionDecision`] verdict it produces, and the [`Risk`] /
//! [`DecisionScope`] dimensions agents and humans key off of.
//! - [`rules`] — persistent "remember" rules. Each rule pins one
//! action+target shape to a verdict at a chosen scope (session,
//! workspace, user, always), with optional `expires_at` for
//! time-bound grants.
//! - [`store`] — [`PermissionStore`] trait + in-memory implementation
//! that owns the rule set + audit history. Lives behind a trait so
//! the eventual A.5 session-store can swap in a durable backend
//! without touching any caller.
//! - [`audit`] — [`AuditEntry`] events emitted on every grant / deny /
//! escalation, queryable through `store.history(filter)`.
//! - [`enforcement`] — the runtime arm: lowers a [`PermissionPolicy`]
//! into the [`CapabilityPolicy`](harn_vm::orchestration::CapabilityPolicy)
//! the VM enforces and (with the `hostlib` feature) the
//! [`SandboxSpec`](harn_hostlib::sandbox::SandboxSpec) a sandbox
//! backend provisions from.
//! - [`ToolApprovalPolicy`] and [`ToolApprovalRequest`] — the fine-grained
//! tool-decision engine shared with VM dispatch, including canonical
//! normalization, default guards, precedence, and audit receipts.
pub use ;
pub use sandbox;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;