1"""Pre-built HITL approval policies for common deployment scenarios."""

2

3 from agentos.hitl.approver import ApprovalPolicy, RiskLevel

4

5

6 def default_approval_policy() -> ApprovalPolicy:

7 """Balanced policy: auto-approve low risk, require human for high/critical."""

8 return ApprovalPolicy(

9 require_approval_for_risk={RiskLevel.HIGH, RiskLevel.CRITICAL},

10 auto_approve_domains=set(),

11 block_domains=set(),

12 max_auto_approve_cost_usd=0.01,

13 require_approval_for_new_tools=True,

14 timeout_seconds=120,

15 max_pending_requests=10,

16 cache_approval_seconds=300,

17 )

18

19

20 def permissive_approval_policy() -> ApprovalPolicy:

21 """Permissive policy: only require human for critical actions."""

22 return ApprovalPolicy(

23 require_approval_for_risk={RiskLevel.CRITICAL},

24 auto_approve_domains={"read", "search", "fetch"},

25 block_domains=set(),

26 max_auto_approve_cost_usd=0.10,

27 require_approval_for_new_tools=False,

28 timeout_seconds=60,

29 max_pending_requests=20,

30 cache_approval_seconds=600,

31 )

32

33

34 def strict_approval_policy() -> ApprovalPolicy:

35 """Strict policy: require human for medium/high/critical actions."""

36 return ApprovalPolicy(

37 require_approval_for_risk={RiskLevel.MEDIUM, RiskLevel.HIGH, RiskLevel.CRITICAL},

38 auto_approve_domains=set(),

39 block_domains={"delete", "format", "exec"},

40 max_auto_approve_cost_usd=0.0,

41 require_approval_for_new_tools=True,

42 timeout_seconds=300,

43 max_pending_requests=5,

44 cache_approval_seconds=0,

45 )