OpenProgram Docs

Configurable Agents

An Agent is a saved, reusable execution configuration. It is edited in eight sections (General, Programs, Skills, MCP, Memory, Context, Always-on, Advanced); saves are atomic and revision-checked. New Agents keep memory off.

PageCovers
Editor and core fieldsPrototype with illustrative data; it never changes live configuration
CapabilitiesPrograms, Skills and MCP policies
Programs selectorList, tree, inspector
Implementation planStages, migration, scenario detail

Objects

ObjectIdentity and lifetimeBoundary
AgentConfigImmutable value for one resolution; may be inline and unnamedNo implicit persistence, session or memory allocation
AgentSpecSaved ID, display name, revision and AgentConfig fieldsMetadata and configuration, not a running worker
ExecutionRun or job ID and immutable effective configurationOne invocation; many may reference one Agent
Session / DAGConversation and execution historyHistory reuse is chosen apart from Agent selection
Memory spaceStable store reference with access policyOptional; never inferred from a matching display name

AgentSpec is the persisted envelope; AgentConfig is its typed projection, not a second registry. Role, persona, dedicated model, workspace, memory and schedule are all optional.

Current implementation

AreaTodayGap
Saved configurationruntime/agent_registry/manager.py stores model, effort, instructions, Programs, skills, MCP, identity, session policy, description, revision, memory policySchema 2 migration; transactional multi-file lifecycle
Agents UIagents-page.tsx: eight sections, one draft, catalog model picker, save-conflict comparisonEffective-value preview with provenance; embedded trial
Function executionagent() and llm() take model, effort, tools and instructions directlySaved-Agent or inline AgentConfig selection
Delegationagent tool accepts agent_id, clean/inherit, background, toOne resolver for direct calls and durable dispatch
Management writesWhole-config atomic conditional write against expected_revision or legacy updated_at, under the writer lockMulti-file lifecycle as one transaction
Memoryself or legacy_global, applied to execution, background extraction, derived results and recovery, with policy-epoch revalidationCatalog of arbitrary shared spaces
Workspaceworkspace.py seeds instruction filesAn Agent directory is not isolation

Schema and defaults

FieldMeaningDefault, validation
schema_version, revisionFormat; monotonic saved revisionNew format 2; manager assigns revision
name, description, identityDisplay name, optional description, channel identityImmutable ID for saved records only; only a name is required, and a model only if no default exists
model, thinking_effortProvider-qualified reference, supported levelUnset inherits; unsupported blocks execution
system_prompt, instruction_filesInline instructions; allowlisted workspace files (path, required default true)Omission inherits; empty clears this layer only
tools, skills, mcpIndependent capability policiesinherit, all, selected, none; selected empty means none
memorymode, read_spaces, write_space, required (default false)New and anonymous configs off; existing Agents migrate to legacy behaviour
contexthistory: inherit, clean, selected; node referencesLegacy inline calls inherit; named or inline config switches default clean
environmentcwd reference, sandbox profile referenceInherited; missing explicit path fails before tools run
limitsResource-governance references and overridesUnset inherits; child cap never exceeds parent
Session policyChannel scope and reset, explicit timezone referenceDoes not decide function history or memory access

Not in the first implementation: arbitrary provider parameters, inheritance between named Agents, custom execution engines, arbitrary memory plugins. Inline configs use system defaults, not hidden fields from the caller's saved Agent.

Proposed wire shape
{
  "schema_version": 2,
  "id": "general",
  "name": "General",
  "revision": 1,
  "model": {"provider": "provider-id", "id": "model-id"},
  "system_prompt": "",
  "tools": {"mode": "selected", "allowed": ["tool_a"], "disabled": []},
  "skills": {"mode": "none"},
  "mcp": {"mode": "none"},
  "memory": {"mode": "off"},
  "context": {"history": "clean"}
}

PATCH /api/agents/general
{
  "expected_revision": 1,
  "system_prompt": "Use concise answers.",
  "memory": {"mode": "off"},
  "reset_fields": ["model", "thinking_effort"]
}
  • The flat AgentSpec envelope stays. POST takes a name plus optional executable fields; id, revision and timestamps are server-assigned unless a valid explicit legacy ID is given.
  • AgentConfig has executable fields only. Export/import excludes server metadata and assigns a fresh identity. The package exports AgentConfig beside agent and llm; a provider-qualified model string normalizes to the provider/id object.
  • Active read modes need at least one authorized read space; read_write needs exactly one readable write target. Off leaves bindings inactive; the editor may keep them in its draft.
  • Unknown fields, invalid types and a field in both reset_fields and the changes are rejected before writing. Readiness is returned apart from stored configuration.

