Your First Ask Step
이 콘텐츠는 아직 번역되지 않았습니다.
The ask ... using step sends a task to a reasoning provider (an LLM) and returns structured output. It is the most common way to add intelligence to a machine. Like every governed step, ask produces an intent rather than performing the action directly. The runtime mediates the intent (checking permissions, enforcing budgets) and records the call in the behavioral ledger.
A simple classifier
Section titled “A simple classifier”machine sentiment accepts text as text, is required responds with sentiment as text confidence as number behaves ask classify, using: "anthropic:claude-sonnet-4-6" with task "Classify the sentiment of this text as positive, negative, or neutral. Return a confidence score between 0 and 1.\n\nText: ${input.text}" returns sentiment as text confidence as number ensures permissions allowed to model verifies test "classifies sentiment" assuming classify {sentiment: "positive", confidence: 0.95} given {text: "I love this product"} expect {sentiment: "positive", confidence: 0.95}Let’s break this down.
ask classify, using: "anthropic:claude-sonnet-4-6"
Section titled “ask classify, using: "anthropic:claude-sonnet-4-6"”This names the step classify and tells the runtime which model to use. The format is provider:model. Supported providers include anthropic, openai, google, ollama, and groq.
with task
Section titled “with task”The instruction sent to the model. Use ${expr} to interpolate input values and previous step results directly into the prompt. There is no separate context block; data goes into the task string.
returns
Section titled “returns”The structured output schema. The model is instructed to return these fields, and the runtime parses the response accordingly.
verifies and assuming
Section titled “verifies and assuming”The verifies section holds tests, and assuming <step> {...} inside a test mocks that step’s output. When you run tests, mocked values are returned instantly without calling the model. This makes tests fast, deterministic, and free, and it is why every example in these docs runs.
Adding a system prompt
Section titled “Adding a system prompt”Use with role to set the model’s persona:
ask analyze, using: "anthropic:claude-sonnet-4-6" with role "You are a senior financial analyst. Be precise and cite specific numbers." with task "Analyze this quarterly report for key trends.\n\nReport: ${input.report}" returns trends as list outlook as text risk_level as textChaining steps
Section titled “Chaining steps”Each step’s output is available to subsequent steps via steps.<name>.<field>:
machine email_triage accepts subject as text, is required body as text, is required responds with priority as text action as text behaves ask analyze, using: "anthropic:claude-sonnet-4-6" with task "Analyze this email. Determine priority and whether it needs a response.\n\nSubject: ${input.subject}\nBody: ${input.body}" returns priority as text needs_response as boolean suggested_action as text compute format_result { priority: steps.analyze.priority, action: steps.analyze.needs_response ? "Respond: " + steps.analyze.suggested_action : "No response needed" } ensures permissions allowed to model verifies test "triages an email that needs a reply" assuming analyze {priority: "medium", needs_response: true, suggested_action: "Reply within 24 hours"} given {subject: "Question about billing", body: "Can you clarify my invoice?"} expect {priority: "medium", action: "Respond: Reply within 24 hours"}The compute step takes the LLM’s structured output and transforms it. Because compute is pure, it needs no permissions.
What happens at runtime
Section titled “What happens at runtime”When this machine executes:
- The runtime checks that
modelis in theallowed tolist - The
askstep sends the prompt to Claude - The model’s response is parsed into
{priority, needs_response, suggested_action} - The response, token count, cost, and latency are recorded in the behavioral ledger
- The
computestep runs and produces the final output
If the machine did not declare model permission, the runtime would deny the step and record the denial. Governance is not optional.
Try it
Section titled “Try it”Write a machine that classifies support tickets. Give it a subject and body input, use an ask step to classify by urgency and department, then use a compute step to build the final output.
Next steps
Section titled “Next steps”- Governance - How permissions and rules work
- Reasoning in depth - Temperature, tool use, and provider options
- ask … using reference - Full specification
- compute reference - Pure computation steps