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 colorado_sb26_189;
13pub mod decision;
14pub mod engine;
15pub mod forecast;
16pub mod harness;
17pub mod lease;
18pub mod precedence;
19pub mod promotion;
20pub mod reversibility;
21pub mod routing;
22pub mod rules;
23pub mod trace;
24pub mod transparency_art50;
25pub mod x402;
26
27pub use bench_audit::{BenchAuditPolicy, BenchGatedClaim, BenchTrustSummary, BENCH_AUDIT_ANCHOR};
28pub use colorado_sb26_189::{
29    check as check_colorado_admt, enforce as enforce_colorado_admt,
30    response_level as colorado_admt_response_level, AdmtDecisionContext, AutomationRole,
31    ColoradoAdmtConfig, ColoradoAdmtRecord, ColoradoAdmtStatus, ConsequentialDomain,
32    COLORADO_SB26_189_ANCHOR, RETENTION_FLOOR_YEARS,
33};
34pub use decision::{PolicyDecision, PolicyDecisionKind};
35pub use engine::PolicyEngine;
36pub use harness::{
37    fold_status, HarnessSuggestion, SuggestionEvidence, SuggestionKind, SuggestionStatus,
38    HARNESS_ANCHOR,
39};
40pub use lease::{BudgetLease, LeaseError, SharedBudget, LEASE_ANCHOR};
41pub use precedence::{
42    precedence_rank, resolve_conflicts, OverrideRecord, PolicyVerdict, ResolvedDecision,
43    VerdictKind, PRECEDENCE_LABEL,
44};
45pub use promotion::{
46    MetricEvidence, MetricThreshold, PromotionDecision, PromotionGate, PromotionGateConfig,
47    PromotionStatus, PROMOTION_ANCHOR,
48};
49pub use reversibility::{
50    combine as combine_response, graduated_response, ResponseLevel, Reversibility,
51    RESPONSE_LADDER_ANCHOR,
52};
53pub use routing::{
54    RoutingCandidate, RoutingChoice, RoutingDecision, RoutingReason, RoutingReasonCode,
55    ROUTING_ANCHOR,
56};
57pub use rules::{ToolAllowlist, ToolAllowlistResult, ToolRiskLevel};
58pub use trace::DecisionTrace;
59pub use transparency_art50::{
60    check as check_art50, enforce as enforce_art50, response_level as art50_response_level,
61    Art50Config, Art50Status, EU_AI_ACT_ART50_ANCHOR,
62};
63pub use x402::{
64    evaluate_x402_payment, X402Challenge, X402CostEvent, X402GateOutcome, X402_ANCHOR,
65    X402_PAYMENT_REQUIRED_STATUS,
66};
67
68// Re-export Airlock types for convenience
69pub use airlock::{
70    AirlockConfig, AirlockInspector, AirlockMode, AirlockResult, AirlockViolation,
71    BlockingCategory, CoherenceConfig, CoherenceMonitor, CoherenceSpan, InspectionContext,
72    RiskLevel, TrajectoryEvent, ViolationType, COHERENCE_ANCHOR,
73};