One resolver

The base comes from exactly one source, in order: explicit agent_id, explicit config (mutually exclusive with it), ambient Agent, system default. Session overrides apply only while on the same Agent identity; a switch inherits no model, prompt, tools or memory bindings. Authorized invocation overrides replace fields next; authority constraints apply last and revocations are rechecked at every effectful boundary.

ValueMeaning
Omitted / UNSETInherit; PATCH omission leaves storage unchanged
Empty stringClear prompt or description; clearing model uses reset_fields
Empty selected listExplicit empty scope, never all
mode=none, memory.mode=offExplicit disable, not inheritance
reset_fieldsDelete the local override and expose the base; JSON null is rejected
Lists, policy objectsReplace atomically; no implicit union
Scalar object fieldsPatch named leaves; normalize to a complete policy before commit
Conflicting overridesReject fields given through both legacy keywords and overrides
Permission, quotaIntersect; deny wins; minimum finite cap; never last-write

Dispatch acceptance pins the effective snapshot, Agent revision, policy version and catalog/preset versions (references and hashes, never credentials). Queued work, retries and resume keep it and recheck revocations; new independent turns resolve again.

Public calls

EntryCreatesHistory
agent(), llm()Execution node with the selected config; no saved AgentSame DAG storage, separately filtered model view
agent tool without toDurable child task or branchstart_from=clean/inherit/exact-node
agent tool with toNext turn on the addressed branchTarget Agent unchanged; conflicting agent_id rejected
Chat, CLI, schedulerExisting session and job types, same resolverScheduled jobs resolve Agent ID at each firing and set it on the task's branch; resume keeps its snapshot
  • llm() has no Python, Program or MCP tool loop, even when the Agent allows them. Explicit web_search=True stays, under native-action checks; selecting an Agent never enables search.
  • A resolved view is bound through a context-local scope and reset in finally. Runtime.model and process-global Agent state are never mutated.
  • A named selection error is explicit, never a fallback to main.
  • Switching the chat Agent starts a new context by default; keeping history is explicit and marks retained data as disclosed.
Proposed Python API (not available yet)

Extends agent() and llm() with agent_id, config, overrides and history selection; no parallel executor. Validation and return types stay.

from openprogram import Agent

# Explicit history sharing; records stay in the same execution DAG.
agent(prompt, agent_id="reviewer", history="selected", context_nodes=[node_id])

class ExampleAgent(Agent):
    method_options = {
        'extract': {'tool': True},
        'classify': {'tool': True},
    }

    def extract(self, document):
        return agent(document, agent_id="my-agent",
                     overrides={"memory": {"mode": "off"}},
                     response_format=Result)

    def classify(self, document):
        return llm(document,
                   config=AgentConfig(model="provider:model", memory={"mode": "off"}),
                   response_format=Label)

_example_agent = ExampleAgent()
extract = _example_agent.extract
classify = _example_agent.classify

Optional memory

ModeRecallMemory toolsBackground write
offNoneNoneNo ingestion from these nodes
read_onlyAuthorized read_spacesRead and searchNo ingestion from these nodes
read_writeAuthorized read_spacesPlus one authorized write_spaceUnder writer policy and execution provenance
inheritResolved to a concrete mode firstNever passed unresolvedMigration only
Spaces
self for a saved Agent is its own namespace and invalid for anonymous configs. Implemented: self, legacy_global. Target: a selected project or shared space, which allows anonymous memory use. write_space must be readable. Enabling a new Agent's memory defaults to self, with no copy of the old global store.
Off does not
Delete memory, disable session history or remove user-provided instruction files. Text already in messages cannot be unseen; start a clean context. Pending recalls are invalidated before entering a request. It is not a filesystem sandbox: if shell or file tools can read memory files, the UI shows that.
Failure
An optional backend failure shows degraded memory and continues; required=true fails before model execution. A write failure keeps the task result and reports separately.
Not offered
write_only. A backend without enforceable namespaces cannot enable scoped memory; prompts never simulate isolation.
Write eligibility
CaseRule
LabelEvery execution node carries a write-eligibility label, space reference and policy epoch. Session-end writers, compaction extraction, source export and scheduled reorganizers filter out off and read-only nodes
Disabling writesDisabling writes blocks unsettled queued writes and prevents retroactive ingestion on re-enable. Committed memory stays
Derived outputsDerived outputs and summaries carry the most restrictive eligibility of the context included. Splitting or switching Agents cannot relabel restricted data. Off propagates a no-write restriction but does not forbid an independently authorized read later
Background writeA background write validates the original grant and current space policy at commit; revocation wins over the pin. Never retry with a broader space. External backends that cannot cancel are documented
User inputsUser-authored instructions and uploads stay inputs, even with personal facts; text outside recorded provenance is not claimed classifiable

