Build an Environment: Plug Kits In and Out
You do not need to learn every kit to build an environment. Kits come in nine categories. You pick an authority level, plug in the kits that level asks for, then add the ones your job needs. neusym plan…
You do not need to learn every kit to build an environment. Kits come in nine categories. You pick an authority level, plug in the kits that level asks for, then add the ones your job needs. neusym plan checks every change before an agent runs and names anything that is missing.
This guide starts from the smallest environment that runs an agent, then shows how to unplug, plug in, swap and step up a level. Every output below comes from a real run.
In a checkout of this repository,
neusymisnode apps/cli/dist/src/index.js(runnpm run buildfirst; the Quickstart shows a shell alias for it). In your own project it isnpx neusym, once@neusym/cliis installed. The packages are not on npm yet;npm run pack:osswrites installable tarballs.
#1. Start from Seven Kits
One file is enough:
# my-env/workspace.yaml
level: review # read only: the agent can look and answer, not change anything
profile: test # in-memory backends; `local` keeps state in SQLite and files on disk
kits:
- "@neusym/kit-harness@0.1.0" # runs the agent loop: model, tool, model
- "@neusym/kit-tasks@0.1.0" # tracks each task and run
- "@neusym/kit-tool-gateway@0.1.0" # every tool call passes through here
- "@neusym/kit-budget@0.1.0" # caps spend, tokens and steps
- "@neusym/kit-secrets@0.1.0" # keeps keys out of prompts and answers
- "@neusym/kit-tenancy@0.1.0" # keeps each tenant's data apart
- "@neusym/kit-injection-guard@0.1.0" # outside text cannot trigger writes
grants:
systemStore: [tenancy]Six of these kits are what the review level requires. The seventh, harness, is the part that runs the agent. The grants line exists because tenancy keeps records that span tenants, and a kit can do that only when the workspace file allows it by name.
Check it, then run a task. --model-turns replays scripted model replies, so this needs no API key:
echo '[{"text":"Nothing to inspect yet; the environment is up."}]' > turns.json
neusym plan ./my-env
neusym run ./my-env "Say hello" --model-turns turns.jsontask task_… · run run_… · completed
answer:
Nothing to inspect yet; the environment is up.
task.run task_… completed 19ms
├─ context context.build 1→1 items 3ms
└─ step 0 completed 8ms
├─ guard harness.step allow 1ms
├─ model.call scripted-v1 140 tok $0.0005 stop 2ms
├─ guard output.release allow 0ms
└─ guard task.complete allow 0msThe guard lines are kits at work: budget checked the step, and secrets and tenancy checked the answer before it left.
#2. Unplug a Kit
Delete the budget line and plan again:
Workspace composition failed with 3 error(s):
[Z5] Level "review" requires socket port "budget@1" (from "review" contract), which has no provider.
[Z5] Level "review" requires a guard in phase "budget" on "action.authorize".
[Z5] Level "review" requires a guard in phase "budget" on "harness.step".Plan refuses and says which rule went missing: nothing would cap spend before a tool call or a model step. Each kit the level requires holds up a rule like this one, so you never have to remember the list. Unplug one and plan names what it was doing.
Kits the level does not require come out without an error. You lose what they did, and nothing else changes. Take evals out and trial suites stop running; take diagnostics out and you lose its failure and cost reports.
#3. Plug In What Your Job Needs
Look for a kit by what you need, not by name. Each category covers one kind of job:
| Category | Covers | Reach for it when you need | Kits |
|---|---|---|---|
runtime | How work runs | another runner, parallel workers, timers, crash-safe writes, an offline sandbox | harness, cli-executor, procedure-executor, worker-pool, scheduler, operation-journal, sandbox, working-state, convergence, resilience · EE: saga |
tasks | What the work is | work arriving from webhooks, multi-step plans, goals that change | tasks, intake, planner, goals · EE: event-router |
safety | What the agent may do | spending caps, tenant walls, injection defense, grants, human approval, undo checks, proof before "done" | budget, tenancy, injection-guard, secrets, action-gate, approvals, reversibility-gate, completion-gate, validators · EE: policy-engine, supply-chain |
tools | What the agent can touch | MCP servers and schema-checked tools | tool-gateway, mcp-bridge · EE: browser-agent |
knowledge | What the agent knows | documents, search, memory, a glossary, reusable playbooks | ingestion, retrieval, search-keyword, search-vector, memory, ontology, skills · EE: knowledge-graph, search-graph, lineage, memory-consolidation, digital-twin |
reasoning | Exact rules | business rules written as code, short constraints, dry runs | rules, constraints · EE: simulation, reasoner, solver |
model | Which model answers | routing between providers, a model registry | EE: model-router, model-registry |
collaboration | Working with others | saved drafts, several agents on one job without collisions, sub-agents | artifacts, blackboard, delegation, workspace-ui · EE: a2a-bridge |
assurance | Checking the work | traces, defect tags, evals, a tamper-evident log, a second reviewer | observability, diagnostics, evals, audit-ledger, independent-review · EE: proposals, release-manager |
EE marks Enterprise Edition kits (Open-Core Editions). The Kit Catalog lists the lowest level each kit runs at and what it provides.
To plug one in, add its line and plan. Memory and keyword search, for example:
- "@neusym/kit-memory@0.1.0"
- "@neusym/kit-retrieval@0.1.0"
- "@neusym/kit-search-keyword@0.1.0"Plan passes. Two kinds of addition need one more step, and plan tells you which:
A kit that acts for everyone needs a grant. worker-pool and scheduler start work on behalf of any tenant and user, so the workspace must allow each of them by name:
[Z4] Kit "worker-pool" requests contextIssuer, but the workspace does not grant it.grants:
systemStore: [tenancy]
contextIssuer: [worker-pool]A kit above your level waits for that level. approvals belongs to commit, so it is refused in a review environment:
[Z4] Kit "approvals" requires minimum level "commit", but workspace level is "review".#4. Swap a Part
Some jobs have exactly one slot. Running the agent is one: harness runs a model loop, cli-executor runs an external coding agent CLI in a session, and procedure-executor runs fixed steps with no model at all. Plug in two and plan refuses:
[Z1] Duplicate provider for port "executor@1": "kit:harness" and kit "cli-executor".Replace the harness line with the one you want, and the rest of the environment stays as it is.
Backends swap the same way, through profile, without touching the kit list. The same seven kits plan to different drivers:
profile | Store | Blobs | Model |
|---|---|---|---|
test | store-memory | blobs-memory | model-scripted |
local | store-sqlite | blobs-fs | model-openai-compat |
local calls an OpenAI-compatible model endpoint, a local Ollama server by default; Quickstart step 3 shows the bindingOverrides that point it at a hosted model instead. The Enterprise self-host profile moves the same kits onto Postgres, S3 and OpenBao (Deployment).
#5. Step Up a Level
The level is how much the agent may do. Each step keeps everything below it and adds a few kits:
level | The agent may | Add these kits | Kits in total |
|---|---|---|---|
review | read, search and answer; every write is blocked | the seven above | 7 |
draft | save drafts and close tasks only with evidence | goals, artifacts, completion-gate, validators | 11 |
execute | make routine live writes, each with a grant, a journal entry and an audit record | action-gate, operation-journal, audit-ledger | 14 |
commit | make high-stakes writes after a different person approves the exact details | approvals | 15 |
Change level first and plan lists what the new level still needs. The 14-kit execute environment, moved to commit before approvals is added:
[Z8] Level "commit" requires socket port "approvals@1" (from "commit" contract), which has no provider.There is also an empty level that loads no kits. It exists for kernel and driver smoke tests.
Authority and Safety explains what each level enforces and why.
#6. Lock It
When the environment does what you want, pin it:
neusym lock ./my-env --writeneusym.lock.json holds a SHA-256 digest of every package the environment loads (kits, drivers, contracts, connectors) and of each domain file its packs load. With NEUSYM_PACKAGE_LOCK pointing at it, a run refuses a package that changed after you locked it, and a package that is not in the lock at all, so a kit added later does not load:
Package "@neusym/contract-telemetry@0.1.0" (contract) is not present in the package digest lock.The lock does not cover the workspace file's own settings (level, kitConfigs, bindingOverrides). Review changes to that file the way you review code.
#Next Steps
- Build one in the terminal:
neusym-build ./my-envshows these kits on a board, writes and plansworkspace.yamlon every change, and has a builder agent that picks kits for a job you describe. It can finish only whenneusym planpasses. See apps/builder. - Give the agent a world: domain terms, rules, tools and trial suites go in a domain pack. See Domain Packs and Connectors.
- See a fuller environment:
examples/demo-productis areviewenvironment with 13 kits, a domain pack, a worker pool and a scheduler. The Quickstart runs it. - Read about one kit: the Kit Catalog links every kit's README.