use super::AgentPolicy;

pub enum PolicyDecision {
    Allow,
    Deny(String),
}

pub fn evaluate(policy: &AgentPolicy, skill_id: &str) -> PolicyDecision {
    if !policy.allowed_skills.is_empty() && !policy.allowed_skills.iter().any(|s| s == skill_id) {
        return PolicyDecision::Deny(format!("skill {skill_id} not in allowed list"));
    }
    PolicyDecision::Allow
}
