Skip to content
Developer Preview — APIs and language features may change before 1.0

optimizes

optimizes

Section: what the machine measures and improves (metrics, rewards)

Children

Translations

  • es: optimiza
  • fr: optimise
  • en: optimizes
  • de: optimiert
  • ja: 最適化
  • zh: 优化
  • ko: 최적화

Example — An assistant with rules

Sorts incoming support messages, states its goal, asks an AI model for help, and declares what it is and is not allowed to do. Also declares what it measures and what gets recorded.

machine support_triage
achieves
goal "Route each message to the right team"
succeeds when "the right team gets the message"
never "share customer details outside the team"
for example
assuming classify {team: "billing"}
given {message: "My payment failed"}
expect {team: "billing"}
accepts
message as text, is required
responds with
team as text
implements
ask classify, using: "fast"
with role "You are a support message sorter."
with task "Choose a team for: ${input.message}"
tools
web_search: "Look things up on the web"
returns
team as text, is required
ask fetch_page, from: network.http
context
url: "https://example.com/teams"
ask peek, of: order_check
question: "current status"
ensures
permissions
allowed to
model
not allowed to
network.http.post
requires approval for
network.http
authority
level: admin
guards
no_pii
on_violation: "redact"
needs
api_key: "required"
optimizes
metrics
accuracy type: percentage, target: 95
rewards
speed_bonus weight: 0.3, signal: latency
records
events
behavioral: enabled
retention
days: 90
redaction
fields: ["email"]
integrity
hash_chain: enabled
verifies
test "billing goes to billing"
assuming classify {team: "billing"}
given {message: "My payment failed"}
expect {team: "billing"}