Integration Contract
Keep the public surface narrow. A good first integration exposes onerun function and one result type.
/testbed, or invoke a local Python framework.
1. Package Layout
default.nix when the agent needs a system binary that should be
available on the worker PATH. Pure Python integrations can omit it.
2. Function Surface
src/agentix/claude_code/__init__.py
3. Packaging
pyproject.toml
run.
4. System Binary
Many agent CLIs are easiest to ship with Nix. The derivation should copy the executable intobin/. During agentix build, Agentix links those
binaries under /nix/runtime/bin in the final image.
See the
agentix-cookbook/claude-code
recipe for a complete working package.
5. Caller Composition
Keep generic rollout operations outside the agent wrapper. For example, extracting a patch is a shell operation that works for any agent that edited files:Streaming Output
For long-running agents, expose a streaming function next torun.
Annotate it as AsyncIterator[T]; Agentix automatically uses the stream
transport.
Boundaries
- Pass secrets per call with
env, for exampleenv={"ANTHROPIC_API_KEY": "..."}. - Use a stable default workdir such as
/testbedfor benchmark repos. - Bound
timeoutaggressively. Agent CLIs can hang. - Keep scoring in a scorer module. Keep repo setup in a primitive such as
agentix.bash.