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/__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
plugins/agents/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:Side Channels
c.remote(...) is request/response: the host sends one call and gets
one return value back. When the agent also needs to push progress,
tokens, or LLM traffic to the host while work continues in the sandbox,
use the generic agentix.sio namespace API alongside c.remote():
- sandbox side: subclass
agentix.Namespace, callawait self.emit(...) - host side: subclass
agentix.AsyncClientNamespace, register withclient.register_namespace(...)before connecting
run(...) that collects
output internally and returns a RunResult when the CLI finishes —
that is what agentix.agents.claude_code.run does today.
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.