has
has
Declare fundamental capabilities that change what a machine is, not just what it does. Currently, the only supported capability is agency, which transforms a machine into a governed agent with persistent identity, conversation, memory, and evolution.
has appears before all other sections because it fundamentally alters the machine’s nature. A machine with has agency is not the same kind of thing as a machine without it; it gains an identity (agt_ prefixed ID), a cognitive layer, and two modes of operation.
When to use
Use has agency when the machine should:
- Maintain a persistent identity across invocations
- Be addressable directly (talked to via chat, A2A, or signals)
- Have access to the full Koda cognitive layer (conversation, memory, awareness, autonomy, evolution, coordination)
- Explain its decisions and improve over time
Omit has entirely for machines that are pure functions, pipelines, or utilities. Most machines do not need agency. A machine that classifies text or fetches data does not need persistent identity or conversational ability.
Syntax
has agencyThat is the complete syntax. has takes a bare capability name. No colon, no value, no block. The parser accepts has <identifier> and validates against known capabilities. In the current language version, only agency is valid.
Two modes of operation
A machine with has agency operates in two modes:
| Mode | When | Tools available |
|---|---|---|
| Working | Executing its defined steps (default) | Only domain tools declared in implements |
| Conversational | Addressed directly (chat, A2A, signal) | Koda platform tools alongside domain tools |
In working mode, the agent runs its steps normally. In conversational mode, the runtime provides additional Koda platform tools so the agent can reason about itself, its history, and its environment.
Agent instances
Individual agent instances are declared in krate.toml, not in the .mashin file. Each instance gets its own identity and configuration:
[[entities]]name = "support_agent_1"The .mashin file defines the agent’s behavior; krate.toml defines its instances.
Examples
Agent with goal and governance
machine email_assistant "Email Assistant"
has agency
achieves goal "Stay on top of email for the user" succeeds when "all emails triaged within 30 minutes" never "send a reply without user approval"
accepts inbox as text, is required
responds with triaged as boolean
implements ask triage, using: "anthropic:claude-sonnet-4-6" with role "You are an email triage assistant" with task "Triage this email and decide the action: ${input.inbox}" tools read_email: "@mashin/actions/email/read" create_task: "@mashin/actions/planner/create" returns triaged as boolean
ensures permissions allowed to llm_call, http requires approval for send_emailMinimal agent
machine greeter_agent "Greeter"
has agency
accepts name as text, is required
responds with greeting as text
implements compute greet {greeting: "Hello, " + input.name + "! I'm your personal assistant."}Overriding Koda cognitive machines
You can override any @system/koda/* machine by writing a machine with a matching name in your project. For example, if your project namespace is @alan, then @alan/kardia overrides @system/koda/kardia.
Canonical ordering
has is section 0, appearing first because it changes the machine’s fundamental nature:
machine name has agency <-- here (section 0) uses ... achieves ... accepts ... responds with ... defines ... implements ...Governance
has agency does not bypass governance. An agent is governed by the same ensures rules as any other machine. The difference is that agents gain additional capabilities (conversation, memory, evolution) that are themselves governed through the Koda cognitive layer. Every cognitive operation performed by an agent is an inspectable @system/koda/* machine call (the Smalltalk property).
Translations
| Language | Keyword |
|---|---|
| English | has |
| Spanish | tiene |
| French | a |
| German | hat |
| Japanese | 持つ |
| Chinese | 具有 |
| Korean | 가진다 |
See also
- achieves - Goal specification (especially useful for agents)
- implements - Agent behavior definition
- ensures - Governance rules that agents must follow
- ask … using - LLM reasoning steps used by agents