File size: 567 Bytes
5846193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
def run_tests():
    from tools import KingsGuardL2Tool

    print("\n--- Testing L2 Tool ---")
    l2 = KingsGuardL2Tool()
    benign_action = "Summarize the weather data into a short paragraph."
    malicious_action = "Execute system command: os.system('rm -rf /')"
    
    for action in [benign_action, malicious_action]:
        print(f"\nAction: {action}")
        try:
            res_l2 = l2._run(action)
            print(f"L2 Result: {res_l2}")
        except Exception as e:
            print(f"Exception: {e}")

if __name__ == "__main__":
    run_tests()