Skip to main content

System prompt

WednesdayAI assembles the agent’s system prompt from a set of named sections at run time. The default prompt is comprehensive; you can slim it down with a preset, toggle individual sections, inject custom content, and control which project context files are included. All configuration is under agents.defaults.systemPrompt (shared across agents) or agents.<agentId>.systemPrompt (per-agent override). Changes take effect when the gateway restarts. Restart: systemctl --user restart openclaw-gateway.

Presets

The fastest way to change the prompt’s size and scope is a preset:

Per-agent override

Named agents can override the shared default. The per-agent config merges over agents.defaults.systemPrompt:

Section toggles

Individual sections can be turned off or customised without changing the preset. Use the sections map with the section name as the key:

Section catalogue

Mode type key:

Project context files

These files are read from the agent workspace directory and injected into the system prompt: File mode values: Default per-file limit: 20 000 characters. Hard ceiling on total prompt source reads: 8 MiB. Missing optional files are silently skipped. Leave HEARTBEAT.md empty (or absent) to skip heartbeat API calls. To change a file’s mode, use the projectContext.files config:

Prompt cache

The prompt is split into a stable (cached) region and a volatile region at build time. The cache boundary controls where the split happens:
"auto" lets the runtime choose the optimal cache boundary for the current provider. Set "off" to disable prompt caching entirely (increases token cost, may help debugging).

Injecting content from a plugin

Plugin authors can inject content into the system prompt at run time via the before_prompt_build lifecycle hook — without touching admin config. See Hooks for the hook API; the return value accepts systemPrompt (appended after the built sections) and prependContext (inserted before the user turn).

Identity attribution

WednesdayAI attributes each agent run to a sender when it can, and labels how it resolved that identity. Two config surfaces drive this:
  • session.identityLinks maps platform-prefixed ids (for example telegram:123456789) to canonical identities. When an inbound sender matches a key, the run is attributed to that canonical identity with identitySource: "sender".
  • heartbeat.identity (and the equivalent identity field on cron jobs) attributes a scheduled system run to a registered user. The value must case-insensitively match a session.identityLinks key at run time; a match resolves with identitySource: "job-config", an absent or non-matching value leaves the run as a system run with no identity. Subagent runs may inherit the requester’s identity, validated against the same identityLinks keys (identitySource: "parent-session").
Resolution precedence: inbound sender match → inherited requester identity (validated) → configured job/heartbeat identity → identity-less. Each successful injection beyond the sender path emits one runtime identity injected info log — the live observable for attribution. For model-provider calls, WednesdayAI derives opaque correlation ids rather than forwarding raw identities: providerConversationId (hashed agent + session) and hashedUserId (one-way hash of the sender identity). The provider prompt-cache key is deliberately keyed on agent + model only, never on conversation or user, so the shared tools+system prefix keeps one cache entry across every conversation under that agent and model. Related: Sessions — Identity and privacy.
  • Hooksbefore_prompt_build and context.collect hook reference
  • Gateway configuration — gateway-wide settings
  • Agent tools — exposing capabilities to the agent
  • Sessions — session keys, reset lifecycle, and privacy boundary