Context, instructions and environment

SourceTreatment
Runtime and owner policyEnforced outside the model; no Agent prompt overrides it
User, project and scoped workspace instructionsExisting authority and scope rules; show provenance and conflicts
Agent system_prompt, allowlisted filesConfigurable; files are workspace path references, snapshot by content or hash in protected execution storage
SkillsLoad on demand within the allowed set
Memory, tool and web resultsData with provenance, never promoted to instructions
  • Clean means no inherited conversation messages, not no system or project policy.
  • Selected history is validated against the caller's visibility; DAG membership is not authorization. Execution history is kept by default; there is no incognito guarantee.
  • Workspace and project cwd are separate. A cwd is not an access boundary. Incompatible host or sandbox requests fail visibly.
  • Context length uses existing Context Engine limits; no second summarizer.

Capability scope and authority

Catalogs own definitions and credentials; Agent policies own references. Detail: Agent capability policies. Admission, usage, cancellation and quotas: resource governance.

  • A session or invocation may replace a preference but never expand an enforced ceiling. A delegation restriction survives an agent_id change. Rejected overrides are explained.
  • Provider-native search and other native actions are capability-gated; tools=[] alone is not a network restriction.
  • Accounts resolve through credential services; no raw keys in AgentSpec, snapshots, exports or examples. Anthropic connections use the official API and legitimately obtained API keys with API account billing.
  • Python already authorized by the host is not sandboxed by an allowlist; tools and nested agentic calls are checked at their public boundaries.

Multi-agent composition

Branches, Jobs, messages and attach references: collaboration contract, architecture. A config reused in parallel creates distinct runs, not new saved Agents.

OperationContract
Independent invocationNo automatic previous-task history; one Agent ID may serve many sessions
DelegationExplicit goal, input and filtered context; parent cancellation and budget stay in task control
Continue a taskAddress an existing run or branch; target Agent stays
Shared memoryExplicit bindings; concurrent writes use backend version checks and idempotent execution IDs
Shared files, browserOwnership and serialization for conflicting mutations; Agent names do not isolate
Automatic choiceDeferred to P6; ranks existing eligible configs, never creates Agents or widens scope

One successful run never persists config changes, skills or preferences; durable updates use explicit write mechanisms. Role orchestration, automatic topology and marketplace publishing are out of scope.

Management API

OperationContract
GET /api/agents[/{id}]Summary and detail DTOs with schema_version and revision; no memory contents or secrets
POST /api/agentsName-only creation; safe explicit defaults; optional idempotency key; no provider call
PATCH /api/agents/{id}expected_revision; top-level changes plus reset_fields; validate the whole candidate, compare and write once under a cross-process lock
POST /api/agents/resolveProposed read-only preview for saved or draft config; no session, memory search or credentials
POST /api/agents/{id}/duplicateConfiguration only; new ID and revision; self maps to a new empty namespace; shared bindings shown
POST /api/agents/{id}/defaultOne authoritative pointer, updated atomically; profile.default is derived
DELETE /api/agents/{id}409 for default or active references; show affected resources before confirmation; recoverable intent before destructive cleanup
StatusWhen
428Neither precondition (updated_at is kept for display and the temporary adapter)
409Stale revision
400Invalid schema
403Forbidden scope
404Unknown ID

An unavailable reference saves as a draft with warnings; starting is blocked if it is required, as a typed preflight error. Unknown schemas fail closed without rewriting.

Atomic persistence

One canonical agent.json, atomic replacement. A small recovery journal covers create, default and delete across the index and resources; several os.replace calls are not a transaction. Startup reconciles unfinished intents before serving writes. Deleting an Agent never deletes shared memory, global credentials or external workspaces. Session and DAG references are enumerated through their store.

