File size: 523 Bytes
29cdc9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import yaml
import os

class CDEPolicyEnforcer:
    def __init__(self, policy_path="cde_policy.yaml"):
        self.policy_path = policy_path
        
    def check_task(self, task):
        if not os.path.exists(self.policy_path): return True
        with open(self.policy_path, 'r') as f:
            policy = yaml.safe_load(f)
        
        # Example Security Gate: Block dangerous intents
        if policy.get('security_strictness') == "high" and "delete" in str(task):
            return False
        return True