Skip to content

Define the kinds of agents you run

Ask for an agent kind, change it, retire it, read it and see who runs it, with af kind, and what an agent started as a kind may be.

An agent is a program that holds a key and does work. Left to itself, whoever starts one says what it is: its program, its model, its instructions, and as much of its starter’s authority as it may keep. An agent kind is the organization’s own statement of that. It names the program an agent of it runs, the instructions it starts with, the models it may call, the most roles and folders it may have, and how long it may live. An agent started as a kind may be no more than the kind says, and the forge refuses a start that asks for more.

The forge ships no kinds. An administrator asks for each, and the asking is a request like any other change of the organization: another administrator approves it, or the asker’s word does unless the forge is set to require a second one. What a kind is is explained here; this page is the commands.

A kind is a series of versions. A version is a record the forge signed, and it never changes: a change is a new version, and an agent is started as one version, which it keeps for its life.

Name the models first

A kind lists the models its agents may call by id, and the id must be one the organization’s registry knows. Register one, as the models page shows:

$ af-server --dev
...
$ source ~/af-dev/dev/env
$ af model request claude-sonnet-5-5 --vendor anthropic --family sonnet --deployment api
done: it took effect at once, on your word as an administrator

Ask for a kind

A new kind needs a purpose, a program, instructions and the roles its agents may hold, and, if a person’s or an agent’s birth starts it, how long an agent of it lives. The instructions are read from a file, or from standard input with -: nobody edits a file the forge reads, and the forge keeps the text exactly as it was sent.

$ printf 'You write code under src and nowhere else.\nAsk before you delete a file.\n' > coder.md
$ af kind request coder --purpose "writes code under src" --program claude-code --model claude-sonnet-5-5 --instructions coder.md --role writer --folder src --lifetime 2h
done: it took effect at once, on your word as an administrator

Everything the flags leave out is empty or none: this kind may not start agents, spend a budget, reach a host, or have a rule for a harness’s requests to act. --permissions takes those rules as a JSON list in a file, which Permission rules describes. The request takes effect on the asker’s word as the only administrator; where a second one is needed, the line says so and tells the approver how to read the text:

$ af kind request reviewer --purpose "reads changes" --program claude-code --instructions review.md --role reader --lifetime 1h
requested 3f9a0c21...; it takes effect once approved with `af approve`
its instructions wait on the request: `af kind request-text 3f9a0c21...` prints them

Read the kinds

af kind list shows each kind as its current version: the number, whether new agents may be started as it, and what it is for.

$ af kind list
coder  v1   active   writes code under src

af kind show shows the whole record, in words: what an agent of it may be, the digest of its instructions, and the versions the kind has had.

$ af kind show coder
coder version 1 (current)
id           a2c672583718f9fcb25d28e5cdda6e9a226eb30c9af686390607bfcdf3a05201
state        active
purpose      writes code under src
born of      a person's or an agent's birth
program      claude-code
models       claude-sonnet-5-5
roles        writer
folders      src
classes      none
acts         none
lives        2h
budget       none
egress       none
permissions  none
instructions 73 bytes, sha256 76443088610b3d4922f702e8021ca742015925dd3db65886daef704a865008eb
versions     1

af kind text prints the instructions, exactly as they were approved. You may read them if you are an administrator or may read every folder the kind names; a kind that only the forge starts is read by administrators alone. Anyone else who asks is told there is no such text, as for a text that does not exist.

$ af kind text coder
You write code under src and nowhere else.
Ask before you delete a file.

Change a kind

A request is a whole new version, and what you leave out is kept from the current one. To shorten an agent’s life, say so and nothing else:

