# Installation

Python requirements, optional extras, and credentials.

The package on PyPI is **harnessx** and the import namespace is **harnessx**. Python 3.11 or newer is required.

## Install the SDK

Add it to a [uv](https://docs.astral.sh/uv/) project:

~~~bash
uv add harnessx
~~~

Any other installer works the same way; the package has no build step:

~~~bash
pip install harnessx
~~~

## Optional dependencies

Install only the integrations your application uses, as extras:

~~~bash
uv add "harnessx[openai]"
uv add "harnessx[mcp,postgres]"
uv add "harnessx[all]"
~~~

| Extra | Adds |
| --- | --- |
| openai | OpenAI provider dependencies |
| azure | Azure OpenAI provider (same dependencies as openai) |
| openrouter | OpenRouter provider dependencies |
| gemini | Google GenAI provider |
| jev | TypeSafe SDK for Choice, Score, and Noul decisions |
| mcp | MCP clients and CLI |
| postgres | Psycopg SQL backend dependencies |
| temporal | Temporal, Redis, and S3 client dependencies |
| docker | Docker SDK; a running daemon is also required |
| langsmith | Tracing and evaluations |
| server | FastAPI and Uvicorn for the web examples |
| all | Every integration extra above |

Installing an extra does not provision an external service or validate credentials. Importing decision types and running the offline Jev examples do not require the `jev` extra; live decisions do. See [Decisions with Jev](../decisions/).

## Configure credentials

The default provider reads `ANTHROPIC_API_KEY` from the process environment. Configure other providers as described in [Model providers](../providers/).

~~~bash
export ANTHROPIC_API_KEY="your-api-key"
~~~

For live Jev decisions, configure a separate TypeSafe key:

~~~bash
export TYPESAFE_API_KEY="your-typesafe-key"
~~~

Live routing also requires the selected generative provider's key and model. Classification and review can call Jev independently. See [Decisions with Jev](../decisions/#install-and-enable-live-decisions).

A standalone Agent application does not load a `.env` file for you; call `load_dotenv` yourself or export the variables before launching Python. The repository examples and harness-web load the repository's `.env`.

## Work from the repository

The examples and harness-web live in the repository, not in the package. Clone it and let uv build the environment from the committed lockfile:

~~~bash
git clone https://github.com/datagol/agent-harness-x.git
cd agent-harness-x
uv sync --all-extras
uv run python -m examples.simple_chat
~~~

`uv sync --all-extras` installs the SDK in editable mode with every integration and the development tools, so `uv run pytest -q` runs the suite offline. Do not append `.py` to a module command. See [Examples](../examples/) for what each entry point needs.

## Check the installed version

~~~bash
uv pip show harnessx
~~~

This documentation describes harnessx 0.4; if you are upgrading from 0.3, read [Migrating to 0.4](../migrating/) for every renamed and removed name. See [Implementation status](../status/) for backend qualification limits.
