Metadata-Version: 2.4
Name: xah
Version: 0.1.0
Summary: An extensible AI agent harness
Author-email: Frontmatter AI <innovative.fowler@mask.pro.fmtr.dev>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/fmtr/xah
Project-URL: Documentation, https://fmtr.github.io/xah/
Project-URL: Source, https://github.com/fmtr/xah
Project-URL: Issues, https://github.com/fmtr/xah/issues
Keywords: AI,agent,agent harness,agent framework,ACP,Pydantic AI
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: <3.15,>=3.12
Description-Content-Type: text/markdown
Requires-Dist: acpremote<2.0.0,>=1.12.0
Requires-Dist: agent-client-protocol
Requires-Dist: chatgpt-auth>=0.1.0
Requires-Dist: corio[db.search,dev,dm,path.search,sets]~=2.21.8
Requires-Dist: debugpy
Requires-Dist: fastmcp==3.4.4
Requires-Dist: humanize
Requires-Dist: pydantic-acp<2.0.0,>=1.0.0
Requires-Dist: pydantic-ai-slim[logfire,mcp,openai]
Requires-Dist: pydantic-deep[all]
Provides-Extra: test
Requires-Dist: corio[test]~=2.21.8; extra == "test"
Requires-Dist: corio[db.search]~=2.21.8; extra == "test"
Requires-Dist: crawl4ai; extra == "test"
Requires-Dist: playwright==1.61.0; extra == "test"
Requires-Dist: tavily-python>=0.8.0; extra == "test"
Provides-Extra: tool-kb
Requires-Dist: corio[db.search]~=2.21.8; extra == "tool-kb"
Provides-Extra: tool-web
Requires-Dist: crawl4ai; extra == "tool-web"
Requires-Dist: playwright==1.61.0; extra == "tool-web"
Requires-Dist: tavily-python>=0.8.0; extra == "tool-web"

# `xah`

`xah` is an extensible agent harness for people who want to change how an agent works in Python, not just change what its prompt says. Run it as an ACP server and use it from an editor or another ACP client. Start with the built-in tooling, or subclass the harness for your own workflow, whether or not it involves coding.

## What you can change

Prompts, configuration, and plugins have their place. `xah` also lets you change the code that handles a tool call, decide what happens before it runs, and control how its result is presented. Extend just the part you need without rebuilding the rest of the harness.

- **Control what can run.** Give tools typed inputs and validate proposed calls in Python. A validator can warn the model, reject a call, or ask the user for permission in the client. Toolset policies and separate read and write directories let you set limits without relying on the prompt to enforce them.
- **Compose tools and workflows.** Subclass existing tools, connect an MCP server, or let the model activate a toolset when it needs it. Tools can keep session state, and a tool can delegate a focused job to a child harness with its own instructions and tools.
- **Give users direct controls.** Expose session options and typed slash commands with flags, subcommands, and help. A command can update state that a tool reads later, without asking the model to interpret the command.
- **Give the model and the user different views.** A tool can return a concise result to the model while showing the user a formatted preview or diff in the ACP client. The server log shows prompts, tool calls, and replies as they happen, without repeating the full conversation on every turn.

`xah` is built on [Pydantic AI](https://ai.pydantic.dev/) and [Pydantic Deep Agents](https://vstorm-co.github.io/pydantic-deepagents/). The [Agent Client Protocol (ACP)](https://agentclientprotocol.com/) connects the server to the interactive client, so you don't have to build a separate interface for each harness.

## Who might find it useful?

`xah` is for people comfortable working in Python, directly or with an agent, who want more control over how their agents behave. It may be a good fit if you want to:

- Work with locally hosted models and catch invalid or inappropriate tool calls in code rather than relying on the model to follow instructions every time.
- Add a project-specific capability, such as running checks with the right Python interpreter, or extend an existing tool without starting from scratch.
- Build an agent for work beyond coding while keeping the familiar interface of an editor or terminal client.

If an off-the-shelf agent already behaves the way you want, or you don’t want to maintain Python customizations, a ready-made harness may be a better fit.

## Why does `xah` exist?

The first motivation is **extensibility**. Instructions such as `AGENTS.md` and skills give the agent context. Configuration selects from behavior the harness already supports. Plugins can go further, but may require a separate extension workflow. `xah` gives you a direct route: write and debug the behavior as ordinary Python, including rules the harness enforces even when the model doesn’t follow a prompt.

The second is **making it easier to build ACP agents for work beyond coding**. An ACP client already gives users a place to ask questions, see tool activity, and approve proposed actions. With `xah`, you can reuse that interface and write the parts specific to your work in Python: which tools the agent can use, what it checks before acting, and what it shows the user.

For example, a research assistant could search a reference collection and show source links alongside its findings. An editorial assistant could check a draft against a style guide, show suggested changes as a diff, and ask for approval before writing them. In both cases, you can start with one tool and try it in an existing ACP client, then add controls and checks as the workflow develops—without having to build a chat interface first.

## About the name

**eXtensible Agent Harness**—or perhaps “Not Another Harness!” The *a* is silent.

## Get started

```bash
pip install xah
xah
```

To try it without installing it separately, run `uvx xah`. Follow the [quick start](https://fmtr.github.io/xah/quick/) to configure a model provider and connect an ACP client. Then explore the [built-in toolsets](https://fmtr.github.io/xah/toolsets/) or follow the [tutorials](https://fmtr.github.io/xah/tutorials/) to write your own harness, tools, and commands.

## Documentation

Visit the [`xah` documentation](https://fmtr.link/xah/doc) for server settings, client setup, live logging, and runnable examples.
