Skip to main content

A verified first run

Everything below is a real run from a clean uv virtualenv with no pip installed, against the published SDK. It is what you should see.
Artifacts produced in .hexr/:
One warning is expected off-cluster. hexr build on a laptop logs Could not get enterprise host PID ... Using fallback simulation. PID mapping needs a pod with hostPID: true; there isn’t one on your machine, the build falls back cleanly, and the manifests are unaffected.

Three things fixed in 0.5.31, in case you are on an older SDK

The third one is worth knowing about if you built images before 0.5.31: check which wheel is in your .hexr/ directory against python -c "import hexr; print(hexr.__version__)". If they differ, rebuild.

Usage


Arguments

path
required
Path to your Python agent file.

Hexr Cloud changes five defaults

hexr build behaves differently once you have run hexr login. This is worth knowing before you compare output with a colleague, because the same command can bake a different image on two machines. The cloud defaults apply only when both of these hold:
  1. A saved cloud config is authenticated against a hexr.cloud URL, and
  2. you passed neither --registry nor --pypi-url.
When they do, five values change: They move as a set on purpose. The private index is only reachable through the Workload Identity binding that the service account provides, so taking the index without the binding would give you an image that cannot install its own SDK. The practical consequence: passing --registry alone also turns off the private index, the cloud trust domain and the service account binding. If you want your own registry but the rest of the cloud defaults, pass them explicitly.

Options

string
required
Tenant identifier. Maps to Kubernetes namespace tenant-{tenant}.
string
Override the agent name (default: extracted from @hexr_agent(name=...) or filename).
string
default:"development"
Target environment: development, staging, or production.Affects OPA policies, resource limits, and security scanning levels.
string
Container registry base URL.
No default when you are not logged into Hexr Cloud; the image is tagged locally. When you are logged in and pass neither --registry nor --pypi-url, it defaults to us-central1-docker.pkg.dev/hexr-cloud-prod/hexr-images.
string
Index to download the hexr-sdk wheel from when baking the image.The default depends on whether you are logged into Hexr Cloud:Passing either --pypi-url or --registry explicitly turns the whole set of cloud defaults off, including the registry and the Workload Identity service account binding. They move together on purpose: the private index is only reachable through that binding.
Before 0.5.31 this flag defaulted to the private index in every case, so hexr build failed for anyone without Hexr Cloud access. See A verified first run above.
string
default:"3.11"
Python version for the container.
string
default:"python:3.11-slim"
Base Docker image.
string
Comma-separated cloud providers for credential exchange.
flag
Enable subprocess role management for multi-process agents.
flag
Enable security scanning during build (dependency audit).
path
default:".hexr"
Output directory for generated artifacts.
flag
Generate manifests only β€” skip container image build.
flag
Show what would be generated without creating files.
string
default:"demo.hexr.dev"
SPIFFE trust domain for identity generation.Logged into Hexr Cloud, and left unset, this becomes hexr.cloud.

What Gets Generated


AST Analysis

The build command performs ~2,900 lines of AST analysis to:
  1. Detect the framework β€” CrewAI, LangChain, AutoGen, Strands, Swarm, or pure Python
  2. Discover agents β€” Find all @hexr_agent decorators and framework-specific agent declarations
  3. Map sub-agents β€” Identify roles (researcher, writer, editor) for per-process identity
  4. Infer resources β€” Detect hexr_tool() calls to determine required cloud permissions
  5. Detect A2A β€” Find A2AClient usage and a2a=True parameters
  6. Build coordination graph β€” NetworkX analysis of agent relationships

Examples

Basic Agent

CrewAI with A2A

Production Build