feat: add optional llm-task JSON-only tool #1498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add bundled optional
llm-tasktool (JSON-only) for workflowsSummary
This PR adds a new bundled Clawdbot extension
llm-taskthat registers an optional agent tool namedllm-task.The tool provides a generic, composable JSON-only LLM capability intended for orchestration engines (notably Lobster workflows via
clawd.invoke) so users can build new workflows without requiring new Clawdbot code per workflow.Motivation
Lobster is a workflow/orchestration runtime. It can fetch/transform/approve/act, but it cannot “think” unless it can call back into an LLM capability.
We want a stable boundary where:
What’s included
extensions/llm-task/clawdbot.plugin.jsonmanifestindex.tsregisters the tool with{ optional: true }src/llm-task-tool.tstool implementationsrc/llm-task-tool.test.tsunit testsREADME.mdusage + configurationTool interface
Tool name:
llm-task(optional tool; disabled by default)Parameters
prompt(string, required): instruction for the taskinput(any, optional): input payload for the taskschema(object, optional): JSON Schema to validate returned JSONprovider(string, optional)model(string, optional)authProfileId(string, optional)temperature(number, optional)maxTokens(number, optional)timeoutMs(number, optional)Output
details.jsonschemais provided, validates output via Ajv and throws on mismatch.Design decisions
JSON-only (no freeform)
The tool is intentionally JSON-only to be composable and validateable.
Bundled extension (like
lobster)llm-taskuses the embedded agent runner (runEmbeddedPiAgent) which is a Clawdbot internal module.Therefore this is intended to ship as a bundled extension (same model as Lobster) and be enabled via
plugins.entries+ tool allowlists.Model selection
provider+modeloverrideagents.defaults.model.primary) unless overriddenallowedModels(e.g.openai-codex/gpt-5.2)Security / threat model
Primary threats
input(emails/web/etc.)Mitigations present in this PR
llm-task: the tool only returns structured data.plugins.entries.llm-task.enabled=trueagents.list[].tools.allowincludesllm-taskplugins.entries.llm-task.config.allowedModelsto constrain where untrusted inputs can be sent.Recommended workflow-level protections (caller responsibility)
approvecheckpoints before any side-effecting step (email sending, posting, shell exec, etc.).llm-taskoutput as untrusted unless validated.Usage
Enable
llm-task{ "plugins": { "entries": { "llm-task": { "enabled": true } } }, "agents": { "list": [ { "id": "main", "tools": { "allow": [ "llm-task" ] } } ] } }Lobster →
clawd.invoke→llm-taskSecurity note (update)