Skip to main content

Operative

Computer use agent powered by Claude. Provides a Docker container environment where Claude interacts with a virtual desktop via screenshot, mouse, and keyboard tools, with a Streamlit UI for human interaction.

Image: ghcr.io/hanzoai/operative:latest Repo: github.com/hanzoai/operative

Note: Computer use is a beta feature. It poses unique risks distinct from standard API features. To minimize risks:

  1. Use a dedicated virtual machine or container with minimal privileges.
  2. Avoid giving the model access to sensitive data such as account login information.
  3. Limit internet access to an allowlist of domains.
  4. Require human confirmation for decisions with real-world consequences.

Instructions found in web content or images may override user instructions. Isolate the agent from sensitive data and actions.

What It Does

  • Runs a full Linux desktop (X11/Xvfb + VNC) inside Docker
  • Claude controls the desktop via screenshot/mouse/keyboard tool calls
  • Supports Anthropic API (direct), AWS Bedrock, and Google Vertex
  • Streamlit UI for sending instructions and watching the agent work
  • Built-in bash and file editing tools alongside computer control

Quick Start

Anthropic API

export ANTHROPIC_API_KEY=%your_api_key%
docker run \
    -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
    -v $HOME/.anthropic:/home/operative/.anthropic \
    -p 5900:5900 \
    -p 8501:8501 \
    -p 6080:6080 \
    -p 8080:8080 \
    -it ghcr.io/hanzoai/operative:latest

Bedrock

export AWS_PROFILE=<your_aws_profile>
docker run \
    -e API_PROVIDER=bedrock \
    -e AWS_PROFILE=$AWS_PROFILE \
    -e AWS_REGION=us-west-2 \
    -v $HOME/.aws:/home/operative/.aws \
    -v $HOME/.anthropic:/home/operative/.anthropic \
    -p 5900:5900 -p 8501:8501 -p 6080:6080 -p 8080:8080 \
    -it ghcr.io/hanzoai/operative:latest

Vertex

gcloud auth application-default login
export VERTEX_REGION=%your_vertex_region%
export VERTEX_PROJECT_ID=%your_vertex_project_id%
docker run \
    -e API_PROVIDER=vertex \
    -e CLOUD_ML_REGION=$VERTEX_REGION \
    -e ANTHROPIC_VERTEX_PROJECT_ID=$VERTEX_PROJECT_ID \
    -v $HOME/.config/gcloud/application_default_credentials.json:/home/operative/.config/gcloud/application_default_credentials.json \
    -p 5900:5900 -p 8501:8501 -p 6080:6080 -p 8080:8080 \
    -it ghcr.io/hanzoai/operative:latest

Accessing the Interface

Once the container is running, open http://localhost:8080 for the combined agent chat + desktop view.

The container stores settings (API key, custom system prompt) in ~/.anthropic/. Mount this directory to persist settings between runs.

Port Service
8080 Combined interface
8501 Streamlit UI only
6080 noVNC desktop only
5900 VNC (for VNC clients)

Screen Size

Set resolution with WIDTH and HEIGHT environment variables:

docker run \
    -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
    -e WIDTH=1920 -e HEIGHT=1080 \
    -v $HOME/.anthropic:/home/operative/.anthropic \
    -p 5900:5900 -p 8501:8501 -p 6080:6080 -p 8080:8080 \
    -it ghcr.io/hanzoai/operative:latest

XGA resolution (1024x768) is recommended. For higher resolutions, scale screenshots down to XGA and map coordinates back proportionally. For smaller displays, add black padding to reach 1024x768.

Development

./setup.sh  # configure venv, install dev dependencies, pre-commit hooks
docker build . -t operative:local
export ANTHROPIC_API_KEY=%your_api_key%
docker run \
    -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
    -v $(pwd)/operative:/home/operative/ \
    -v $HOME/.anthropic:/home/operative/.anthropic \
    -p 5900:5900 -p 8501:8501 -p 6080:6080 -p 8080:8080 \
    -it operative:local

The docker run command mounts the repo inside the container with auto-reloading enabled.

Credits

Based on Anthropic's computer use demo. See upstream repository for original implementation.

License

MIT

Metadata

Release files for hanzo-operative 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hanzo-operative 0.1.1
File Size Uploaded
hanzo_operative-0.1.1.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hanzo-operative 0.1.1
File Interpreter ABI Platform
hanzo_operative-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 52.0 kB

Release files / hanzo_operative-0.1.1.tar.gz

Download URL hanzo_operative-0.1.1.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8f4e919713197f8d8247c292e156d694718dce8e983c8b85bbedc217edb42728
BLAKE2b-256 checksum
How to use checksums
894cae4468f6d909a66bd05f92a7ee8921e2d1f1311127dba2ff54e1cedba04b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / hanzo_operative-0.1.1-py3-none-any.whl

Download URL hanzo_operative-0.1.1-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fb32505e847f5fa518cc6b42c2d8c4ffb1a0e33334574041d142101469ffec0
BLAKE2b-256 checksum
How to use checksums
dbf1360f8a360b41a123876e3b8d28731533c26f717d82c452ffe768f3d12833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page