Lifecycle and failure

EventBehaviour
Anonymous configNo sidebar entry, workspace or memory folder. Saved creation initializes config only; instruction files on explicit request or legacy bootstrap
DuplicateNo sessions, learned memory, schedules or credentials. Shared references stay visible. Copying instruction contents is separate from copying references
Export, importPortable configuration and optional selected instruction text; no memory, history, machine paths, credentials or automatic schedules. Import validates, resolves references, previews permissions, starts nothing
DeleteEnumerate owned versus referenced resources. Private memory is retained or explicitly deleted; shared memory never. Tombstoned IDs accept no runs; unfinished cleanup is visible and retryable
FailureFailed preflight: no provider request or side effect. Failed save: draft kept. Provider failure: bounded retries, no silent model or policy change. Cancel: scoped state restored, never success
Policy editAffects new executions; deny or revocation applies at the next access boundary; disabling memory writes invalidates unsettled writes. The UI shows the difference

Built-in Agents

Ordinary saved Agents: the Assistant with Decision, Lightweight helper and Coordinator, plus the job Agents (see Always-on Agents). No template catalog: the Agents list is it, and New Agent starts blank.

InstallationBehaviour
At startupOnce a default exists, the server installs built-ins this instance has never installed, through the manager under its lock
RecordedTheir ids, in the registry index
KeptIDs, edits and the default
ReadingCreates nothing
DeletingDoes not trigger recreation
AgentBehaviour
All three specialistsFixed parameters of the Agent class via AgentSpec and Agent.from_spec; no role prompts. Tasks and instructions come from the call site and Context; an empty saved prompt does not erase ambient instructions. Models stay editable; local installation assigns configured models. Roles guarantee neither cost nor quality.
DecisionAgent.choose picks one supplied option in a single tool-free llm request with the choice resolver: no advice, no re-pick; returns the option ID and rejects invalid answers. Keeps Context and DAG scope. Tools disabled.
Lightweight helperTools disabled
CoordinatorInspects evidence and delegates authorized tasks
Page layout
AreaLayout
PageSaved-Agent list and full-width editor. Secondary navigation uses the shared ManagePage split layout and sidebar width token
HeaderHeader: name, ID, conversation actions. Eight tabs stay horizontal at every width and scroll when needed
GeneralGeneral has name, purpose, the switch that offers the Agent to other agents, avatar, model and reasoning. Manual instructions stay in Advanced, with the channel identity and where the Agent works when another agent starts it (agent collaboration). No inner navigation column, duplicate introduction or settings summary
TypeInputs normal weight, labels medium; application font, neutral surfaces, control dimensions, blue selection
PanelsPanels fill the editor inside standard padding, no fixed maximum width. The editor scrolls independently; the save footer stays visible and reports draft state
Narrow screensNarrow screens replace the list with a select and stack identity fields. Saved invalid reasoning choices stay visible; inherited incompatible settings raise no pre-edit error

Acceptance: built-ins visible and editable; New Agent starts blank; repeat installation keeps edits; Agent.from_spec runs a saved record; draft, conflict, duplication and conversation flows work; desktop and narrow layouts checked on the real page and the App.

Acceptance contract

IDEntryExpected
A01Agent API, UIA name-only Agent runs a general task
A02PATCH from two clientsOne same-revision update wins; no mixed config or partial save
A03agent(), llm(), chat, dispatchSame base and overrides give equivalent config; llm has no tool loop; native search explicit and authorized
A04Parallel nested functionsModels and memory policies do not leak; scope resets after failure or cancel
A05All memory ingress and egressOff and read-only runs never become learned memory
A06Switch Agent, selected historyNo implicit history; inaccessible nodes rejected
A07Discovery and invokeEmpty stays empty; missing visible; denied never executes
A08Queue, retry, resumePinned revision; revoked capability cannot execute
A09Duplicate, export, deleteNo accidental copy or deletion of memory, credentials, schedules or shared resources
A10Agents page, narrow, keyboardAll sections reachable; no overflow; dirty, error, conflict and degraded states visible
A11Legacy migrationEffective model, scope, memory and history kept
A12App, CLI, schedulerShared resolver evidence

Scenario inputs and stage gates are in the implementation plan. A static documentation check satisfies none of these.

