Skip to main content

Configuration Reference

This page is the single reference for agent-folder configuration shapes and every OPENEVE_* environment variable. The guides explain when and why to use these settings:

All define* helpers are identity functions from @openeve/core: they give you type checking, and the compiler reads the declarations statically from the TypeScript AST. Manifest-affecting values must be statically readable; the compiler never executes config code.

defineAgent (agent.ts)

agent.ts default-exports defineAgent({ ... }). model is the only required field.

FieldTypeRequiredMeaning
modelstringyesprovider/model spec. The prefix decides the provider API key (for example openai/* needs OPENAI_API_KEY). openeve models lists the local catalog.
idstringnoStable logical agent identity. Keeps learned skills and durable state attached to the agent across revisions and redeploys.
reasoning"off" | "minimal" | "low" | "medium" | "high" | "xhigh"noReasoning effort. The runtime defaults to "medium" when omitted.
namestringnoDisplay name.
descriptionstringnoShort description recorded in the manifest.
contextContextPolicynoContext policy from defaultContext(...) or defineContext(...). The compiler stamps defaultContext() when omitted.
defaultToolsstring[]noAuthored tool names that are visible up front instead of deferred behind tool_search.
selfImprovementobjectnoSkill authoring config; see below.
dynamicSchedulesobjectnoRuntime-created schedule config; see below.
dynamicConnectionsobjectnoRuntime-created connection config; see below.
metadataJSON objectnoFree-form metadata recorded in the manifest.

Pi is the canonical primary engine; agent.ts has no harness: slot (declaring one fails validation with harness-not-configurable). Subagents may still declare harness: in subagents/<name>/agent.ts.

Sub-config blocks (all fields optional):

BlockFieldDefaultMeaning
selfImprovementwritabletrueAgent may author and edit its own skills under /skills.
selfImprovementwriteApprovalfalseSkill writes require approval.
selfImprovementexternalDirs-Extra directories treated as skill sources.
dynamicSchedulesdynamictrueAgent may create/manage schedules through ctx.scheduleManager.
dynamicSchedulesapprovalfalseDynamic schedule changes require approval.
dynamicConnectionsdynamicfalseAgent may persist runtime-provided MCP/OpenAPI/HTTP connections.
dynamicConnectionsapprovaltrueSaving a dynamic connection requires approval.
dynamicConnectionsallowedHosts[]Host allowlist; required non-empty when dynamic is enabled.

defineSubagent (subagents/<name>/agent.ts)

SubagentDefinition accepts every optional AgentDefinition field plus:

FieldTypeMeaning
modelstring?Optional (unlike agents). Defaults to the harness engine's own choice.
harnessAdapterDefinition?Subagent harness. Compiler default is adapter("pi"); codex and claude-code are alternative engines, LiveKit is a voice capability that rides the same harness seam (not an engine), and any registered AgentHarness kind also works.
workspaceAdapterDefinition?Sandbox/workspace adapter for the subagent (compiled with role sandbox).
connectionsstring[]?Connection names the subagent may use.
engineConnectionstring?Connection that authenticates the external engine itself.

The compiler also records what the subagent inherits: skills, tools (declared tools plus defaultTools), and context (context: true).

defineGateway (gateway.ts) and adapter()

Every gateway slot is an optional AdapterDefinition. Compiler defaults are all adapter("local") except runtime, which defaults to adapter("node").

SlotChoosesDefault
deployWhere the compiled runtime service runs.adapter("local")
runtimeRuntime host.adapter("node")
stateDurable state adapter.adapter("local")
blobBlob storage adapter.adapter("local")
sandboxDefault sandbox adapter.adapter("local")
schedulerWhere the schedule clock lives (local, gateway, postgres).adapter("local")

Telemetry is not a gateway slot — configure it in instrumentation.ts (see defineInstrumentation).

adapter() builds an AdapterDefinition:

adapter(kind: string, options?: JsonObject, extras?: { package?: string })
  • kind: adapter kind, e.g. "postgres", "railway", "pi".
  • options: JSON options merged with host-supplied extras at construction.
  • extras.package: npm package name that exports openeveProvider; it is stored as packageName on the definition. This is how third-party providers plug in with zero core edits:
state: adapter("neon-state", { pool: 4 }, { package: "@acme/openeve-neon" })

AdapterRole values: deploy, runtime, state, blob, sandbox, scheduler, channel, connection, and subagent. See Authoring Adapters for the provider-package contract and Adapters for the built-in matrix.

defineInstrumentation (instrumentation.ts)

agent/instrumentation.ts is the single home for telemetry. It is auto-discovered and run once at startup; its presence enables telemetry (no separate toggle). Wire a sink in the setup callback and set capture preferences as sibling fields.

FieldTypeMeaning
serviceNamestring?service.name on spans; defaults to the agent name.
functionIdstring?Overrides the function id on spans.
setup(ctx) => sink | voidRuns before the first turn with { agentName, manifest, env }; return a TelemetrySink to export spans.
recordInputs / recordOutputsboolean?Legacy capture flags. Default false.
captureContentContentCaptureLevel | ContentCapturePolicy?Content detail (see below). Default usage.

@openeve/otlp supplies createOtlpSink(options) / createOtlpSinkFromEnv(env) for the setup callback; see Customizing Agents → Observability for the full example and the Langfuse recipe.

Capture detail (captureContent). Controls how much of each model call is recorded, so a developer decides per environment how verbose logging is:

LevelRecords
offNo span content.
usage (default)Token usage, cost, model, provider, finish reason, tool-call spans. No message bodies.
contentAdds prompt + completion text and tool input/output, truncated and key-redacted.
fullSame coverage as content with truncation relaxed; redaction stays on unless explicitly disabled.

A ContentCapturePolicy object also accepts maxChars, redact, redactKeys, sampleRate, and includeToolIO. Prompt/completion bodies can contain secrets and PII and increase telemetry storage/cardinality — treat full as trusted-operator-only, and prefer usage in production.

defineContext / defaultContext (context.ts)

context.ts is optional; without it the compiler stamps defaultContext().

  • defaultContext(options?: JsonObject) returns { kind: "default", name: "defaultContext", options }. Options tune the default bundle, for example recentHistory: { maxMessages: 12 } or files: { includeManifest: true }.
  • defineContext(policy) declares a custom ContextPolicy:
FieldTypeMeaning
kindstringPolicy kind, e.g. "custom".
namestring?Policy name recorded in the manifest.
optionsJSON object?Policy options.
extendsContextPolicy?Base policy, usually defaultContext(...).
sourcePathstring?Set by the compiler for attribution.

Per-File Contracts The Compiler Validates

Allowed top-level entries in an agent folder: instructions.md, agent.ts, context.ts, gateway.ts, skills/, tools/, channels/, schedules/, triggers/, connections/, sandbox/, subagents/, instrumentation.ts. Anything else produces an unknown-top-level warning.

tools/*.ts

The filename is the tool name ([A-Za-z0-9_-], unique). The default export must declare description and inputSchema (errors: invalid-tool-name, duplicate-tool-name, missing-tool-export, missing-tool-description, missing-tool-schema). Optional fields: outputSchema, needsApproval, toModelOutput, defaultEnabled, and a capability block with visibility (always/deferred/skill/hidden), execution (direct/sandbox/both), namespace, tags[], aliases[]. Visibility is inferred as always for defaultTools members and deferred otherwise unless declared.

skills/<name>/SKILL.md

Markdown with YAML frontmatter. allowed-tools entries must name an authored tool or a core tool (read, write, edit, delete, list, grep, bash, ask_question, spawn_subagent, load_skill, tool_search, tool_describe, tool_call), else unknown-skill-tool. Frontmatter description, tags, and aliases feed the skill catalog.

channels/*.ts

Fields: transport (http/local/webhook/queue), route, methods[], requiredEnv[], description, connection, metadata, and ingress. Custom HTTP channels must declare a route (missing-channel-route), and channels with production requiredEnv must export send() (missing-channel-send). Provider helpers (defineSlackChannel, defineDiscordChannel, defineTelegramChannel, defineTeamsChannel, definePhotonChannel, defineGitHubChannel) stamp kind, route, requiredEnv, and ingress automatically.

ingress declares production ingress-auth secrets as any-of groups:

ingress: { requiredSecretEnv: [["MY_WEBHOOK_SECRET"], ["MY_BEARER_TOKEN"]] }

Production boot succeeds when every var in at least one group is set; dev mode logs a warning instead. The compiler stamps the declaration into CompiledChannel.metadata.ingress.

schedules/*.ts

Must declare cron (at least 5 fields) and idempotencyKey (errors: missing-schedule-cron, invalid-schedule-cron, missing-schedule-idempotency). Optional: description, timezone, message, and trigger. A trigger must name a handler that matches a triggers/<handler>.ts file, and can carry a target ({ type: "skill" | "agent" | "playbook", ... }) and metadata.

triggers/*.ts

The filename is the handler name. defineTriggerHandler({ description?, prepare?(ctx), finalize?(ctx, result), metadata? }). Handlers are trusted app code invoked by the schedule dispatch lifecycle.

connections/*.ts

Protocol is inferred from the helper (defineMcpClientConnection -> mcp, defineOpenAPIConnection -> openapi, defineHttpApiConnection -> http, otherwise declaration). Fields: subject (user/workspace/installation/environment, default user), provider, scopes[], capabilities[], binding (adapter), url/baseUrl/spec, description, required (default true). Provider helpers (defineGitHubConnection, defineTeamsConnection, defineLiveKitConnection) stamp provider, binding, and subject.

sandbox/*.ts

defineSandbox({ adapter, image?, workingDirectory?, env?, snapshot? }) or a provider helper (dockerSandbox(), e2bSandbox(), modalSandbox(), ...). snapshot is { mode: "never" | "manual" | "on_failure" | "always", retainLast?, reason? } and defaults to never.

instrumentation.ts

defineInstrumentation({ serviceName?, exporters?, recordInputs?, recordOutputs?, captureContent?, functionId?, metadata?, setup? }). If setup() returns a telemetry sink, the runtime uses it unless the host supplied telemetry directly.

Third-party provider stamping

When gateway slots or subagent harness/workspace definitions carry a packageName that is not in the built-in registry, the compiler imports that package from the agent root, reads openeveProvider.providers[].metadata, records it in manifest.providerMetadata, and emits the provider's requiredEnv and setup entries into manifest.preflight. Unresolvable packages produce a provider-package-unresolved warning (never a build failure) and keep a generic role-based requirement; the Node host re-validates at boot.

Environment Variable Reference

Every OPENEVE_* variable read by the packages in this repo. Boolean variables accept true/1 and false/0 unless noted. Provider-specific non-OPENEVE_ env (API keys, DATABASE_URL, SLACK_*, ...) is documented in Adapters and Runtime And Deployment.

Server and auth (@openeve/node)

VariableDefaultEffect
OPENEVE_ADMIN_TOKENunsetBearer token for control-plane routes (/manifest, /routes, /runs*). Production boot fails without this or a host auth policy.
OPENEVE_ENABLE_API_RUNSdisabledtrue/1 enables authenticated POST /runs in production (always on in dev mode).
OPENEVE_SCHEDULER_SECRETunsetShared secret for /openeve/scheduler/tick (Authorization: Bearer or x-openeve-scheduler-secret, compared constant-time). Unset means dev-mode-only tick.
OPENEVE_HTTP_MAX_BODY_BYTES10485760 (10 MiB)Max HTTP request body size before parsing.
OPENEVE_PUBLIC_URLhttp://localhostPublic base URL; also the fallback for connection callbacks.
OPENEVE_CONNECTION_CALLBACK_BASE_URLfalls back to OPENEVE_PUBLIC_URLBase URL for OAuth/connection authorization callbacks.

Concurrency and rate limiting

VariableDefaultEffect
OPENEVE_MAX_CONCURRENT_RUNSunlimited (16 in production Node hosts when unset)Max simultaneously executing brand-new runs; resumes never queue. Excess is rejected with RunCapacityError / HTTP 429.
OPENEVE_MAX_QUEUED_RUNS0Brand-new runs allowed to wait for a slot before rejection.
OPENEVE_INGRESS_RATE_LIMIToffProvider-channel token bucket as capacity/refillPerSecond (e.g. 60/10).
OPENEVE_RUNS_RATE_LIMIToffPOST /runs token bucket in the same form.

Graceful shutdown

VariableDefaultEffect
OPENEVE_SHUTDOWN_TIMEOUT_MS30000Max wait for in-flight runs to drain during graceful shutdown.
OPENEVE_SIGNAL_HANDLERSonfalse/0 prevents listenNodeRuntime from installing SIGTERM/SIGINT graceful-shutdown handlers.

OTLP telemetry (@openeve/otlp)

VariableDefaultEffect
OPENEVE_OTLP_BATCH_MAXsink defaultMax spans batched before an OTLP flush.
OPENEVE_OTLP_FLUSH_MSsink defaultFlush interval for the OTLP sink.

Durability workers and recovery

VariableDefaultEffect
OPENEVE_DELIVERY_WORKERonfalse/0 disables the delivery queue worker.
OPENEVE_SANDBOX_SYNC_WORKERonfalse/0 disables the sandbox-sync worker.
OPENEVE_RUN_RECOVERYonfalse/0 disables boot recovery and the periodic orphan sweep.
OPENEVE_RUN_HEARTBEAT_MS30000How often executing runs bump updatedAt to stay out of the orphan sweep.
OPENEVE_RUN_RECOVERY_INTERVAL_MS60000Orphan sweep interval; runs are only candidates after max(5min, 4x heartbeat) staleness.

Delivery queue

VariableDefaultEffect
OPENEVE_DELIVERY_RETRY_ATTEMPTS2In-process send attempts before deferring to the durable queue.
OPENEVE_DELIVERY_RETRY_MIN_MS250Min backoff between in-process retries.
OPENEVE_DELIVERY_RETRY_MAX_MS5000Max backoff between in-process retries.
OPENEVE_DELIVERY_QUEUE_LEASE_MS60000Lease duration for a sending delivery before it is requeued. The inline sender's own lease is max(this, 120000) so it outlives the in-process retry envelope.
OPENEVE_DELIVERY_QUEUE_BATCH_SIZE10Deliveries leased per worker tick.
OPENEVE_DELIVERY_QUEUE_MAX_ATTEMPTS5Total attempts before a delivery goes terminally failed.
OPENEVE_DELIVERY_QUEUE_INTERVAL_MS15000Delivery worker tick interval.
OPENEVE_DELIVERY_FILE_MAX_COUNT10 (max 100)Max attachment files per delivery.
OPENEVE_DELIVERY_FILE_MAX_BYTES52428800 (50 MiB)Max bytes per delivery file.

Sandbox sync and hydration

VariableDefaultEffect
OPENEVE_SANDBOX_SYNC_INLINEfalseRun sandbox sync inline instead of through the background worker.
OPENEVE_SANDBOX_SYNC_LEASE_MS300000Lease duration for a claimed sync job.
OPENEVE_SANDBOX_SYNC_BATCH_SIZE10Sync jobs leased per worker tick.
OPENEVE_SANDBOX_SYNC_MAX_ATTEMPTS5Max attempts before a job is blocked for an operator.
OPENEVE_SANDBOX_SYNC_INTERVAL_MS30000Sandbox-sync worker tick interval.
OPENEVE_LEGACY_FULL_SANDBOX_HYDRATIONofftrue/1 forces legacy full hydration instead of minimal per-path hydration.

Sandbox snapshots

VariableDefaultEffect
OPENEVE_SANDBOX_SNAPSHOT_MODEunset (policy default never)never, manual, on_failure, or always; overrides the declared snapshot policy.
OPENEVE_SANDBOX_SNAPSHOT_RETAIN_LASTunsetSnapshots to retain (non-negative integer); only read when a mode is set.
OPENEVE_SANDBOX_SNAPSHOT_REASONunsetFree-form snapshot reason label.

Model loop, memory, and logging

VariableDefaultEffect
OPENEVE_CHECKPOINT_EVERY_ITERATIONtruePersist the harness continuation checkpoint after every model iteration (bounds crash loss to one in-flight model call).
OPENEVE_TOOL_OUTPUT_MAX_CHARS8000Max serialized tool-output size handed back to the model before it becomes a { truncated, preview } object.
OPENEVE_MEMORY_EMBEDDINGS_ENABLEDon only when an embedding provider is configuredEnables embedding-backed semantic memory search.
OPENEVE_LOG_LEVELinfoStructured log verbosity: debug, info, warn, or error.
OPENEVE_BASH_TOOL_MODEenabledCore bash tool policy: enabled, approval, or disabled.

Attachments and resource projection

VariableDefaultEffect
OPENEVE_ATTACHMENT_MAX_COUNT20 (max 100)Max inbound attachments per turn.
OPENEVE_ATTACHMENT_MAX_BYTES52428800 (50 MiB)Max bytes per attachment.
OPENEVE_ATTACHMENT_FETCH_TIMEOUT_MS30000 (1s-120s)Attachment download timeout.
OPENEVE_ZIP_MAX_FILES500 (max 10000)Max entries when expanding a ZIP attachment.
OPENEVE_ZIP_MAX_TOTAL_BYTES104857600 (100 MiB)Max total uncompressed ZIP bytes.
OPENEVE_RESOURCE_PROJECTION_MAX_FILES8Max resources projected into a sandbox per request.
OPENEVE_RESOURCE_PROJECTION_MAX_BYTES262144 (256 KiB)Max bytes per projected resource.
OPENEVE_RESOURCE_PROJECTION_ALLOWED_KINDSall kindsComma-separated allowlist of projectable resource kinds.
OPENEVE_RESOURCE_PROJECTION_ALLOW_WRITABLEfalseAllow projecting writable resources.

Self-improvement, dynamic schedules, dynamic connections

Env overrides for the agent.ts blocks of the same names.

VariableDefaultEffect
OPENEVE_SKILLS_WRITABLEtrueAgent may author/edit its own skills.
OPENEVE_SKILLS_WRITE_APPROVALfalseSkill writes require approval.
OPENEVE_SCHEDULES_DYNAMICtrueAgent may create dynamic schedules.
OPENEVE_SCHEDULES_APPROVALfalseDynamic schedule changes require approval.
OPENEVE_CONNECTIONS_DYNAMICfalseAgent may persist dynamic connections.
OPENEVE_CONNECTIONS_APPROVALtrueSaving a dynamic connection requires approval.
OPENEVE_CONNECTIONS_ALLOWED_HOSTSmanifest allowedHosts or emptyComma-separated dynamic-connection host allowlist.

Scheduler

VariableDefaultEffect
OPENEVE_SCHEDULER_ENABLEDonfalse/0 disables the in-process scheduler loop.

Secrets and local store paths (@openeve/node)

VariableDefaultEffect
OPENEVE_CONNECTION_STORE_SECRETunsetEncryption secret for file-backed connection credential stores. Must be at least 32 characters outside dev mode.
OPENEVE_SECRETunsetFallback for OPENEVE_CONNECTION_STORE_SECRET; the same 32-character minimum applies.
OPENEVE_CONNECTION_GRANTS_FILE<artifactRoot>/connection-grants.enc.jsonEncrypted connection-grant store path.
OPENEVE_CONNECTION_AUTH_SESSIONS_FILE<artifactRoot>/connection-auth-sessions.enc.jsonEncrypted authorization-session store path.
OPENEVE_CONNECTION_DEFINITIONS_FILE<artifactRoot>/connection-definitions.jsonDynamic connection definition store path.
OPENEVE_SKILLS_FILE<artifactRoot>/skills-store.jsonDurable skill store path (file-backed state).
OPENEVE_SCHEDULES_FILE<artifactRoot>/dynamic-schedules.jsonDynamic schedule store path (file-backed state).
OPENEVE_STATE_FILE<artifactRoot>/runtime-state.jsonFile-backed runtime state path.
OPENEVE_BLOB_ROOT<artifactRoot>/blobsLocal blob storage root.
OPENEVE_SANDBOX_ROOT<artifactRoot>/sandboxLocal sandbox root.
OPENEVE_ALLOW_LOCAL_SANDBOX_IN_PRODUCTIONofftrue (exactly) permits the unconfined local sandbox in production.

Build, deploy, and migrations (CLI and compiler)

VariableDefaultEffect
OPENEVE_ARTIFACT_PACKAGE_MODElocalrelease makes build artifacts reference published @openeve/* versions instead of vendored workspace copies.
OPENEVE_DOCKER_IMAGEopeneve:<agentRevision[0:12]>Docker deploy image tag (after --docker-image).
OPENEVE_MIGRATION_COMMANDunsetMigration runner executable for hosted deploys (after --migration-command).

During a hosted deploy the CLI sets these in the migration process environment (they are outputs, not knobs): OPENEVE_ARTIFACT_ROOT, OPENEVE_AGENT_REVISION, OPENEVE_DEPLOY_ENV, OPENEVE_MIGRATION_FILES.

Provider: Postgres (@openeve/postgres)

VariableDefaultEffect
OPENEVE_POSTGRES_CONNECTION_ENVDATABASE_URLName of the env var holding the connection string.
OPENEVE_POSTGRES_SSL_REJECT_UNAUTHORIZEDfalsetrue enforces certificate verification when SSL is used.
OPENEVE_AUTO_MIGRATEonfalse (exactly) skips running OpenEve migrations at provider construction.

Provider: Docker (@openeve/docker)

VariableDefaultEffect
OPENEVE_DOCKER_NETWORKnoneContainer network for sandbox containers.
OPENEVE_DOCKER_CPUSunsetCPU limit passed to docker run.
OPENEVE_DOCKER_MEMORYunsetMemory limit passed to docker run.
OPENEVE_DOCKER_PULL_POLICYunset (Docker default)never, missing, or always.
OPENEVE_DOCKER_COMMAND_TIMEOUT_MSunsetTimeout for Docker CLI commands.

Provider: E2B (@openeve/e2b)

VariableDefaultEffect
OPENEVE_E2B_TIMEOUT_MSSDK defaultSandbox lifetime timeout.
OPENEVE_E2B_RETAIN_TIMEOUT_MSSDK defaultRetain/pause timeout for dirty sandboxes.
OPENEVE_E2B_REQUEST_TIMEOUT_MSSDK defaultPer-request timeout.
OPENEVE_E2B_PAUSE_KEEP_MEMORYSDK defaultKeep memory when pausing.
OPENEVE_E2B_ALLOW_INTERNET_ACCESSSDK defaultSandbox internet egress.

Provider: Modal (@openeve/modal)

VariableDefaultEffect
OPENEVE_MODAL_TIMEOUT_MSSDK defaultSandbox timeout.
OPENEVE_MODAL_WAIT_READYSDK defaultWait for the sandbox to be ready before use.

Provider: Daytona (@openeve/daytona)

VariableDefaultEffect
OPENEVE_DAYTONA_CREATE_TIMEOUT_SECONDSSDK defaultSandbox creation timeout.
OPENEVE_DAYTONA_LIFECYCLE_TIMEOUT_SECONDSSDK defaultLifecycle operation timeout.
OPENEVE_DAYTONA_AUTO_STOP_MINUTESSDK defaultAuto-stop interval.
OPENEVE_DAYTONA_AUTO_ARCHIVE_MINUTESSDK defaultAuto-archive interval.
OPENEVE_DAYTONA_AUTO_DELETE_MINUTESSDK defaultAuto-delete interval.
OPENEVE_DAYTONA_EPHEMERALtrueOnly the literal string false disables ephemeral sandboxes.
OPENEVE_DAYTONA_NETWORK_BLOCK_ALLSDK defaultBlock all sandbox network egress.
OPENEVE_DAYTONA_NETWORK_ALLOW_LISTunsetNetwork allowlist.
OPENEVE_DAYTONA_DOMAIN_ALLOW_LISTunsetDomain allowlist.
OPENEVE_ALLOW_LOCAL_SANDBOX_FALLBACKofftrue (exactly) allows local fallback when the Daytona client is absent (dev/test only).

Provider: Microsoft Teams (@openeve/teams)

VariableDefaultEffect
OPENEVE_TEAMS_ALLOWED_TENANTSall tenantsComma-separated tenant ID allowlist.
OPENEVE_TEAMS_ALLOWED_SERVICE_URLSall URLsComma-separated service-URL prefix allowlist.
OPENEVE_TEAMS_OPENID_METADATA_URLBot Framework defaultOverride for the OpenID metadata URL used in JWT verification.