跳到正文
DEV Community· Linuztx·· 3 小時前AI 評分64

Alter Zero:以 Rust 編寫、面向編碼、網絡安全及自動化的智能體工具框架

Alter Zero: a Rust agent harness for coding, cybersecurity, and automation

AI 導讀

Alter Zero 是以 Rust 編寫的開源智能體工具框架,讓用戶在終端處理編碼、網絡安全及自動化工作。它支援檔案讀寫、命令執行、長時間執行的程序管理、子智能體、技能、MCP 及多個模型供應商;v0.15.0 加入自訂 OpenAI 相容供應商和介面串流檔案寫入。

正文

Debugging a failing test, tracing an access-control issue, and automating a repetitive shell workflow have something in common: they require more than a chat response. You need tools, context, and a way to check the result.

Alter Zero is an open-source agent harness for coding, cybersecurity, and automation, written in Rust. That is also how the project describes itself in its Cargo.toml.

It works in your terminal with tools for reading and editing files, running commands, managing long-running processes, and delegating focused work to subagents. You choose a supported model provider or connect a local model server.

Here is what that looks like across the three workflows—and how to try it.

See it in action

Alter Zero terminal agent demo

Watch the video demo.

1. Coding: go from investigation to a verified change

Alter Zero can inspect a repository, edit files, run build or test commands, and show the output as it happens. Syntax-highlighted file views, readable diffs, and task checklists help you follow the work instead of relying only on the final summary.

A focused starting prompt:

Find why this test fails. Trace the cause, make the smallest fix,
and run the relevant tests. Explain what changed and what you verified.

You can steer a running turn, queue a follow-up, and resume saved sessions later. Optional per-directory checkpoints support restoring working files when rewinding a conversation.

The important distinction: the harness gives the model tools to investigate and verify. It does not make every proposed fix correct—review the diff and test results yourself.

2. Cybersecurity: investigate code and systems with evidence

The same file and shell tools can support security reviews, technical investigations, and authorized testing. For example, ask the agent to trace authentication and authorization paths rather than simply list generic vulnerabilities:

Review this repository's authentication and authorization flow.
Trace each potential issue to specific code, distinguish confirmed
findings from hypotheses, and suggest fixes and regression tests.
Do not modify files yet.

For a system you own or have permission to assess, another useful task is to summarize supplied service configurations or security logs and identify what needs manual verification.

The repository also includes an optional headless Kali Rolling container for Docker or Podman. It packages Alter Zero with a selected set of CLI tools, including nmap, curl, jq, rg, and Python—not the entire Kali toolset. See the container guide for setup, networking, and workspace options.

The container runs as root, and a mounted workspace exposes those files to edits. Treat it as a working environment, not a guarantee of isolation. Keep testing within an explicitly authorized scope.

3. Automation: work with the tools already in your shell

Automation is not limited to generating scripts. Alter Zero can execute commands, inspect their output, and handle programs that pause for input.

Its shell tools support interactive prompts, REPLs, and full-screen terminal programs. Long-running commands can be started in the background, inspected, waited on, sent input, or stopped.

A practical first task:

Write a script that summarizes these logs and flags recurring errors.
Test it on a small sample, show the expected output, and do not alter
or delete the original logs.

For repeatable workflows, you can add reusable skills, lifecycle hooks, and project instructions. Hooks are off by default and can be enabled per working directory. MCP servers connect additional tools; what the agent can do through an integration depends on the server you configure.

A harness you can extend

Several capabilities tie these workflows together:

  • Subagents: delegate focused work with separate context and tool access. The main agent can check progress, send follow-ups, stop an agent, and resume a finished agent's conversation.
  • Skills: reusable SKILL.md folders loaded when needed. Built-in skills include web search, Jina Reader, skill creation, media-download guidance, and localhost-tunnel guidance.
  • MCP: connect servers over stdio, HTTP, or SSE, with OAuth support for remote servers that use it.
  • Hooks and AGENTS.md: add lifecycle automation and project-specific instructions.
  • Session continuity: use /resume, alter-zero --continue, or alter-zero --resume <id> to pick up earlier work.

