Unreleased These pages document the current main build and are not a stable-release promise. View the latest release
Skip to content

Conditional blocks and path access ​

config/conditions.toml enables conditional access to resources based on session context.

It narrows what an agent can see or touch in a given channel, keeping authority tied to where work is happening.

  • Load additional memory blocks only in appropriate contexts.
  • Grant or restrict access to files and folders based on where the session is running.

conditions.toml is not an exec sandbox boundary. Path checks can gate file tools, but a command admitted through exec may have many ways to read, copy, or transform data inside its mounted environment. The sandbox binary entrypoint list constrains direct command selection; sandbox isolation and mounts constrain what those commands can access.

Format ​

toml
[blocks.nsfw]
when = "discord:nsfw"
action = "load"

[memories."/private/"]
when = "discord:dm"
action = "allow"

[workspace."/deploy/"]
when = ["discord:guild:123456789", "discord:channel:987654321"]
mode = "or"
action = "allow"

Conditions ​

ConditionMeaning
discord:nsfwNSFW-flagged Discord channel.
discord:dmAny Discord DM.
discord:dm:{channelId}A specific Discord DM channel.
discord:guild:{guildId}A specific Discord guild.
discord:channel:{channelId}A specific Discord channel.
discord:forum:{forumId}Any thread of a forum channel.
internalAn internal session (heartbeat, cron).
tuiA TUI session; reserved in this runtime, which has no interactive TUI channel.

Conditions support negation with a leading !.

when accepts one condition or an array of conditions; mode is or (default) or and.

Actions ​

ActionApplies toMeaning
loadblocksInclude the block in the system prompt.
allowmemories, workspaceGrant access to the path.
denymemories, workspaceBlock access to the path.

Conditional blocks ​

Create conditional blocks in blocks/conditional/<name>.md, where <name> matches the rule key in conditions.toml.

markdown
+++
description = "Guidelines for handling mature content"
+++

You are in an NSFW context. The following guidelines apply:
...

The frontmatter is TOML and must include a description. Matching blocks are added to the system prompt alongside the core blocks.

Path access ​

Path rules control access to files in /memories/ and /workspace/.

Paths ending with / match as prefixes; paths not ending with / require an exact match.

Access is evaluated as:

  1. A deny rule that matches both the path and the current context blocks access.
  2. Otherwise, an allow rule that matches both the path and the current context grants access.
  3. A path with matching rules that match no context is blocked.
  4. A path with no matching rules is allowed (baseline behavior).

Hot reload ​

Changes to conditions.toml are applied live while the runtime is running; no restart is required.

Are you an agent? Prefer this page's raw Markdown document: follow its text/markdown alternate link, use its .md URL, or add ?md=1 to the page URL.