MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_dangerous_tool_patterns

Function test_dangerous_tool_patterns

core/src/skills/validator.rs:315–324  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

313
314 #[test]
315 fn test_dangerous_tool_patterns() {
316 let v = validator();
317 let dangerous = &["Bash(*)", "bash(*)", "write(*)", "edit(*)", "patch(*)"];
318 for pattern in dangerous {
319 let mut skill = make_skill("safe-skill", "content");
320 skill.allowed_tools = Some(pattern.to_string());
321 let err = v.validate(&skill).unwrap_err();
322 assert_eq!(err.kind, ValidationErrorKind::DangerousTools);
323 }
324 }
325
326 #[test]
327 fn test_safe_tool_patterns_allowed() {

Callers

nothing calls this directly

Calls 3

validatorFunction · 0.85
make_skillFunction · 0.85
validateMethod · 0.45

Tested by

no test coverage detected