Skip to content

Directives - Build/Runtime Modifiers ​

examples/09-directives.halo policies

Use @ directives to configure pipelines/agents

Open in the playground →

halo
// ============================================================
// STEP 9: Directives - Build/Runtime Modifiers
// Learn: Use `@` directives to configure pipelines/agents
// ============================================================

policy NoProfanity : Block(Profanity)

agent Greeter [gemini-3-1-pro, temp: 0.7]
  requires NoProfanity

// Retry up to 2 times, wait 30s between retries
@retry(2, 30s)
// Timeout after 5 minutes
@timeout(5m)
pipeline ReliableHello(name: String) -> Result:
  name
    |> Greeter.prompt("Write a warm, one-sentence greeting for {{name}}.")
    |> System.Print()

curl -fsSL https://halolang.com/install.sh | sh