Agent dispatch
When a finding fires, the user can dispatch an agent to harden the affected projects. Buckler does not run the agent inside its own process. It writes a task bundle and invokes a configured runner.
Task bundle
Buckler writes ~/Library/Application Support/Buckler/dispatch/<finding-id>/task.json.
The file contains:
- The structured finding (tier, purl, path, evidence, remediation)
- The affected project paths (every project that contains the matched item)
- The safe version (when the intel has a
fixedor recommended version) - The intel record (title, summary, source URL)
The file never contains raw article text or chatter text. The runner reads the task bundle only.
Example task.json (simplified):
{
"finding_id": "abc123...",
"tier": "compromised",
"purl": "pkg:pypi/litellm@1.107.0",
"path": "~/.venv/lib/python3.13/site-packages",
"evidence": [
"package-version pkg:pypi/litellm@1.107.0",
"file-path ~/.venv/lib/python3.13/site-packages/litellm_init.pth"
],
"remediation": [
"Remove the malicious version: pip uninstall litellm",
"Delete the persistence file: rm ~/.venv/lib/python3.13/site-packages/litellm_init.pth",
"Install a safe version: pip install 'litellm>=1.107.1'"
],
"affected_projects": [
"~/proj/my-app"
],
"safe_version": "1.107.1",
"intel": {
"title": "LiteLLM 1.107.0 supply-chain compromise",
"summary": "Malicious PyPI release with credential theft through Python startup hooks.",
"source_url": "https://..."
}
}The runner reads this file and acts on it. The task bundle is the complete contract.
Manual policy
The default is policy = "manual". The user clicks Dispatch on a finding, and Buckler runs the runner.
The Findings window shows a Dispatch button for each finding. Click it to run the agent. The button is disabled for advisory findings (nothing to dispatch).
Auto policy
Set policy = "auto" to dispatch automatically for configured tiers.
[dispatch]
policy = "auto"
auto_tiers = ["compromised"]
runner = "claude-code"With this config, every compromised finding dispatches the claude-code runner without a click. exploited and vulnerable findings still require manual dispatch.
Warning: Do not set policy = "auto" with a runner that can push or merge. A poisoned intel record can then change your repositories.
Runners
A runner is a configured command. Three runners ship in the default configuration:
claude-code
[dispatch.runners.claude-code]
command = [
"claude", "-p",
"--permission-mode", "acceptEdits",
"--add-dir", "{project}",
"Read {task}. Harden this project on a new branch. Do not merge."
]Invokes the claude CLI with -p (persistent mode) and acceptEdits permission. The agent reads the task bundle, hardens the project, and creates a branch. It does not merge.
Placeholders:
{task}: absolute path totask.json{project}: absolute path to the affected project directory
The claude binary must be in PATH.
codex
[dispatch.runners.codex]
command = [
"codex", "exec",
"--cd", "{project}",
"Read {task}. Harden this project on a new branch."
]Invokes the Codex CLI. The agent reads the task and creates a branch in a worktree. Same placeholders.
The codex binary must be in PATH.
custom
[dispatch.runners.custom]
command = ["/usr/local/bin/my-runner", "{task}", "{project}"]Runs any command. The script receives the task path and project path as arguments. It can be written in any language.
The script should:
- Read the task.json file
- Create a branch
- Harden the project (remove the malicious package, delete artifacts, update to a safe version)
- Commit the changes
- Not merge or push
Buckler records stdout, exit code, and the branch name in dispatch_runs.
Project registry
The inventory engine records a project for every manifest it finds:
pyproject.tomlpackage.jsonCargo.tomlgo.modBrewfile
A project row has path, ecosystems, git remote, and last dispatch time.
When a finding matches an item in a project, the task bundle lists that project path in affected_projects.
A package can appear in multiple projects. The runner dispatches once per project.
What Buckler never does
Buckler does not:
- Run the agent inside its own process. The runner is a subprocess.
- Merge the branch. The runner works on a branch, and the user merges it.
- Push the branch. The runner commits locally only.
- Decide what to fix. The runner reads the task bundle, which contains the deterministic remediation.
The user reviews the branch and merges when ready.
Dispatch runs
Every dispatch run is recorded in the dispatch_runs table:
- Finding ID
- Runner ID
- Task path
- Project path
- Start time, end time
- Exit code
- Stdout (truncated to 10,000 bytes)
- Branch name
The Findings window shows the last dispatch run for each finding. Click the branch name to open a diff.
A failed dispatch (nonzero exit code) shows the error in the Findings window. The user can retry or apply the remediation manually.
Safety rails
The dispatch mechanism has no automatic merge or push. The runner creates a branch. The user reviews it and merges when satisfied.
A malicious intel record can dispatch an agent, but it cannot merge or deploy the changes.
The task bundle does not include article text. A prompt-injection attack in an article cannot reach the runner.
The runner has file and git access, so it can make local changes. Review the branch before merging.