Open source · Apache 2.0 · early development

Give it a task. Get back a tested branch.

Zenith is an autonomous coding agent. It plans the change, waits for your approval if you want it to, edits the code, runs your project's own tests, fixes what they catch, and hands back a branch and a pull request. It works with OpenAI, Anthropic, Gemini, AWS Bedrock, Ollama or your own gateway.

$go install github.com/divmora/zenith/cmd/zenith@latest
zenith run --worktree
$ zenith run --worktree --task "Add WordCount + tests" worktree ~/.cache/zenith/worktrees/demo-add-wordcount branch zenith/add-wordcount-tests-b37a02 ✓ check (baseline) make test: exit 0 ✓ read_file strutil/strutil.go ✓ edit_file strutil/strutil.go ✓ write_file strutil/wordcount_test.go ✓ run_command go test ./... ✓ finish ✗ check (final) make test: exit 2 gofmt needed on: strutil/wordcount_test.go ✓ run_command gofmt -w strutil ✓ check (final, after fix 1) make test: exit 0 committed 4f1c9e2 on zenith/add-wordcount-tests-b37a02 done after 13 step(s) $ zenith publish --result result.json zenith: opened #42: https://github.com/org/repo/pull/42
What you get

An agent you can hand real work to

The model proposes and edits. Zenith decides what counts as done: it runs the checks itself and never takes the model's word that tests pass.

Plan first, if you want

A read-only planning phase proposes the change and stops. Approve it, add a note, or send feedback for a new plan. Planning resumes from a checkpoint, even in a fresh sandbox.

Verified by your own checks

Zenith finds your project's checks (make test, Go, npm/pnpm/yarn/bun, cargo, pytest, composer) and runs them before and after. New failures go back to the agent to fix.

Your checkout stays yours

With --worktree, the work happens in a separate git worktree. Your branch and uncommitted changes are never touched. Every run ends in a commit on its own zenith/ branch.

Built-in personas

Specialists for security, performance, UX, maintainability, tests and docs. Each picks one focused improvement and keeps a journal in the repository, so the next run builds on the last.

Pull requests on GitHub and GitLab

zenith publish pushes the verified commit and opens a pull request or merge request, with the summary, files, checks before and after, and every command the agent ran.

Safe with untrusted code

The agent's commands never see your API keys or git tokens. Files stay inside the workspace, .git is off limits, and planted git hooks or config are undone after every run.

Budgets and long tasks

Limits on steps, tokens and time, with clear exit codes. Long runs are compacted to fit the model's context, keeping the task, the approved plan and the latest work.

Machine-readable from end to end

A JSON event stream, a result file and a checkpoint file with a versioned schema, so a CI job or a control plane can run Zenith and act on what it did.

Ready-made container

ghcr.io/divmora/zenith ships Go, Node.js (npm, pnpm, Yarn), Python with pytest, make and gcc, and runs as any user, with or without network.

How it works

One task, one process, one branch

Each run does one task in one repository. Pushing is a separate step that no model takes part in.

  1. Start clean

    Zenith records the base commit, snapshots the repository's git config and hooks, and creates the branch (in a worktree, if you ask).

  2. Baseline

    It runs the project's checks once before any change, so failures that were already there aren't blamed on the agent.

  3. Plan (optional)

    With --approve-plan, the agent explores with read-only tools, proposes a plan and stops with exit code 10.

  4. Work

    The agent reads, edits and runs commands in the workspace, with a scrubbed environment and output and time limits.

  5. Verify

    When the agent says it's done, Zenith runs the checks itself. New failures go back to the agent, for up to three rounds.

  6. Commit

    Zenith commits the result on the branch, restores the git config, and writes the result file.

  7. Publish

    zenith publish, run outside the sandbox with your code-host token, pushes the commit and opens the pull request.

  8. Review

    You review it like any contribution. The description says an agent wrote it and shows exactly what was run.

Personas

Specialists that need no task text

Run zenith run --persona NAME and the specialist picks one worthwhile improvement on its own, or pass --task to aim it. Write your own as a Markdown file and use --persona-file.

🛡️

sentinelSecurity

Finds and fixes one real security weakness, most severe first, and lists what it found but did not fix.

