Skip to main content

fd_policy/
lib.rs

1//! FerrumDeck Policy Engine
2//!
3//! Enforces governance rules for agent runs:
4//! - Tool allowlists (deny-by-default)
5//! - Budget limits (tokens, tool calls, wall time)
6//! - Approval gates for sensitive actions
7//! - **Airlock**: Runtime security inspection (Agent RASP)
8
9pub mod airlock;
10pub mod bench_audit;
11pub mod budget;
12pub mod decision;
13pub mod engine;
14pub mod forecast;
15pub mod harness;
16pub mod lease;
17pub mod precedence;
18pub mod promotion;
19pub mod reversibility;
20pub mod routing;
21pub mod rules;
22pub mod trace;
23pub mod transparency_art50;
24
25pub use bench_audit::{BenchAuditPolicy, BenchGatedClaim, BenchTrustSummary, BENCH_AUDIT_ANCHOR};
26pub use decision::{PolicyDecision, PolicyDecisionKind};
27pub use engine::PolicyEngine;
28pub use harness::{
29    fold_status, HarnessSuggestion, SuggestionEvidence, SuggestionKind, SuggestionStatus,
30    HARNESS_ANCHOR,
31};
32pub use lease::{BudgetLease, LeaseError, SharedBudget, LEASE_ANCHOR};
33pub use precedence::{
34    precedence_rank, resolve_conflicts, OverrideRecord, PolicyVerdict, ResolvedDecision,
35    VerdictKind, PRECEDENCE_LABEL,
36};
37pub use promotion::{
38    MetricEvidence, MetricThreshold, PromotionDecision, PromotionGate, PromotionGateConfig,
39    PromotionStatus, PROMOTION_ANCHOR,
40};
41pub use reversibility::{
42    combine as combine_response, graduated_response, ResponseLevel, Reversibility,
43    RESPONSE_LADDER_ANCHOR,
44};
45pub use routing::{
46    RoutingCandidate, RoutingChoice, RoutingDecision, RoutingReason, RoutingReasonCode,
47    ROUTING_ANCHOR,
48};
49pub use rules::{ToolAllowlist, ToolAllowlistResult, ToolRiskLevel};
50pub use trace::DecisionTrace;
51pub use transparency_art50::{
52    check as check_art50, enforce as enforce_art50, response_level as art50_response_level,
53    Art50Config, Art50Status, EU_AI_ACT_ART50_ANCHOR,
54};
55
56// Re-export Airlock types for convenience
57pub use airlock::{
58    AirlockConfig, AirlockInspector, AirlockMode, AirlockResult, AirlockViolation,
59    BlockingCategory, CoherenceConfig, CoherenceMonitor, CoherenceSpan, InspectionContext,
60    RiskLevel, TrajectoryEvent, ViolationType, COHERENCE_ANCHOR,
61};