Skip to main content
Cognitio’s bundled runtime implements tools for common agent work. You do not need to define callbacks for these tools: choose which ones to expose, give the agent a task, and the runtime executes its tool calls. Use the lower-case Cognitio tool IDs below in allowedTools, disallowedTools, and tool-event handling. These are the actual model-visible names, such as read and bash.

Read a file with an agent

Use the TypeScript example setup. This complete example creates its own small workspace, lets the model read a note, and removes the workspace after closing the Agent. No existing project files are needed.
cwd selects the workspace on the runtime’s machine. With a local runtime, that is your machine; with a remote runtime, paths refer to the remote host. Local isolation protects runtime state and configuration, not the workspace from allowed file or shell operations.

File and command tools

The model receives each tool’s argument schema. Your application normally configures tools by name instead of constructing these arguments itself.

Editing tools depend on the model

For openai/gpt-4.1-mini, the runtime uses write, edit, and multiedit. It selects apply_patch when the provider-local model ID contains gpt- but contains neither gpt-4 nor oss; those models do not also receive the three edit tools. For a model-independent editing profile, list all four tool IDs along with read; only the applicable tools become available. An allowlist does not override this model selection. File mutations are governed by the edit permission, while tool allowlists still use the individual tool IDs.

Web and delegation tools

Subagent work is awaited within the current turn. The task tool is not a durable detached-job queue.

Optional and specialized tools

These tools are not all present in a default headless Agent. Listing one in allowedTools does not satisfy its runtime prerequisites. Pass optional runtime flags through spawn.env; parent COGNITIO_* variables are not inherited automatically by an isolated child. If using an Exa key, explicitly pass EXA_API_KEY through spawn.env or spawn.passEnv. You do not need any of these flags for the file-reading example above.

Defaults and tool policy

High-level Agent and query hide question, todowrite, and skill when neither tool list is supplied. Explicitly setting allowedTools or disallowedTools replaces that default hidden-tool profile. For example, allowedTools: ["read", "todowrite"] enables a narrow reading-and-todos profile without exposing the shell. A nonempty allowlist limits tools to matching names; allowedTools: [] does not disable tools. Use disallowedTools: ["*"] for text-only work. The synthetic StructuredOutput tool is added for schema output, keeps its exact capitalized name, and is also blocked by the wildcard deny. See structured output before combining schemas with tool restrictions. Tool visibility and operation authorization work together. For command/path rules and approval callbacks, continue with permissions. To implement application-specific actions, use custom tools.