$ af kind request coder --lifetime 1h
done: it took effect at once, on your word as an administrator
$ af kind show coder
coder version 2 (current)
id           5612a51354aca7b3f51b3936026c4864dbb86c7676307f7b4ebc628af42c8067
state        active
purpose      writes code under src
born of      a person's or an agent's birth
program      claude-code
models       claude-sonnet-5-5
roles        writer
folders      src
classes      none
acts         none
lives        1h
budget       none
egress       none
permissions  none
instructions 73 bytes, sha256 76443088610b3d4922f702e8021ca742015925dd3db65886daef704a865008eb
versions     1, 2

A request names the version it changes, and is refused if that is no longer the current version when it is approved, so two administrators who change a kind at once do not overwrite each other. --base N names the version you expect to be current; the request is refused if another is. A list flag takes a comma-separated list, and an empty value means none: --act '' takes every act away.

The forge checks a request when it is asked and again when it is approved, on what is true then, and a refusal changes nothing. A kind that names a model the registry does not hold is refused:

$ af kind request scribe --purpose "writes notes" --program claude-code --model gpt-0 --instructions coder.md --role writer --lifetime 1h
Error: PermissionDenied: the model "gpt-0" is not in the registry, by the id it is registered under
[1]

Retire a kind, and bring it back

A retired kind refuses new agents and touches none that live: they run until they expire or are stopped. Retiring is a new version of the kind, as every change is, so the list of kinds, which leaves out the retired, no longer shows it until you ask with --retired.

$ af kind retire coder --reason "replaced by a kind for each language"
done: it took effect at once, on your word as an administrator
$ af kind list
$ af kind list --retired
coder  v3   retired  writes code under src

af kind restore asks for it to start agents again, checked in full: the models it names must be active.

$ af kind restore coder
done: it took effect at once, on your word as an administrator

Who runs a kind

af kind agents lists the agents that are live as a kind, retired or not, every version of it, or every kind if you name none. It needs an administrator. An agent is live until it expires or is stopped. The list is in the order of the version and then the agent’s own id, and a long one ends with the command that goes on.

$ af kind agents coder

Nothing runs as coder yet. An agent is started as a kind by the agent or person that starts it, and today that is the start_agent tool, which takes a kind: what it leaves out is taken from the kind, and what it names must lie within it. The forge refuses a start that asks for more than the kind gives. An agent that was started as a kind may start agents itself only if its kind lists the act coordinate.

Example requests

An agent of a kind that lists the act coordinate may start agents, and what it starts has no more than it has, as every birth has no more than its parent. A budget is stated in tokens, in millionths of a currency unit, or in runner seconds, each or none; it is recorded now and enforced by the steps that add what meters it:

$ printf 'You split a task into parts and start an agent for each.\n' > lead.md
$ af kind request lead --purpose "splits a task and starts the agents for its parts" --program claude-code --model claude-sonnet-5-5 --instructions lead.md --role writer --folder src,docs --act coordinate --lifetime 4h --budget-tokens 2000000
done: it took effect at once, on your word as an administrator

A kind that only the forge starts, such as one that reviews, has no lifetime, and must say what it may touch: --folder '' for a kind of the forge is the whole repository, said outright, not left out:

$ printf 'You review a change and say what is wrong with it.\n' > review.md
$ af kind request merge-reviewer --born-of forge --purpose "reviews the changes the forge asks it to" --program claude-code --instructions review.md --role reader --folder '' --act review
done: it took effect at once, on your word as an administrator
$ af kind list
coder           v4   active   writes code under src
lead            v1   active   splits a task and starts the agents for its parts
merge-reviewer  v1   active   reviews the changes the forge asks it to

Two administrators

Where the forge requires a second administrator, a request waits in the queue of every administrator. The approver reads the text first, and a request that is wrong is withdrawn by its asker, or by any administrator, and its text is dropped with it:

$ af kind request-text 3f9a0c21...
You write code under src and nowhere else.
Ask before you delete a file.
$ af kind withdraw 3f9a0c21...
withdrawn 3f9a0c21...; its text, if it had one, is dropped

An asker may have 8 requests for kinds and models open at once.

Type to search…

↑↓ navigate↵ selectEsc close