Policies - Safety & Constraints
Define policies, apply to agents with requires Policies restrict agent behavior (block profanity, limit length, etc.)
halo
// ============================================================
// STEP 2: Policies - Safety & Constraints
// Learn: Define policies, apply to agents with `requires`
// Policies restrict agent behavior (block profanity, limit length, etc.)
// ============================================================
// Define policies (combine rules with &)
policy NoProfanity : Block(Profanity) & LogViolation()
policy Brevity : MaxWords(50)
// Apply policies to agents with `requires`
agent Greeter [gemini-3-1-pro, temp: 0.7]
requires NoProfanity, Brevity
pipeline HelloWorld(name: String) -> Result:
name
|> Greeter.prompt("Write a warm, one-sentence 'Hello World' greeting for this person.")
|> System.Print()