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