Skip to content

Halo DSL Dictionary ​

The formal lexicon for the Halo DSL. Reserved keywords are strictly limited to five categories: Entities, Modifiers, Flow Operators, Directives, and Native Primitives.

1. Core Entities (The Nouns) ​

Keywords that declare foundational infrastructure blocks. Instantiated globally and called by pipelines.

policy ​

FieldValue
DefinitionDefines strict, non-negotiable boundaries for security, budget, or compliance.
EvaluatedAt runtime before and after every model inference
Syntaxpolicy Name : Rule(args) & Rule(args)
Examplepolicy Privacy : Redact(PII) & Block(PromptInjection)

tool ​

FieldValue
DefinitionDeclares an external capability — database query, REST API, etc.
EnforcedZero trust: an agent can only use the tools it equips
Syntaxtool Name : Provider(args)
Exampletool CoreDB : PostgreSQL(Env.DB_URI)

store ​

FieldValue
DefinitionPersistent storage: a local vector store (VectorStore) or a conversation history (File)
EquippedAn agent that equips a VectorStore gets the entries closest to each call's input; a File store keeps its conversation
Syntaxstore Name : Provider(args)
Examplestore KnowledgeBase : VectorStore(namespace: "engineering")

schema ​

FieldValue
DefinitionDeclares the shape of a pipeline's output
Field typesString, Number, Integer, Boolean, Array / List (or Array<T>), Object / JSON, Any, another schema
EnforcedA pipeline declared -> Schema fails with SchemaValidationError if its output doesn't match
Exampleschema Profile { name: String, tags: Array<String> }

agent ​

FieldValue
DefinitionInstantiates an AI actor. Binds a foundation model to parameters
Modifierssystem (system prompt), equips (binds tools/stores), requires (binds policies)
Syntaxagent Name [model-ref, key: value]
Exampleagent DataAnalyst [gemini-3-1-pro, temp: 0.1]

pipeline ​

FieldValue
DefinitionDefines a pipeline: its parameters, return type, and stages
Syntaxpipeline Name(param: Type) -> ReturnType: ...
Examplepipeline ProcessClaim(event: Webhook) -> Result:

2. Relational Modifiers (The Verbs) ​

Keywords that define relationships and permissions between entities.

equips ​

FieldValue
DefinitionGrants an agent permission to use specific tools or store
EnforcementCompile-time — unequipped API calls fail before runtime
Syntaxequips Tool1, Tool2

requires ​

FieldValue
DefinitionBinds policy guardrails to an agent
EnforcementAgent cannot execute without policy wrapper active
Syntaxrequires Guard1, Guard2

system ​

FieldValue
DefinitionSets the agent's persona prompt
Syntaxsystem "You are a QA engineer..."

3. Flow Operators (The Routing) ​

Reactive pipeline operators that dictate how the implicit context flows. No if/else needed.

|> — Push Pipe ​

Pushes the current context forward to the next node or agent.

halo
context |> Agent.prompt("process this")

|? — Gate (Conditional) ​

Evaluates structured data in the context and only continues if true.

halo
|? (context.data.risk_score > 90) =>

|! — Interrupt Pipe ​

The Human-in-the-Loop trigger. Asks the runtime's interrupt handler; with no handler, the run pauses until signal() / halo resume continues it.

halo
|! yield(channel: Slack, msg: "Approve deployment?")

|* — Fan-Out Pipe ​

Triggers parallel execution. Runs multiple nodes concurrently, merging outputs when the {} block closes.

halo
|* { AgentA.prompt("task1"), AgentB.prompt("task2") }

|? { ... } — Branch ​

FieldValue
DefinitionRuns the first arm whose condition holds; else matches anything and must come last
ResultThe chosen arm's result (or the unchanged value when nothing matches)
Example|? { (context.data.score > 0.9) => System.Notify("removed"), else => Review(post) } as outcome

|* each(...) — Each ​

FieldValue
DefinitionRuns one call per list item, in parallel (concurrency: n, default 4), in input order
ScopeThe item under its loop name (issue, {{issue.number}}) and index, inside the call only
Example|* each(issue in context.data.issues, concurrency: 2) => GitHub.add_labels(labels: issue.labels) as labeled

|<> — Loop ​

FieldValue
DefinitionWhile the condition (a string) holds, jump back to the agent's most recent stage so it can try again
Limitmax: n (default 3); then the run fails with LoopLimitError
Example|<> loop(SWE, "context.data.Shell.run.exitCode != 0", max: 3) as retries

~> — Listen (Events) ​

Waits for an external event (from the listen handler, or signal() after a pause) and stores it at context.data.<Source>.<Event>.

halo
~> listen(UI.Button_Click)

4. Compiler Directives ​

Annotations placed above agents or pipelines that control how they run.

@checkpoint ​

FieldValue
DefinitionOn a pipeline: saves a snapshot after every stage (and at a closed gate) to .halo/checkpoints
BenefitContinue a failed or halted run with halo run --checkpoint <file>

@shadow(Name) ​

FieldValue
DefinitionOn an agent: runs it alongside every call to the named agent (or model) and records its output, which is never used
Use caseComparing a new model or prompt on real traffic

@retry(count, backoff) ​

FieldValue
DefinitionRetries model and tool calls on transient failures (network, 429, 5xx, timeouts); never on policy violations
Example@retry(3, 2s)

@timeout(duration) ​

FieldValue
DefinitionOn a pipeline: aborts the whole run. On an agent: aborts each call
Unitsms, s, m, h, d
Example@timeout(5m)

@correct(n) ​

FieldValue
DefinitionWhen an output policy rejects an agent's answer, show the agent the reason and ask again, up to n times
Applies toAn agent, or a pipeline (all its agents)
Example@correct(2)

5. Native Primitives (The Built-ins) ​

Reserved functions for state mechanics.

yield ​

FieldValue
DefinitionAsks a human: the request (message, channel, attachments, timeout) goes to the interrupt handler, or the run pauses
Used withThe `
Argschannel, msg, timeout, attachments

context ​

FieldValue
DefinitionThe state of a run
Namespacescontext.current (flowing value), context.input (arguments), context.data (results), context.meta (cost, calls, violations), context.trace (hash chain)

as ​

FieldValue
DefinitionBinds a stage's result to a name under context.data
Applies to|> calls, fan-out items and blocks, |! yield, ~> listen
Example|> Analyst.score(deal) as score then |? (context.data.score.value > 80)

System ​

FieldValue
DefinitionBuilt-in callee for runtime utilities and events
MethodsPrint, Log (output, pass the value through), Sleep(duration), Fail(msg), Value(x) (make x the flowing value), Pick(value, fields: [...], maxChars: n) (keep only dotted fields of an object or of each list item; labels.name maps over a list), and the events ResolveIncident, Publish, Distribute, TriggerWebhook, Notify (sent to onSystemEvent)
Example|> System.Pick(context.data.issues.items, fields: ["number", "title", "labels.name"], maxChars: 1500) as items

6. Lexical Tokens ​

Brackets & Punctuation ​

TokenUsage
[ ]Agent model config block
( )Function arguments, conditions
{ }Fan-Out parallel block
:Type declarations, key-value pairs
,Argument separator
&Policy rule combinator
.Property access, method calls

String Literals ​

  • Double-quoted: "hello world"
  • Single-quoted: 'no escape needed'
  • Escape sequences: \", \\, \n, \t

Model References (MODEL_REF) ​

Provider/name identifiers with dashes and slashes. Must contain at least one - or /.

ExampleProvider
openai/gpt-4o-miniOpenAI
anthropic/claude-sonnet-4Anthropic
gemini-3-1-proGoogle

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