References
ReferenceAdoptedBoundary
Meta MusePersistent work; policy enforced outside the acting modelNo claim of Muse VM isolation; memory and persona stay optional
Grok Bot: bots, overviewSaved configurations, separate conversations, explicit shared resourcesNo specialized job required; schedules and learned memory not duplicated
OpenClaw: configuration, CLI, workspace, runtimePer-Agent workspace and policy referencesWorkspace is no sandbox; no profile inheritance graph
Claude CodeSeparate model, instruction, tool and session choicesAnthropic integration stays official API-key based
CodexSeparate config, provider and MCP responsibilitiesNo claim of identical profile or approval semantics

Product and configuration concepts, not proof of internals. No claim of research novelty, benchmark wins or autonomous routing.

Implementation status

Implemented
Eight-section page with shared draft, catalog model selection, save-conflict comparison, animated icons; built-in saved Agents and Agent.from_spec; description, revision, atomic conditional saves; memory policy with spaces self and legacy_global, defaulting new configurations to off and keeping legacy shared read/write. Web conversations use saved Agents; independent trials persist a read-only-or-off session snapshot. Missing required MCP servers fail before a model request.
Target
Schema 2 migration, transactional multi-file lifecycle, Python AgentConfig, resolver parity across entries, shared-space catalogs, effective preview, embedded trial, portable import/export, automatic Agent/model selection.

Configure an Agent

Configuration belongs to a conversation branch

A conversation shares its project and working directories. Each branch stores its own Agent, model and provider, effort, tool intent, search toggle, permission mode and rules, Plan, sandbox override and service tier.

A new branch copies its source's settings once, then changes alone. Switching restores the destination's settings, empty overrides included; Rewind, Undo and Redo keep them. A scheduled task's branch copies the selected branch with the task's Agent at its first run; later runs keep that record and take the task's Agent again.

Branch references own the settings; the session's top-level fields mirror the selected branch. A switch saves the source and restores the destination with the head in one commit. Old sessions seed a branch from their settings once; missing history is not reconstructed.

Admission freezes the turn's Agent, model, effort, Fast, tool intent, Sandbox, and permission mode and rules from its branch, the first of:

  1. the branch the request names;
  2. the record reserved for the run's message (a scheduled run's);
  3. the live same-session parent's branch;
  4. the record at the turn's starting message;
  5. the selected branch.

A chat, scheduled, background or headless turn on an unselected branch runs that branch's Agent and permission. A Job keeps what it was given, same-session children inherit their parent, and Trial Agents keep their snapshot.

ChangeStored on
Composer control, model pick, Agent switch, permission, SandboxThe branch the request names, the one the pane shows, whatever is selected elsewhere. Without a branch: the selected one, guarded by an older client's expected_branch_id.
Message sendThe message's branch: effort, web search, Fast, Sandbox, and the composer's mode while the branch has no versioned permission. Never the Agent.
/skill messageNothing. Its allowed-tools list narrows that turn only.
"Allow for this conversation" during a turnThe turn's branch.
null, or the effort menu's defaultInherit: the project, Agent or global value decides.
Read or write of a branch with no recordAnswered as branch_gone, with the selected branch. The composer reads the branch the conversation shows and applies the change there.

An unfocused pane rereads its model settings when its branch or that branch's Agent changes. A model pick or Agent switch on a branch that is not selected leaves the live runtime alone and is not broadcast, so other panes and the sidebar keep the selected branch's model; the pane takes the model and its controls from the reply.

Every model settings read names the pane's branch, so after any broadcast a pane on a branch that is not selected reads back that branch's model, not the selected one's. A broadcast names no conversation, so no chip takes its model: each keeps what it shows until its own read lands.

The read also carries the branch's stored effort and web search toggle. A pane takes them unless one of its own writes is still on the way, so a setting changed from another window or the API reaches an open pane without a reload.

Implementation status

Not yet implementedToday
Two branches of one conversation side by sideA pane shows the selected branch. The server already runs a turn on each branch at once, each with its branch's settings (Two branches running at once).
ACP turns on the branch's AgentThe ACP server sends its own Agent, so a branch switched in the app runs the server's Agent from ACP.
Scheduler Sandbox policy per branchThe run's request carries its branch's Sandbox; the scheduler process installs the selected branch's policy.
Last updated · 2026-11-25