Lesson 3 of 14 · 5 min
The mental model: four control surfaces
Topic boundaries, instructions, available-when gates, and after_reasoning. Knowing which to reach for first is the whole skill.
Agent Script gives you four orthogonal places to enforce behavior. Knowing which to reach for first is the whole skill.
| Surface | What it controls | When to use |
|---|---|---|
| Topic / subagent boundaries | Which set of actions and instructions is "active" | Coarse phase changes (verification then refund) |
reasoning.instructions: | What the LLM is told to do this turn | Soft guidance, multi-step plans, polite phrasing |
available when gates | Which actions the LLM can even see | Hard constraints (no refund without verification) |
after_reasoning blocks | Variable updates after an action runs | Compute derived state from action outputs |
Worked example
subagent identity_verification:
actions:
verify_customer:
target: "apex://VerifyCustomer" # backing action (truth source)
reasoning:
instructions: -> # prompt (LLM-driven)
if @variables.customer_verified == False:
| Ask for an email if you don't have one. Otherwise call verify.
actions:
verify: @actions.verify_customer
go_refund: @utils.transition to @subagent.refund_processing
available when @variables.customer_verified == True # gate
after_reasoning: # derived state
if @variables.verified_flag == "true":
set @variables.customer_verified = True
Each line uses a different surface. The LLM is in charge inside
instructions: but cannot bypass available when or after_reasoning.
Quick check
The agent must never issue a refund without first verifying the customer. Where do you enforce this?