⚡

boltPerformance

Makes one measurable performance improvement without changing behaviour.

🎨

paletteUX and accessibility

Makes one small, visible UX or accessibility improvement in the interface.

🧹

sweeperMaintainability

Cleans up one piece of technical debt without changing behaviour.

🔬

probeTests

Adds meaningful tests for important code that has none, and fixes any bug they expose.

📝

scribeDocumentation

Fixes one gap or inaccuracy in the documentation, checked against the code.

Bring your own model

Switch providers with one flag

Pick a model with --model or ZENITH_MODEL as provider:model, comma-separated for fallbacks. Tool calling and streaming work the same way on every provider, and prompt caching is used where the provider has it.

OpenAIAnthropicGoogle GeminiAWS Bedrock Converse, any tool-capable modelAzure OpenAIOllamaOpenRouterGroqDeepSeekMistralxAITogetherOpenAI-compatible vLLM, LiteLLM, gateways
From the environment
# the provider's usual key variable is read
export ZENITH_MODEL=anthropic:claude-sonnet-5-5   ANTHROPIC_API_KEY=...
export ZENITH_MODEL=openai:<model>               OPENAI_API_KEY=...
export ZENITH_MODEL=gemini:<model>               GEMINI_API_KEY=...
export ZENITH_MODEL=bedrock:<model-id>           AWS_REGION=us-east-1
export ZENITH_MODEL=ollama:<model>               # local, no key
export ZENITH_MODEL="anthropic:<model>,bedrock:<model-id>"   # fallback chain
Quick start

Your first task in a minute

Run it in a container or VM: the agent edits files and runs commands chosen by a model. Nothing is pushed until you run zenith publish.

Terminal
# install (or download a binary from Releases, or use the image)
go install github.com/divmora/zenith/cmd/zenith@latest
export ZENITH_MODEL=anthropic:claude-sonnet-5-5 ANTHROPIC_API_KEY=...

zenith run --worktree --workspace ./repo --result /tmp/result.json \
  --task "Fix the off-by-one in pagination and add a test"

zenith personas                                   # sentinel, bolt, palette, sweeper, probe, scribe
zenith run --persona sentinel --worktree --workspace ./repo
Security model

Repository content is untrusted

Code, comments, READMEs and issue text can all carry prompt injection. Zenith is built so that a steered agent can't do much harm outside the branch it's working on.

  • No secrets in the agent's commands: an environment allowlist drops API keys, cloud credentials, git tokens and SSH agents. Add a variable on purpose with --pass-env.
  • No push during a run: the code-host token is used only by zenith publish, which runs without a model.
  • Confined files: file tools resolve symlinks, stay inside the workspace and can't write to .git.
  • Git can't be turned against you: Zenith's own git calls disable hooks, fsmonitor, filters and pagers, and the repository's git config and hooks are restored after every run.
  • Safe pull request text: @mentions and GitLab quick actions in the model-written description are neutralised.
  • Your sandbox does the rest: run Zenith in a disposable container with network limited to your model provider and package registries. See SECURITY.md for the known limits.
CLI reference

Four commands

CommandWhat it does
runDo one task and commit it on a new branch. Task: --task, --task-file, --persona, --persona-file. Where: --workspace, --worktree, --branch. Plan: --approve-plan, --checkpoint. Limits: --max-steps, --max-tokens, --timeout, --context-tokens. Checks: --verify, --no-verify, --max-fix-attempts. Output: --result, --events, --quiet.
resumeContinue from a plan checkpoint: --approve (with an optional --note) or --feedback.
publishPush the run's verified commit and open a pull request or merge request: --result, --remote, --base, --title, --draft, --allow-incomplete, --platform, --api-url.
personas [NAME]List the built-in personas, or print one.

Exit codes: 0 done, 10 awaiting plan approval, 20 budget exceeded, 30 failed, 1 internal error, 2 usage. The event stream, result and checkpoint are versioned JSON for other tools.

Running it for a team?

Zenith Console is planned: task intake from issues and chat, a queue, sandboxed runs, plan approval in the browser and history, running this CLI in Docker or Kubernetes. Until then, Zenith runs from any CI job or script.

Read the design