Skills are instructions and, in some cases, supporting scripts—not bundled versions of every external tool. For example, the yt-dlp skill uses the separately installed downloader, and flaredantic uses the external flare CLI. Loading the tunnel skill does not itself expose a service.

Choose your model provider

Supported providers include OpenRouter, Anthropic, GitHub Copilot, ChatGPT Codex, Venice, Cline/ClinePass, and Ollama, among others. Use /login to connect and /model to select a model. Sign-in methods and available capabilities vary by provider.

You can add OpenAI-compatible services or local servers in ~/.alter-zero/providers.toml; custom providers appear alongside the built-ins.

The harness is open source. Hosted model access may require a subscription or API credits, and local inference quality and speed depend on your model and hardware.

Permissions, secrets, and privacy: know the boundaries

Alter Zero offers four permission modes:

Mode General behavior
manual Asks before file changes and commands
edit Allows file changes; commands still require approval
auto Adds a reviewer for routine commands
master Runs unattended

Start with manual, review proposed actions, and keep a clean Git working tree or backups. Project-defined agents, hooks, and MCP servers have a trust review through /trust. Permission controls are not an operating-system sandbox.

The /secrets feature lets tools use stored credentials through placeholders, with expansion at execution and redaction in model-visible output. This reduces direct exposure to the model; it is not an encrypted vault or a promise that arbitrary commands cannot leak data. The secrets documentation explains storage and raw-log caveats.

Telemetry is enabled by default. The documented ping contains an install ID, app version, and platform information—not prompts, code, or command history. You can disable it for a run with:

ALTER_ZERO_TELEMETRY=0 alter-zero

DO_NOT_TRACK=1 is also supported. The separate GitHub update check has its own setting and is not disabled by DO_NOT_TRACK. Model-provider requests are separate from telemetry: using a hosted model still sends the context needed for inference to that provider. Read the telemetry policy before using sensitive workspaces.

Try Alter Zero on Linux or macOS

Install the native build through npm:

npm install -g @linuztx/alter-zero
cd your-project
alter-zero

Then:

  1. Run /login to connect a supported provider or local model server.
  2. Run /model to choose a model.
  3. Start with a focused task and review approval prompts.

Without a configured provider, the app opens an offline demo with scripted turns so you can explore the interface.

Prefer building from source? With rustup and a C compiler installed:

git clone https://github.com/linuztx/alter-zero.git
cd alter-zero
cargo install --path .
alter-zero

The repository pins its Rust toolchain. See the quick-start guide for the shell installer and other options.

What is new in v0.15.0?

At the time of writing, GitHub's latest release is v0.15.0. Its changelog includes:

  • Custom OpenAI-compatible providers through providers.toml.
  • Streaming file writes in the UI: see generated file content line by line while the model produces the tool call, rather than waiting for the whole call to finish.
  • The flaredantic skill for guiding localhost sharing and webhook testing with an external CLI.
  • macOS screenshot-paste fixes and removal of metadata from pasted images. This does not apply to images read directly from a file path.

These are released features; changes under Unreleased are not included here.

Explore the project

Alter Zero is licensed under Apache-2.0.

Source, documentation, and issues → github.com/linuztx/alter-zero

If an extensible terminal agent for coding, cybersecurity, and automation fits your workflow, give it a try. A GitHub star helps others discover the project, and a reproducible bug report or contribution helps improve it. Start with the contributing guide.

Which workflow would you try first: fixing a failing test, reviewing access controls, or automating a repetitive CLI task?


AI disclosure: This article was prepared and published with AI assistance, based on the project's Cargo metadata, README, changelog, and technical documentation. Prompts are suggested starting points, not benchmarks or claims of tested outcomes.

來源:DEV Community · dev.to